pub struct OidcSharedConfig {
pub remote: OAuthProviderRemoteConfig,
pub client_id: Option<String>,
pub client_secret: Option<String>,
pub required_scopes: Vec<String>,
}Expand description
Shared OIDC alias configuration block — provider remote fallback skeleton.
When present in the application config (typically [oidc]), provides
fallback values for OAuthProviderRemoteConfig fields that both
oidc-client and oauth-resource-server need. Also holds optional
confidential-client defaults (client_id, client_secret) that are
commonly shared in single-provider deployments with introspection.
§Current scope (supported fields)
well_known_url,issuer_url,jwks_uri— URL fields with true presence-aware fallback (localSome> sharedSome>None)client_id,client_secret— optional confidential-client defaults; not pure provider connectivity, but commonly shared betweenoidc_client(full client) andoauth_resource_server.introspectionrequired_scopes— scopes that MUST appear in token endpoint responses; presence-aware (Vec::is_emptysentinel: local non-empty wins, else shared)
§Known limitations
Duration fields (metadata_refresh_interval, jwks_refresh_interval) are
non-optional in OAuthProviderRemoteConfig and use serde defaults. The
current implementation uses sentinel heuristics and cannot distinguish
“local explicitly set to the default” from “local not configured”. A future
iteration should migrate these to Option<Duration>.
§Shared but not provider connectivity
client_id and client_secret can be shared via [oidc], but they must
be resolved separately from OAuthProviderRemoteConfig. They are exposed
on this struct as optional fields and resolved through dedicated helpers.
Fields§
§remote: OAuthProviderRemoteConfigShared provider connectivity settings (URL + interval fields).
client_id: Option<String>Optional confidential-client default. Not pure provider connectivity; shared when both oidc-client and resource-server introspection use the same client identity against a single provider.
client_secret: Option<String>Optional confidential-client secret default. See client_id.
required_scopes: Vec<String>Shared required-scopes list. Applied when the local client config does
not specify its own required_scopes.
Implementations§
Sourcepub fn resolve_remote(
&self,
local: &OAuthProviderRemoteConfig,
) -> OAuthProviderRemoteConfig
pub fn resolve_remote( &self, local: &OAuthProviderRemoteConfig, ) -> OAuthProviderRemoteConfig
Resolve a local OAuthProviderRemoteConfig against this shared
fallback. For Option<String> URL fields, local Some takes
priority. For duration fields, see the struct-level doc on known
limitations.
Sourcepub fn resolve_client_id(&self, local: Option<&str>) -> Option<String>
pub fn resolve_client_id(&self, local: Option<&str>) -> Option<String>
Resolve a local optional client_id String against the shared
client_id default.
Returns local if it is Some; otherwise falls back to the shared
default. None means neither local nor shared has a value.
Sourcepub fn resolve_client_secret(&self, local: Option<&str>) -> Option<String>
pub fn resolve_client_secret(&self, local: Option<&str>) -> Option<String>
Resolve a local optional client_secret against the shared default.
Sourcepub fn resolve_required_scopes(&self, local: &[String]) -> Vec<String>
pub fn resolve_required_scopes(&self, local: &[String]) -> Vec<String>
Resolve a local required_scopes list against the shared default.
Resolution: local non-empty wins; when local is empty the shared list is
used instead. This allows partial overrides while still using
Vec::is_empty as the “not set” sentinel (no Option wrapper needed).
Trait Implementations§
Source§fn clone(&self) -> OidcSharedConfig
fn clone(&self) -> OidcSharedConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn default() -> OidcSharedConfig
fn default() -> OidcSharedConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OidcSharedConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OidcSharedConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
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