pub struct ValidationPolicy {
pub purpose: TokenPurpose,
pub trusted_issuers: Vec<String>,
pub expected_audiences: Vec<String>,
pub require_at_jwt: bool,
}Expand description
Claim-level validation applied after signature verification.
Fields§
§purpose: TokenPurpose§trusted_issuers: Vec<String>Exact-match issuer allow-list; empty = no issuer pinning.
expected_audiences: Vec<String>Audience allow-list; empty = no audience pinning.
require_at_jwt: boolRequire the RFC 9068 at+jwt JOSE typ on access-purpose tokens.
Implementations§
Source§impl ValidationPolicy
impl ValidationPolicy
Sourcepub fn access() -> Self
pub fn access() -> Self
Access-token policy: type="access", sub/exp/iat required, and
the at+jwt JOSE typ pinned (RFC 9068 §2.1 — every auth_service mint
carries it since WP-03b).
Sourcepub fn id_token() -> Self
pub fn id_token() -> Self
ID-token policy. typ is not pinned: OIDC ID tokens are plain JWTs
and the type claim itself tolerates absence on pre-SEC-02 mints (the
only legacy compat window, matching the service).
Sourcepub fn internal_assertion() -> Self
pub fn internal_assertion() -> Self
Service/client-credentials assertion: an access-shaped token whose
sub IS the client_id. Carries the at+jwt typ.
pub fn with_trusted_issuers<I, S>(self, issuers: I) -> Self
pub fn with_expected_audiences<I, S>(self, audiences: I) -> Self
Sourcepub fn allow_legacy_typ(self) -> Self
pub fn allow_legacy_typ(self) -> Self
Compat window for pre-WP-03b access tokens that carry no typ header.
Keep this off in production; it exists so consumers can ride out an
issuer upgrade without rejecting in-flight tokens.
Trait Implementations§
Source§impl Clone for ValidationPolicy
impl Clone for ValidationPolicy
Source§fn clone(&self) -> ValidationPolicy
fn clone(&self) -> ValidationPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more