#[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::Warn — accepts azp-only
matches but emits a tracing::warn! once per process so operators
can detect and migrate token-issuing IdP configurations toward
populating aud correctly. Future major versions may default to
AudienceValidationMode::Strict.
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. Default
since 1.7.0.
Strict
Accept only aud matches. Reject azp-only matches as audience
mismatch. 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 moreSource§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>,
Source§impl PartialEq for AudienceValidationMode
impl PartialEq for AudienceValidationMode
Source§fn eq(&self, other: &AudienceValidationMode) -> bool
fn eq(&self, other: &AudienceValidationMode) -> bool
self and other values to be equal, and is used by ==.