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

Function load_for_delegate

atomic-cli/src/commands/delegation.rs:70–92  ·  view source on GitHub ↗

Every stored certificate naming `identity` as the delegate, verified. A thin adapter over [`atomic_canonical::delegation::load_for_delegate`] so the CLI, the agent recording path, and anything else asking this question get the same answer from the same code.

(
    store: &IdentityStore,
    identity: &Identity,
)

Source from the content-addressed store, hash-verified

68/// the CLI, the agent recording path, and anything else asking this question
69/// get the same answer from the same code.
70pub fn load_for_delegate(
71 store: &IdentityStore,
72 identity: &Identity,
73) -> CliResult<Vec<ResolvedDelegation>> {
74 let stored = cert::load_for_delegate(store, identity)
75 .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to load delegations: {e}")))?;
76
77 Ok(stored
78 .into_iter()
79 .map(|s| {
80 let status = if s.revoked_locally {
81 DelegationStatus::Revoked
82 } else {
83 s.delegation.status()
84 };
85 ResolvedDelegation {
86 delegation: s.delegation,
87 document: s.document,
88 status,
89 }
90 })
91 .collect())
92}
93
94/// The certificate to use for `identity` against `server`.
95///

Callers 5

active_forFunction · 0.70
executeMethod · 0.50
executeMethod · 0.50
runMethod · 0.50
runMethod · 0.50

Calls 2

into_iterMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected