pub struct JwtConfig {
pub issuer: Option<String>,
pub audience: Option<String>,
pub jwks_url: Option<String>,
pub secret: Option<String>,
pub rsa_public_key: Option<String>,
pub principal_claim: String,
pub roles_claim: String,
}Expand description
JWT/OIDC Configuration
Fields§
§issuer: Option<String>Expected token issuer (iss claim)
audience: Option<String>Expected audience (aud claim)
jwks_url: Option<String>JWKS URL for key discovery (not implemented yet - uses secret)
secret: Option<String>Secret key for HS256 validation (for testing/simple setups)
rsa_public_key: Option<String>RSA public key in PEM format for RS256 validation
principal_claim: StringClaim to use as principal name (default: “sub”)
roles_claim: StringClaim to use for roles/groups (default: “groups”)
Implementations§
Source§impl JwtConfig
impl JwtConfig
Sourcepub fn with_issuer(issuer: impl Into<String>) -> Self
pub fn with_issuer(issuer: impl Into<String>) -> Self
Create config with issuer validation
Sourcepub fn with_audience(self, audience: impl Into<String>) -> Self
pub fn with_audience(self, audience: impl Into<String>) -> Self
Set expected audience
Sourcepub fn with_secret(self, secret: impl Into<String>) -> Self
pub fn with_secret(self, secret: impl Into<String>) -> Self
Set HS256 secret for validation
Sourcepub fn with_rsa_public_key(self, key: impl Into<String>) -> Self
pub fn with_rsa_public_key(self, key: impl Into<String>) -> Self
Set RSA public key for RS256 validation
Trait Implementations§
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