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

Function load_identity_public

libatomic/src/daemon/services_agent.rs:3010–3022  ·  view source on GitHub ↗

Load an identity for VERIFICATION only — the public key, never a secret key. The external-signing flow (`--prepare`/`--signed`) must work for an identity whose key is held elsewhere, so it may not touch the key store. The name is required: an unbound caller cannot borrow the daemon's default human key by signing as nobody (CONTRACT "Sandbox and vault writes": unbound grants cannot use daemon defau

(name: &str)

Source from the content-addressed store, hash-verified

3008/// default human key by signing as nobody (CONTRACT "Sandbox and vault
3009/// writes": unbound grants cannot use daemon default human keys).
3010fn load_identity_public(name: &str) -> Result<Identity, Status> {
3011 let store = IdentityStore::open_default()
3012 .map_err(|error| domain_status(ErrorCode::Internal, format!("identity store: {error}")))?;
3013 if name.is_empty() {
3014 return Err(domain_status(
3015 ErrorCode::InvalidArgument,
3016 "an externally-signed attestation names the identity it is signed by",
3017 ));
3018 }
3019 store
3020 .load_by_name(name)
3021 .map_err(|error| domain_status(ErrorCode::NotFound, format!("identity '{name}': {error}")))
3022}
3023
3024// Resolve verification material only. Never open/create an identity store or
3025// load a secret key; the proof's DID, not the default identity, selects a signer.

Callers 2

prepare_attestationMethod · 0.85
record_attestationMethod · 0.85

Calls 3

domain_statusFunction · 0.85
load_by_nameMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected