pub trait JwtDecoder<T>: Send + Syncwhere
T: for<'de> DeserializeOwned,{
// Required method
fn decode<'a>(
&'a self,
token: &'a str,
) -> Pin<Box<dyn Future<Output = Result<TokenData<T>, Error>> + Send + 'a>>;
}Expand description
Trait for decoding and validating JWT tokens.
Implemented by LocalDecoder and RemoteJwksDecoder to provide
a unified interface for JWT validation with different key sources.
Required Methods§
Sourcefn decode<'a>(
&'a self,
token: &'a str,
) -> Pin<Box<dyn Future<Output = Result<TokenData<T>, Error>> + Send + 'a>>
fn decode<'a>( &'a self, token: &'a str, ) -> Pin<Box<dyn Future<Output = Result<TokenData<T>, Error>> + Send + 'a>>
Decodes and validates a JWT token string, returning the parsed claims.
§Errors
Returns an error if the token is invalid, expired, has an invalid signature, or if the key cannot be found (for remote decoders).