#[non_exhaustive]pub struct JwtConfig {
pub keys: Option<JwtKeys>,
pub audience: Option<String>,
pub issuer: Option<String>,
pub role_claim_key: String,
pub anon_role: Option<String>,
pub jwks: Option<Jwks>,
}Expand description
JWT configuration.
#[non_exhaustive] from 3.0.0, so that verifying keys and claims of new
kinds is a minor release: start from JwtConfig::default() and assign, or
take postrust_engine::jwt_config for the one an AppConfig describes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.keys: Option<JwtKeys>The keys tokens are verified with, parsed from PGRST_JWT_SECRET by
JwtKeys::from_config when the configuration is read. None when
no secret is configured, and every token is then refused with
JwtError::SecretMissing.
audience: Option<String>Required audience claim
issuer: Option<String>The issuer a token’s iss must name (PGRST_JWT_ISS). When set, a
token with no iss is refused too.
role_claim_key: StringClaim key containing the role
anon_role: Option<String>Default role for anonymous requests
jwks: Option<Jwks>Where keys are fetched from and kept current, when
PGRST_JWT_JWKS_URL is set. Set it with JwtConfig::with_jwks,
which points keys at the same set; a host then awaits
ensure_keys before verifying.