Skip to main content

Module auth

Module auth 

Source
Expand description

Authorization module for RBAC/ABAC access control

Uses Casbin for policy-based access control with policies stored in the .registry/policies/ directory.

Also provides JWT token authentication with Ed25519 signatures.

Re-exports§

pub use federation::FederationKeyResolver;
pub use key_rotation::Es256KeySlot;
pub use key_rotation::Es256SigningKeyStore;
pub use key_rotation::RotationStores;
pub use key_rotation::SigningKeyStore;
pub use key_rotation::MlDsaKeySlot;
pub use key_rotation::MlDsaSigningKeyStore;
pub use op_log::load_head_verifying_key;
pub use op_log::load_or_init_head_signing_key;
pub use op_log::publish_head_verifying_key;
pub use op_log::resolve_oplog_state_dir;
pub use op_log::seal_op_log_head;
pub use op_log::ActiveGeneration;
pub use op_log::ActiveGenerationSource;
pub use op_log::FixedGenerationSource;
pub use op_log::SealedHeadEs256Source;
pub use op_log::SealedOpLogHead;
pub use pglite_store::PgliteUserStore;
pub use policy_migration::migrate_policy_csv;
pub use policy_templates::get_template;
pub use policy_templates::get_templates;
pub use policy_templates::PolicyTemplate;
pub use policy_templates::ServicePolicyRule;
pub use policy_templates::SERVICE_BASE_POLICIES;
pub use rocksdb_store::RocksDbUserStore;
pub use user_store::decode_pubkey_base64;
pub use user_store::pubkey_fingerprint;
pub use user_store::AccountKeyCustody;
pub use user_store::DeviceRecord;
pub use user_store::DeviceStore;
pub use user_store::ExternalIdentityBinding;
pub use user_store::ExternalIdentityResolution;
pub use user_store::HostedAccountProvisionError;
pub use user_store::HostedAccountProvisioning;
pub use user_store::KeyAlgorithm;
pub use user_store::PubkeyEntry;
pub use user_store::UserFilter;
pub use user_store::UserProfile;
pub use user_store::UserProfilePatch;
pub use user_store::UserStore;

Modules§

device_challenge
Anonymous device enrollment — stateless HMAC challenge and Ed25519 verification.
encrypted_columns
Envelope encryption for relational UserStore value columns (#1377).
federation
JWKS fetch and cache for multi-issuer JWT verification.
federation_admission
hyprstream-side wiring for the federation admission gate (#137, M3).
id_token_verify
External IdP id_token verification with multi-algorithm JWKS support.
identity_store
Persistent file-based credential storage.
jwks_fetcher
TLS-validated JWKS retrieval for the service-authentication path.
jwt
JWT token implementation.
key_rotation
JWT signing key rotation — multi-slot drain/active/lead lifecycle.
mesh_trust
Admin-anchored mesh post-quantum trust store construction (#157, Option A).
op_log
C4 (#1170): the sealed op-log head — cross-process source of truth for the active #atproto ES256 generation. Closes #1123.
pglite_store
Relational UserStore on the shared #1351 embedded PostgreSQL handle.
policy_migration
Policy CSV migration from flat to dot-namespaced action strings.
policy_templates
Built-in policy templates for bootstrapping access control
proof_enrollment
v16 request-proof signer enrollment manifest (design §4.4, §11).
rocksdb_store
RocksDB-backed user store with Cap’n Proto serialization.
service_enrollment
Service enrollment manifest — the authority-owned declaration of service identity, target clearance, allowed audiences, and workload-session policy (v16 §11).
service_jwt
Shared helper for service JWT issuance with load-or-renew semantics.
user_store
User credential store abstraction.

Structs§

Claims
JWT claims for authentication.
PolicyManager
Policy manager wrapping Casbin enforcer
ProductionUserStore
Opaque handle proving that an account store passed production admission.

Enums§

JwtError
Errors from JWT operations
Operation
Operation types that can be controlled via policies
PolicyError
Errors from policy operations
ScopeAction

Constants§

SCHEMA_SCOPE_ACTIONS
Every schema-defined scope action, in its Cap’n Proto ordinal order.

Functions§

capabilities_to_access_string
Convert capabilities to an access string based on policy
federation_registration_resource
Encode a normalized federation origin as a policy resource.
global_policy_manager
Access the process-global PolicyManager. Returns None before PolicyService starts.
scope_action_from_name
Parse a canonical capability token into the generated schema action. Unknown tokens fail closed.
scope_action_name
Return the canonical capability token for a generated schema action.
set_global_policy_manager
Set the process-global PolicyManager. Called once by the PolicyService factory.
write_policy_file
Write a policy file with restrictive permissions (0o640 on Unix).