pub struct OAuthValidator { /* private fields */ }Expand description
JWT token validator with JWKS key caching.
Thread-safe — can be shared across handlers via Arc.
Implementations§
Source§impl OAuthValidator
impl OAuthValidator
Sourcepub fn new(config: OAuthConfig, http_client: Client) -> Self
pub fn new(config: OAuthConfig, http_client: Client) -> Self
Create a new validator with the given configuration.
The http_client is reused from the proxy’s existing reqwest client.
Sourcepub async fn validate_token(
&self,
auth_header: &str,
) -> Result<OAuthClaims, OAuthError>
pub async fn validate_token( &self, auth_header: &str, ) -> Result<OAuthClaims, OAuthError>
Validate a Bearer token from the Authorization header value.
Returns the validated claims on success.
Sourcepub async fn validate_dpop_proof(
&self,
dpop_header: Option<&str>,
access_token: &str,
expected_method: &str,
expected_uri: &str,
token_claims: Option<&OAuthClaims>,
) -> Result<(), OAuthError>
pub async fn validate_dpop_proof( &self, dpop_header: Option<&str>, access_token: &str, expected_method: &str, expected_uri: &str, token_claims: Option<&OAuthClaims>, ) -> Result<(), OAuthError>
Validate a DPoP proof for an already-authenticated access token.
Sourcepub fn config(&self) -> &OAuthConfig
pub fn config(&self) -> &OAuthConfig
Get the OAuth config (for pass-through decisions).
Auto Trait Implementations§
impl !Freeze for OAuthValidator
impl !RefUnwindSafe for OAuthValidator
impl Send for OAuthValidator
impl Sync for OAuthValidator
impl Unpin for OAuthValidator
impl UnsafeUnpin for OAuthValidator
impl !UnwindSafe for OAuthValidator
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