MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate_token

Function validate_token

atomic-repository/src/change_source/fsmonitor.rs:144–149  ·  view source on GitHub ↗
(token: Option<&ChangeSourceToken>)

Source from the content-addressed store, hash-verified

142}
143
144fn validate_token(token: Option<&ChangeSourceToken>) -> Result<(), ChangeSourceError> {
145 if token.is_some_and(|token| !token.0.starts_with(TOKEN_PREFIX)) {
146 return Err(ChangeSourceError::UnknownToken);
147 }
148 Ok(())
149}
150
151fn output_token(payload: &[u8]) -> ChangeSourceToken {
152 let mut bytes = TOKEN_PREFIX.to_vec();

Callers 1

changesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected