#[non_exhaustive]pub enum AudienceValidationMode {
Permissive,
Warn,
Strict,
}Expand description
How the resource server treats azp when validating JWT audience.
Background. RFC 9068 §4 + OIDC Core §2 establish aud as the
authoritative resource-server claim and azp as the authorized-party
(client) claim. Some OAuth deployments — typically when the MCP server
acts as both OAuth client and resource server (the documented
OAuthProxyConfig topology) — issue tokens where the configured
audience appears only in azp. This enum lets operators decide
whether that historic compatibility fallback is honored, surfaced via
a one-shot warning, or refused.
Default: AudienceValidationMode::Strict — rejects azp-only
matches so a token whose configured audience appears only in azp
is refused. To keep the previous azp-accepting behavior, set
audience_validation_mode = "warn" (one-shot warning per process) or
"permissive" (silent).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Permissive
Accept aud matches and azp-only matches silently. Pre-1.7
behavior. Use only when the IdP cannot be reconfigured to
populate aud.
Warn
Accept aud matches silently. Accept azp-only matches with a
one-shot tracing::warn! per process. Reject neither.
Strict
Accept only aud matches. Reject azp-only matches as audience
mismatch. Default — recommended for new deployments and any
IdP that can be configured to populate aud reliably.
Trait Implementations§
Source§impl Clone for AudienceValidationMode
impl Clone for AudienceValidationMode
Source§fn clone(&self) -> AudienceValidationMode
fn clone(&self) -> AudienceValidationMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AudienceValidationMode
Source§impl Debug for AudienceValidationMode
impl Debug for AudienceValidationMode
Source§impl Default for AudienceValidationMode
impl Default for AudienceValidationMode
Source§fn default() -> AudienceValidationMode
fn default() -> AudienceValidationMode
Source§impl<'de> Deserialize<'de> for AudienceValidationMode
impl<'de> Deserialize<'de> for AudienceValidationMode
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>,
impl Eq for AudienceValidationMode
Source§impl PartialEq for AudienceValidationMode
impl PartialEq for AudienceValidationMode
impl StructuralPartialEq for AudienceValidationMode
Auto Trait Implementations§
impl Freeze for AudienceValidationMode
impl RefUnwindSafe for AudienceValidationMode
impl Send for AudienceValidationMode
impl Sync for AudienceValidationMode
impl Unpin for AudienceValidationMode
impl UnsafeUnpin for AudienceValidationMode
impl UnwindSafe for AudienceValidationMode
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
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.