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

Function normalize_id

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

Accept either the base32 id or the full URN.

(raw: &str)

Source from the content-addressed store, hash-verified

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

Callers 3

executeMethod · 0.85
load_documentFunction · 0.85

Calls 1

to_base32Method · 0.45

Tested by 1