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

Function normalize_id

atomic-cli/src/commands/identity/delegation.rs:608–614  ·  view source on GitHub ↗

Accept either the base32 id or the full URN.

(raw: &str)

Source from the content-addressed store, hash-verified

606
607/// Accept either the base32 id or the full URN.
608fn normalize_id(raw: &str) -> CliResult<String> {
609 DelegationId::from_base32(raw)
610 .map(|id| id.to_base32())
611 .ok_or_else(|| CliError::InvalidArgument {
612 message: format!("'{raw}' is not a delegation id"),
613 })
614}
615
616fn load_document(store: &IdentityStore, raw: &str) -> CliResult<String> {
617 let id = normalize_id(raw)?;

Callers 3

executeMethod · 0.85
load_documentFunction · 0.85

Calls 1

to_base32Method · 0.45

Tested by 1