Skip to main content

Module auth

Module auth 

Source
Expand description

JWT authorization types and utilities.

This module provides:

  • Structured scopes for fine-grained authorization
  • JWT claims with scope validation
  • JWT encoding/decoding with Ed25519 signatures
  • Compile-time scope registration via inventory pattern
  • JWT key source abstraction for unified key resolution

Re-exports§

pub use atproto_perimeter::AtprotoPerimeterGateway;
pub use atproto_perimeter::EnrolledPeer;
pub use atproto_perimeter::EnrollmentStore;
pub use crate::identity::Ed25519Vk;
pub use crate::identity::IdentityKeyCandidate;
pub use crate::identity::IdentityKeys;
pub use crate::identity::IdentityResolver;
pub use crate::identity::MlDsaVk;
pub use claims::compute_jkt;
pub use claims::federate_tui_class_client;
pub use claims::install_federate_tui_class_client;
pub use claims::is_local_iss;
pub use claims::ActClaim;
pub use claims::Claims;
pub use claims::Cnf;
pub use claims::CnfJwk;
pub use claims::IdTokenClaims;
pub use claims::OneOrMany;
pub use claims::SessionClaimError;
pub use composite::global_composite_key_set;
pub use composite::CompositeKeyPair;
pub use composite::CompositeKeySet;
pub use composite::CompositeKeySetSnapshot;
pub use composite::CompositePairRole;
pub use composite::CompositePairState;
pub use credential::global_session_registry;
pub use credential::set_global_session_registry;
pub use credential::ActiveOrRevoked;
pub use credential::CredentialId;
pub use credential::CredentialValue;
pub use credential::GlobalSessionRegistryAlreadySet;
pub use credential::InMemorySessionRegistry;
pub use credential::InvalidSessionRecord;
pub use credential::SessionExists;
pub use credential::SessionIdentifier;
pub use credential::SessionKey;
pub use credential::SessionKind;
pub use credential::SessionKindMismatch;
pub use credential::SessionPublicationFailed;
pub use credential::SessionRegisterError;
pub use credential::SessionRegistry;
pub use credential::SessionRevokeError;
pub use credential::SessionState;
pub use det_cbor::det_cbor;
pub use det_cbor::DetCborValue;
pub use federation::FederationKey;
pub use federation::FederationKeySource;
pub use internal_work::admit_internal_work_jti_once;
pub use internal_work::encode_internal_work;
pub use internal_work::verify_internal_work;
pub use internal_work::InternalWorkClaims;
pub use internal_work::InternalWorkContext;
pub use internal_work::InternalWorkScope;
pub use internal_work::INTERNAL_WORK_ISSUER;
pub use internal_work::INTERNAL_WORK_JWT_TYP;
pub use internal_work::MAX_IAT_SKEW_SECS;
pub use internal_work::MAX_LIFETIME_SECS;
pub use jti_blocklist::FileBackedCredentialRevocationStore;
pub use jti_blocklist::global_credential_revocation_store;
pub use jti_blocklist::set_global_credential_revocation_store;
pub use jti_blocklist::CredentialRevocationStore;
pub use jti_blocklist::GlobalStoreAlreadySet;
pub use jti_blocklist::InMemoryCredentialRevocationStore;
pub use jti_blocklist::RevocationPublishError;
pub use jwt::decode_with_federation_candidates;
pub use jwt::composite_kid;
pub use jwt::decode;
pub use jwt::decode_unverified;
pub use jwt::decode_with_any_key;
pub use jwt::decode_with_any_key_lenient;
pub use jwt::decode_with_key;
pub use jwt::encode;
pub use jwt::encode_service_jwt;
pub use jwt::header_alg;
pub use jwt::header_kid;
pub use jwt::is_rfc9068_access_token_type;
pub use jwt::jwk_thumbprint;
pub use jwt::parse_composite_dispatch;
pub use jwt::parse_protected_header;
pub use jwt::CompositeJwtDispatch;
pub use jwt::JwkThumbprintInput;
pub use jwt::JwtError;
pub use jwt::ProtectedHeader;
pub use jwt::RFC9068_ACCESS_TOKEN_TYPES;
pub use key_source::ClusterKeySource;
pub use key_source::FederatedKeySource;
pub use key_source::IssuerResolver;
pub use key_source::JwksFetcher;
pub use key_source::JwksKeySource;
pub use key_source::JwksMode;
pub use key_source::JwtKeySource;
pub use key_subject_resolver::set_global as set_global_key_subject_resolver;
pub use key_subject_resolver::KeySubjectResolver;
pub use mac::bind_time_label;
pub use mac::import_label;
pub use mac::Assurance;
pub use mac::Compartment;
pub use mac::CompartmentSet;
pub use mac::ContentBoundLabel;
pub use mac::GenesisMap;
pub use mac::GenesisReport;
pub use mac::LabelError;
pub use mac::LabeledObject;
pub use mac::Lattice;
pub use mac::LatticeCodecError;
pub use mac::LatticeDecodeError;
pub use mac::LatticeVersion;
pub use mac::Level;
pub use mac::ObjectLabelResolver;
pub use mac::ObjectRef;
pub use mac::SecurityContext;
pub use mac::SecurityLabel;
pub use mac::StaticNodeLabel;
pub use mac::SubjectContextClaims;
pub use mac::VerifiedKeyMaterial;
pub use mac::MAX_COMPARTMENTS;
pub use scope::Scope;
pub use scope_registry::ScopeDefinition;
pub use session_store::FileBackedSessionRegistry;
pub use signer_suite::service_signer_suite_b64;
pub use signer_suite::signer_suite_thumbprint;
pub use signer_suite::SUITE_CLASSICAL_ED25519;
pub use signer_suite::SUITE_HYBRID_ED25519_MLDSA65;
pub use ucan::set_attenuates;
pub use ucan::Ability;
pub use ucan::ApprovalBinding;
pub use ucan::ApprovalError;
pub use ucan::Capability;
pub use ucan::CaveatValue;
pub use ucan::Caveats;
pub use ucan::ChainError;
pub use ucan::Did;
pub use ucan::Resource;
pub use ucan::SignedApproval;
pub use ucan::Ucan;
pub use ucan::UcanError;
pub use ucan::UcanPayload;
pub use ucan::UcanVerifier;

