OpenAgentID documentation
Source referencesRust module referenceopenagent-sdk

openagent-sdk · act

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

Source: openagent-sdk/sdks/rust/src/act.rs. SHA-256: 68f5160930c131e508255fa8ae69bf8ca61b0d84f3c68cf5eb025e2a08b622be.

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.

act::ActVerifierBuilder

Fluent ACT verifier, built by [verify].

#[derive(Debug, Clone)]
pub struct ActVerifierBuilder<'a> {

}

Source line: 26.

act::verify

Begin verifying an ACT envelope (CBOR bytes).

pub fn verify(token: &[u8]) -> ActVerifierBuilder<'_>;

Source line: 37.

act::ActVerifierBuilder<'a>::issuer

Bind the expected issuer. Required: a verifier that does not name the issuer accepts anyone's tokens.

pub fn issuer(mut self, iss: impl Into<String>) -> Self;

Source line: 52.

act::ActVerifierBuilder<'a>::for_audience

Bind the audience this verifier answers for. Required: a token meant for another service must not pass here.

pub fn for_audience(mut self, audience: impl Into<String>) -> Self;

Source line: 59.

act::ActVerifierBuilder<'a>::require_scope

Require a scope the token must grant. Wildcards in the grant expand; in the request they are literal.

pub fn require_scope(mut self, scope: Scope) -> Self;

Source line: 66.

act::ActVerifierBuilder<'a>::trusted_keys

The trusted Ed25519 public keys (raw 32 bytes each). Required.

pub fn trusted_keys(mut self, keys: impl IntoIterator<Item = PublicKeyBytes>) -> Self;

Source line: 72.

act::ActVerifierBuilder<'a>::with_leeway

Allow seconds of clock skew on temporal checks.

pub fn with_leeway(mut self, seconds: i64) -> Self;

Source line: 78.

act::ActVerifierBuilder<'a>::at_time

Pin the verification clock (tests, decision replay).

pub fn at_time(mut self, unix_seconds: i64) -> Self;

Source line: 84.

act::ActVerifierBuilder<'a>::run

Run verification.

Errors

Returns [OpenAgentError::Config] for a missing policy binding, and [OpenAgentError::Verification] carrying the canonical reason (signature, expiry, audience, scope, version - distinct on purpose) when the token itself fails.

pub fn run(self) -> Result<ActClaims>;

Source line: 97.

act::axum_support

#[cfg(feature = "axum")]
pub mod axum_support;

Source line: 127.

act::axum_support::ActPolicy

The shared verifier policy. Cheap to clone (Arc inside).

#[cfg(feature = "axum")]
#[derive(Clone)]
pub struct ActPolicy {

}

Source line: 145.

act::axum_support::ActPolicy::new

Build a policy. Same bindings as the builder: issuer, audience, and at least one trusted key are required.

#[cfg(feature = "axum")]
pub fn new(
            issuer: impl Into<String>,
            audience: impl Into<String>,
            trusted_keys: Vec<PublicKeyBytes>,
        ) -> Result<Self>;

Source line: 156.

act::axum_support::ActPolicy::with_scopes

Require scopes on every request.

#[cfg(feature = "axum")]
pub fn with_scopes(mut self, scopes: Vec<Scope>) -> Self;

Source line: 176.

act::axum_support::ActPolicy::with_leeway

Allow clock skew.

#[cfg(feature = "axum")]
pub fn with_leeway(mut self, seconds: i64) -> Self;

Source line: 182.

act::axum_support::ActContext

Extractor: the verified claims of the request's ACT.

#[cfg(feature = "axum")]
pub struct ActContext(pub ActClaims);

Source line: 189.

On this page