mars-server · auth::registry
Public declarations and documentation for mars-server::auth::registry.
Package: mars-server · Workspace version: 0.1.0 · Module: auth::registry
This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.
auth::registry::AuthProfileAdapter
Provider adapter boundary.
Implementations own provider-specific verification and translate successful
proofs into the MARS-owned [Principal] model. The always-on auth domain
never imports provider types.
#[async_trait]
pub trait AuthProfileAdapter: Send + Sync {
/// Stable profile enabled by configuration.
fn profile(&self) -> AuthProfile;
/// Credential scheme routed to this adapter.
fn scheme(&self) -> &'static str;
/// Verify one provider credential.
async fn authenticate(&self, credential: &Credential) -> Result<Principal, AuthError>;
}Source line: 16.
auth::registry::AuthProfileRegistry
Immutable-after-startup registry of concrete authentication adapters.
#[derive(Clone, Default)]
pub struct AuthProfileRegistry {
}Source line: 29.
auth::registry::AuthProfileRegistry::new
pub fn new() -> Self;Source line: 35.
auth::registry::AuthProfileRegistry::register
Register a concrete adapter.
Duplicate schemes and duplicate profile implementations are rejected so adapter selection cannot depend on registration order.
pub fn register(&mut self, adapter: Arc<dyn AuthProfileAdapter>) -> Result<(), AuthError>;Source line: 43.
auth::registry::AuthProfileRegistry::authenticate
Resolve and invoke the adapter selected by credential.scheme.
pub async fn authenticate(&self, credential: &Credential) -> Result<Principal, AuthError>;Source line: 73.
auth::registry::AuthProfileRegistry::profile_for_scheme
Profile selected by a credential scheme, if registered.
pub fn profile_for_scheme(&self, scheme: &str) -> Option<AuthProfile>;Source line: 92.
auth::registry::AuthProfileRegistry::contains_profile
Whether a concrete adapter is registered for profile.
pub fn contains_profile(&self, profile: &AuthProfile) -> bool;Source line: 97.
auth::registry::AuthProfileRegistry::registered_profiles
Registered profile identifiers in deterministic order.
pub fn registered_profiles(&self) -> BTreeSet<AuthProfile>;Source line: 102.
Source provenance
Source: mars-server/src/auth/registry.rs · SHA-256 50922efc8fe1cf808292da12a2c9028b3f4196bce0a2b9875fb81b3e8d5b50dd. Package overview.