Modules§

atproto_perimeter
ATProto perimeter gateway: external-DID → assurance binding (#549, first half). Native-only — depends on the admission gate (did:web/did:key resolution). ATProto perimeter gateway — external-DID → assurance binding (#549, first half).
claims
JWT claims for authentication.
composite
Atomic exact-pair authority for composite JWT signing and verification.
credential
Issuer-scoped credential and session identity types.
det_cbor
The ONE deterministic-CBOR (RFC 8949) byte encoder for v16 content thumbprints. A direct port of WS-A’s frozen gen_proof_vectors.py::enc (at af08825528627069b3cfbdd763948c4a24689cb5), restricted to the value subset the v16 content thumbprints use.
federation
Abstraction layer for multi-issuer JWT key resolution on the ZMQ transport.
internal_work
Internal execution work orders for the Model→Inference single-service boundary (user-approved D5, PR1678).
jti_blocklist
Issuer-scoped credential-revocation store.
jwt
JWT token implementation with Ed25519 (EdDSA) signatures.
key_source
JWT key source abstraction for unified key resolution.
key_subject_resolver
Global signer-key → authorization-subject resolver (#446).
mac
Native MAC: security labels, lattice, subject contexts, genesis labeling (S1, #567). Platform-independent (no std-only deps) so it compiles for wasm. Native MAC — security labels, the lattice, subject contexts, and genesis labeling. S1 (#567), the foundation of epic #547.
scope
Structured scope for fine-grained authorization.
scope_registry
Compile-time scope registration via inventory pattern.
session_store
Durable (file-backed) session registry — the policy process’s canonical session store, mirroring the credential-revocation authority’s discipline.
signer_suite
Signer-suite thumbprint — the ONE shared helper and encoding for the v16 cnf.hs_signer_suite confirmation method (frozen WS-A credential-profile §1.1/§5). Both the mint side (WS-B ExchangeDelegated) and the verify side (WS-C proof resolution) compute the identical function over the identical bytes — there is no second hash encoding.
ucan
UCAN → Casbin/TE compiler foundation (S5, #571): the UCAN token model, delegation-chain + ceiling/attenuation validation, and the signed (UCAN, bundle_hash) approval binding (hybrid EdDSA + ML-DSA-65 COSE). UCAN → Casbin/TE compiler foundation — S5 / #571 of the native-MAC epic (#547), milestone 1: the vocabulary-INDEPENDENT core.