openagent-aegis-sdk · client
Declared module signatures, types, configuration, and source documentation.
Source: aegis/openagent-aegis-sdk/src/client.rs. SHA-256: 6ab6ca8c8d7eaa5cf749ada855fd6f79bf97d236811596e80512d7e1ebe079ce.
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.
client::AegisStores
Collection of pluggable storage backends for the AEGIS client.
All stores are wrapped in Arc for safe shared access. By default
the client uses in-memory implementations; callers can provide
PostgreSQL-backed (or any other) implementations via the
[AegisClient::with_stores] constructor.
pub struct AegisStores {
/// Session persistence store.
pub session_store: Arc<dyn SessionStore>,
/// Nonce tracking store (replay prevention).
pub nonce_store: Arc<dyn NonceStore>,
/// Delegation persistence store.
pub delegation_store: Arc<dyn DelegationStore>,
/// Revocation tracking store.
pub revocation_store: Arc<dyn RevocationStore>,
/// Key persistence store.
pub key_store: Arc<dyn KeyStore>,
/// Verification result cache store.
pub verification_cache_store: Arc<dyn VerificationCacheStore>
}Source line: 43.
client::AegisClient
Unified AEGIS client.
Holds a [PluginRegistry], a verification pipeline, a session manager, a
delegation tree, and optionally a transaction pipeline. The client also
exposes pluggable [AegisStores] for async persistent storage backends.
pub struct AegisClient {
/// Plugin registry for DID resolvers, auth providers, and the policy engine.
pub registry: Arc<PluginRegistry>,
/// Verification pipeline (resolution -> signature -> lineage -> revocation -> liveness -> cache).
pub verifier: VerificationPipeline,
/// Session manager.
pub sessions: SessionManager,
/// Delegation tree for tracking active delegations.
pub delegations: DelegationTree,
/// Transaction authorization pipeline (present only when a signing backend is provided).
pub transactions: Option<TransactionPipeline>,
/// Configuration snapshot.
pub config: AegisConfig,
/// Pluggable persistent storage backends.
pub stores: AegisStores
}Source line: 76.
client::AegisClient::new
Create a new AEGIS client with the given plugin registry and config.
Uses in-memory storage backends by default. No signing backend is
attached; call with_signer to enable the
transaction pipeline, or with_stores to
inject custom storage backends.
pub fn new(registry: Arc<PluginRegistry>, config: AegisConfig) -> Self;Source line: 100.
client::AegisClient::with_stores
Create a new AEGIS client with custom storage backends.
This constructor allows callers to inject PostgreSQL-backed or other persistent storage implementations for all AEGIS storage traits.
pub fn with_stores(
registry: Arc<PluginRegistry>,
config: AegisConfig,
stores: AegisStores,
) -> Self;Source line: 126.
client::AegisClient::with_defaults
Create a client with default configuration.
pub fn with_defaults(registry: Arc<PluginRegistry>) -> Self;Source line: 153.
client::AegisClient::with_signer
Attach a signing backend so the transaction pipeline is available.
pub fn with_signer(mut self, signer: Arc<dyn SigningBackend>) -> Self;Source line: 158.
client::AegisClient::verify_identity
Verify an identity by DID.
Runs the full verification pipeline: resolution -> signature -> lineage -> revocation -> liveness. Results are cached according to the verification config TTL.
pub async fn verify_identity(
&self,
did: &str,
) -> Result<VerificationResult, VerificationError>;Source line: 170.
client::AegisClient::verify_identity_fresh
Verify an identity, bypassing the cache.
pub async fn verify_identity_fresh(
&self,
did: &str,
) -> Result<VerificationResult, VerificationError>;Source line: 178.
client::AegisClient::authenticate
Authenticate a credential through the registered auth providers.
On success a new [Session] is created and returned.
pub async fn authenticate(
&self,
credential: &AuthCredential,
identity_type: IdentityType,
) -> Result<Session, AuthError>;Source line: 190.
client::AegisClient::get_session
Look up a session by its ID.
pub fn get_session(&self, session_id: &str) -> Result<Session, AuthError>;Source line: 215.
client::AegisClient::revoke_session
Revoke a session.
pub fn revoke_session(&self, session_id: &str) -> Result<(), AuthError>;Source line: 220.
client::AegisClient::is_session_valid
Check whether a session is still valid (exists and not expired).
pub fn is_session_valid(&self, session_id: &str) -> bool;Source line: 225.
client::AegisClient::authorize
Evaluate a policy request through the registered policy engine.
pub async fn authorize(&self, request: &PolicyRequest) -> Result<PolicyDecision, PolicyError>;Source line: 232.
client::AegisClient::compose_policy_decisions
Compose multiple policy decisions using deny-overrides (spec SS8.6).
pub fn compose_policy_decisions(&self, decisions: &[PolicyDecision]) -> PolicyDecision;Source line: 237.
client::AegisClient::delegate
Create a delegation from delegator_did to delegate_did with the
given scope, signed by the delegator's key.
The delegation is automatically added to the internal delegation tree.
pub fn delegate(
&mut self,
delegator_did: &str,
delegate_did: &str,
scope: DelegationScope,
expires: Option<DateTime<Utc>>,
signing_key: &SigningKey,
verification_method: &str,
) -> Result<Delegation, DelegationError>;Source line: 247.
client::AegisClient::verify_delegation
Verify a delegation proof against the delegator's public key.
pub fn verify_delegation(
&self,
delegation: &Delegation,
delegator_public_key: &VerifyingKey,
) -> Result<bool, DelegationError>;Source line: 270.
client::AegisClient::revoke_delegation
Revoke a delegation by ID. Cascading: all child delegations derived from the revoked delegation are also revoked.
Returns the list of revoked delegation IDs.
pub fn revoke_delegation(
&mut self,
delegation_id: &str,
) -> Result<Vec<String>, DelegationError>;Source line: 282.
client::AegisClient::sign_transaction
Authorize and sign a transaction through the full pipeline: verify identity -> check delegation -> evaluate policy -> fulfill obligations -> sign.
Requires a signing backend to be attached via with_signer.
pub async fn sign_transaction(
&self,
tx: Transaction,
auth: &AuthContext,
policy_decision: &PolicyDecision,
) -> Result<AuthorizedTransaction, WalletError>;Source line: 296.