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,
)
| 68 | /// the CLI, the agent recording path, and anything else asking this question |
| 69 | /// get the same answer from the same code. |
| 70 | pub 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 | /// |