OpenAgentID documentation
Source referencesRust module referenceopenagent-server

openagent-server · authority

Declared module signatures, types, configuration, and source documentation.

Source: openagents/openagent.id/crates/openagent-server/src/authority.rs. SHA-256: 3c9c321ec47adf7eb3bc86427418bc9f67fca6ebf5f141fc75e6df5232e4cec3.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

authority::LegacyLineageEvidence

Parsed legacy lineage retained strictly as migration/audit evidence.

This type deliberately does not use an authority-oriented name. There is no authoritative lineage result type in the containment release; adding one requires a separately reviewed hardened verifier integration.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct LegacyLineageEvidence {
/// DID named as the subject by the legacy evidence.

pub subject: String,
/// Root DID reported by the legacy evidence.

pub root: String,
/// Reported path kind, e.g. `human_to_agent`.

pub path_kind: String,
/// Parser/source identifier.

pub source: String,
/// Reconstructed informational path, ordered root to subject.

pub path: Vec<String>,
/// Finalized block reported by the source.

pub finalized_block: u64,
/// Scopes reported by the legacy evidence; never authorization grants.

pub scopes: Vec<String>,
/// Reported generation/depth from root to subject.

pub generation: u32,
/// Reported root kind.

#[serde(skip_serializing_if = "Option::is_none")]
pub root_kind: Option<String>,
/// Optional org lineage root commitment.

#[serde(skip_serializing_if = "Option::is_none")]
pub org_root_commitment: Option<String>,
/// Optional expiry timestamp for the authority edge/path.

#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>
}

Source line: 16.

authority::PrivilegedAuthorityRequest

Request passed to a deployment-provided privileged authority verifier.

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PrivilegedAuthorityRequest {
pub subject_did: String,
pub required_path_kind: Option<String>,
pub required_scopes: Vec<String>,
pub min_finalized_block: Option<u64>
}

Source line: 46.

authority::PrivilegedAuthorityVerifier

Adapter trait for parsing legacy OAS/Sigil lineage evidence.

The output is intentionally [LegacyLineageEvidence], so an adapter cannot present the legacy profile as authoritative at compile time.

#[async_trait]
pub trait PrivilegedAuthorityVerifier: Send + Sync {
    async fn verify(
        &self,
        request: PrivilegedAuthorityRequest,
    ) -> Result<LegacyLineageEvidence, AuthorityError>;
}

Source line: 58.

authority::MissingAuthorityVerifier

Authority verifier used when no OAS/Sigil adapter is installed.

pub struct MissingAuthorityVerifier;

Source line: 66.

authority::AuthorityError

#[derive(Debug, thiserror::Error)]
pub enum AuthorityError {
    #[error("legacy lineage evidence is informational and cannot authorize")]
    LegacyLineageNotAuthoritative,
    #[error("authoritative lineage verification is unavailable")]
    LineageVerificationUnavailable,
    #[error("privileged lineage authority is malformed: {0}")]
    Malformed(String),
    #[error("privileged lineage authority was rejected: {0}")]
    Rejected(String),
}

Source line: 79.

authority::require_authoritative_lineage

Rejects legacy lineage at a privileged authorization boundary.

The arguments that formerly shaped structural acceptance remain on the API during migration so callers cannot accidentally remove an authorization gate. They are intentionally not consulted: no legacy field combination can satisfy the privilege predicate.

pub fn require_authoritative_lineage(
    _subject_did: &str,
    _evidence: &LegacyLineageEvidence,
    _required_path_kind: Option<&str>,
    _required_scopes: &[String],
) -> Result<std::convert::Infallible, AuthorityError>;

Source line: 96.

On this page