pub struct OidcProvider {
pub name: String,
pub issuer: String,
pub client_id: String,
pub client_secret: String,
pub trusted_ca_file: Option<String>,
pub scopes: Vec<String>,
pub introspection_cache_ttl_s: u64,
pub introspection_endpoint: Option<String>,
pub revocation_endpoint: Option<String>,
pub consumer: Option<String>,
pub fail_open: bool,
}Expand description
One OIDC provider (DW-034): an OpenID Connect issuer whose Bearer
tokens are validated by token introspection (RFC 7662) rather than
local JWT signature verification. The gateway fetches the issuer’s
discovery document ({issuer}/.well-known/openid-configuration) to
learn the introspection, revocation, authorization, and token
endpoints, then introspects presented Bearer tokens (caching the
result keyed by token hash with a configurable TTL). The provider
also backs the authorization-code + PKCE relying-party flow, token
exchange (RFC 8693), and token revocation (RFC 7009).
Fields§
§name: String§issuer: StringThe OIDC issuer URL (e.g. https://idp.example.com). The
discovery document is fetched from
{issuer}/.well-known/openid-configuration. Must be an absolute
http(s):// URL; validation rejects anything else. The
introspection result’s iss (when present) is checked against
this issuer for defense against token confusion.
client_id: StringThe gateway’s client identifier at the IdP (RFC 6749 section
2.2). Sent as the username of the HTTP Basic auth header to the
introspection and token endpoints, and as client_id in the
authorization-code and token-exchange request bodies.
client_secret: StringThe gateway’s client secret (RFC 6749 section 2.3.1). Either the
value INLINE (redacted in every config echo, DW-045) or a
${...} secret reference (env or file) resolved at config-compile
time and re-read on every reload. Sent as the password of the
HTTP Basic auth header. SECRET: never logged, never in Debug.
trusted_ca_file: Option<String>Path to a PEM file of CA certificates the OIDC HTTP client
trusts for its https:// connections INSTEAD of the default
public (webpki) root set: for an IdP served over TLS by a private
CA. The file may carry several certificates (a typical CA bundle).
Only meaningful with an https:// issuer; validation rejects the
combination with an http:// issuer. The file must exist and be
readable at config compile time.
scopes: Vec<String>Scopes to request (default ["openid"]). Sent in the
authorization-code flow’s authorization request and the
token-exchange request body (space-joined).
introspection_cache_ttl_s: u64Cache TTL for introspection results, in seconds (default 60). A
cached active: true result short-circuits the IdP call for this
duration; a cached active: false result is NOT cached (it is
re-checked on the next request so a revoked token is noticed
promptly). Must be > 0; validation rejects 0.
introspection_endpoint: Option<String>Override the discovery-discovered introspection endpoint. Absent (the default): the endpoint is taken from the discovery document. Useful when the IdP’s discovery document is incorrect or the endpoint is behind a different host.
revocation_endpoint: Option<String>Override the discovery-discovered revocation endpoint. Absent (the default): the endpoint is taken from the discovery document.
consumer: Option<String>Consumer this provider’s tokens authenticate (like
JwtProvider::consumer). Absent: the introspection result’s
sub claim is used as the consumer name. When set, every
successfully introspected token resolves to this consumer
regardless of the sub claim.
fail_open: boolFail-open posture when the IdP is unreachable (network error, non-2xx, malformed response). Default false (fail closed = 401): the gateway refuses to authenticate a token it cannot introspect. When true, the gateway treats an IdP failure as anonymous (pass-through) rather than rejecting the request. Fail-open trades security for availability; use with care.
Trait Implementations§
Source§impl Clone for OidcProvider
impl Clone for OidcProvider
Source§fn clone(&self) -> OidcProvider
fn clone(&self) -> OidcProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OidcProvider
impl Debug for OidcProvider
Source§impl<'de> Deserialize<'de> for OidcProvider
impl<'de> Deserialize<'de> for OidcProvider
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for OidcProvider
impl JsonSchema for OidcProvider
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for OidcProvider
impl PartialEq for OidcProvider
Source§impl Serialize for OidcProvider
impl Serialize for OidcProvider
impl StructuralPartialEq for OidcProvider
Auto Trait Implementations§
impl Freeze for OidcProvider
impl RefUnwindSafe for OidcProvider
impl Send for OidcProvider
impl Sync for OidcProvider
impl Unpin for OidcProvider
impl UnwindSafe for OidcProvider
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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