pub enum AuthValidator {
Bearer(BearerValidator),
Oidc(OidcValidator),
}Expand description
Resolves either to a BearerValidator or an OidcValidator
depending on the [auth] block in the config. Built once at server
start; cloned cheaply on every request.
Variants§
Bearer(BearerValidator)
Oidc(OidcValidator)
Implementations§
Source§impl AuthValidator
impl AuthValidator
Sourcepub fn from_config(config: &AuthConfig, default_tenant: TenantId) -> Self
pub fn from_config(config: &AuthConfig, default_tenant: TenantId) -> Self
Build from a config block + the daemon’s default tenant.
Bearer mode binds every authenticated request to the daemon’s default tenant; OIDC mode resolves the tenant per-token from the configured custom claim.
Operator foot-gun guard: bearer mode with an empty token
would silently accept Authorization: Bearer (no actual
secret). The daemon refuses this at boot by panicking — better
to fail loudly than to ship a misconfigured [auth] block to
production. The CLI --bearer-token-file path already refuses
empty files in http_serve.rs::read_bearer_token_file; this
closes the equivalent hole on the config-driven path.
Trait Implementations§
Source§impl Clone for AuthValidator
impl Clone for AuthValidator
Source§fn clone(&self) -> AuthValidator
fn clone(&self) -> AuthValidator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AuthValidator
impl !RefUnwindSafe for AuthValidator
impl Send for AuthValidator
impl Sync for AuthValidator
impl Unpin for AuthValidator
impl UnsafeUnpin for AuthValidator
impl !UnwindSafe for AuthValidator
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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