#[non_exhaustive]pub struct JwtConfig {
pub jwks_uri: Option<String>,
pub jwks_max_age_secs: u64,
pub issuer: Option<String>,
pub audience: Option<String>,
pub public_key_pem_file: Option<PathBuf>,
pub claims_headers: HashMap<String, String>,
pub roles_claim: String,
pub cache: JwtCacheConfig,
}Expand description
JWT validation config.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.jwks_uri: Option<String>JWKS URI for key discovery.
jwks_max_age_secs: u64Age in seconds after which the JWKS keys are fetched again, so a key the provider removed stops verifying tokens. At least 60, the minimum spacing of refreshes. Default: 300.
issuer: Option<String>Expected issuer.
audience: Option<String>Expected audience.
public_key_pem_file: Option<PathBuf>Path to Ed25519 public key PEM file (alternative to JWKS URI).
claims_headers: HashMap<String, String>Claims → HTTP headers mapping.
roles_claim: StringClaim holding the user’s roles (array of strings). Supports a dotted path for nested claims, e.g. “realm_access.roles”. Default: “roles”.
cache: JwtCacheConfigCache of verified tokens for the built-in verifier, so a client that sends the same token on every request pays for one signature check.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JwtConfig
impl<'de> Deserialize<'de> for JwtConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JwtConfig
impl RefUnwindSafe for JwtConfig
impl Send for JwtConfig
impl Sync for JwtConfig
impl Unpin for JwtConfig
impl UnsafeUnpin for JwtConfig
impl UnwindSafe for JwtConfig
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
Mutably borrows from an owned value. Read more
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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request