pub struct OAuthConfig {
pub enabled: bool,
pub issuer: String,
pub audience: String,
pub jwks_url: String,
pub identity_mode: OAuthIdentityMode,
pub role_claim: Option<String>,
pub tenant_claim: Option<String>,
pub default_role: Role,
pub map_to_existing_users: bool,
pub accept_bearer: bool,
}Expand description
Configuration for OAuth/OIDC auth. Multiple issuers can be registered in parallel — the validator tries each until one’s signature verification succeeds.
Fields§
§enabled: boolMaster switch. When false the validator is bypassed.
issuer: StringExpected iss claim. Tokens with a different issuer are
rejected even when the signature validates against a shared key.
audience: StringRequired aud claim. The JWT’s audience (string or array) must
contain this value.
jwks_url: StringJWKS endpoint URL (e.g. https://id.example.com/.well-known/jwks.json).
Fetched lazily on first token + periodically by the refresh task.
identity_mode: OAuthIdentityModeHow to turn JWT claims into a RedDB username.
role_claim: Option<String>Optional claim whose string value maps to Role::from_str.
tenant_claim: Option<String>Claim name carrying the tenant id. Optional — when None no
tenant is extracted (the resulting identity is platform-scoped).
Convention: "tenant". Override with RED_OAUTH_TENANT_CLAIM.
default_role: Role§map_to_existing_users: bool§accept_bearer: boolAccept Bearer-prefixed Authorization headers. Always true in
Phase 3.4; kept as a knob so custom auth schemes can bolt on
without duplicating the validator.
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Source§fn clone(&self) -> OAuthConfig
fn clone(&self) -> OAuthConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OAuthConfig
impl Debug for OAuthConfig
Source§impl Default for OAuthConfig
impl Default for OAuthConfig
Source§fn default() -> OAuthConfig
fn default() -> OAuthConfig
Auto Trait Implementations§
impl Forget for OAuthConfig
impl Freeze for OAuthConfig
impl Move for OAuthConfig
impl RefUnwindSafe for OAuthConfig
impl Send for OAuthConfigwhere
RawVecInner: Send,
impl Sync for OAuthConfigwhere
RawVecInner: Sync,
impl Unpin for OAuthConfig
impl UnsafeUnpin for OAuthConfig
impl UnwindSafe for OAuthConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request