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

Function active_delegation_urn

atomic-agent/src/identity.rs:142–149  ·  view source on GitHub ↗

The delegation certificate currently authorizing this agent, as a URN. Recorded on the change envelope so a reader months later can ask the server whether that specific certificate was still good, rather than inferring authority from an author string. Returns `None` when no agent identity is configured or none of its certificates is currently in force — the plus-tag path has no certificate to nam

(
    agent_identity: Option<&str>,
    identity_dir: Option<&Path>,
)

Source from the content-addressed store, hash-verified

140/// configured or none of its certificates is currently in force — the plus-tag
141/// path has no certificate to name.
142pub fn active_delegation_urn(
143 agent_identity: Option<&str>,
144 identity_dir: Option<&Path>,
145) -> Option<String> {
146 let (store, identity) = load_selected_agent_identity(agent_identity, identity_dir)?;
147 atomic_canonical::delegation::active_for_delegate(&store, &identity)
148 .map(|d| d.delegation.id.to_urn())
149}
150
151/// Environment variable naming the delegated agent identity to sign as.
152///

Callers 1

build_turn_envelopeFunction · 0.85

Calls 3

active_for_delegateFunction · 0.85
to_urnMethod · 0.45

Tested by

no test coverage detected