Struct ProviderRegistry
pub struct ProviderRegistry { /* private fields */ }Expand description
The configured set of providers, selected by name. Default-deny: an empty registry rejects everything, an unknown selection rejects, a mis-kinded credential rejects, and a selected provider’s denial is final.
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, provider: Arc<dyn AuthProvider>) -> Result<()>
pub fn register(&mut self, provider: Arc<dyn AuthProvider>) -> Result<()>
Register a provider (boot-time wiring). Provider names are the selection keys, so a duplicate is ambiguous routing — refused rather than silently shadowed.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
true if no provider is configured (default-deny will reject all).
Sourcepub fn advertised_methods(&self) -> Vec<AuthMethod>
pub fn advertised_methods(&self) -> Vec<AuthMethod>
The methods this registry advertises (for the handshake authMethods).
Sourcepub fn names(&self) -> Vec<&str>
pub fn names(&self) -> Vec<&str>
The configured provider names, in registration order — the enumeration
surface exposed over RPC (no hardcoded provider lists). These are the
valid resolve_named selections.
Sourcepub async fn resolve_named(
&self,
name: &str,
credential: &Credential,
) -> AuthOutcome
pub async fn resolve_named( &self, name: &str, credential: &Credential, ) -> AuthOutcome
Verify credential against the EXPLICITLY selected provider.
Fail-closed and authoritative: an unknown name, a missing credential, or a credential kind the selected provider does not accept is denied; and whatever the selected provider decides is final — a denial can never fall through to another provider that would have accepted the same credential (Rev 8: “failure is authoritative once a method and provider have been selected”).
Sourcepub async fn route_transport(&self, credential: &Credential) -> AuthOutcome
pub async fn route_transport(&self, credential: &Credential) -> AuthOutcome
Route a transport-intrinsic credential (today: the kernel-supplied peer uid) to the ONE provider that handles its kind.
This is not a fallback scan: a credential whose format does not
securely identify its provider (any bearer, any signature) is denied
here — it must go through Self::resolve_named. Zero accepting
providers deny; more than one accepting provider is ambiguous wiring
and denies as misconfigured rather than picking silently.
Trait Implementations§
Source§impl Clone for ProviderRegistry
impl Clone for ProviderRegistry
Source§fn clone(&self) -> ProviderRegistry
fn clone(&self) -> ProviderRegistry
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ProviderRegistry
impl Default for ProviderRegistry
Source§fn default() -> ProviderRegistry
fn default() -> ProviderRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ProviderRegistry
impl !UnwindSafe for ProviderRegistry
impl Freeze for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl UnsafeUnpin for ProviderRegistry
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more