pub enum JwtError {
Show 15 variants
ExpiredToken {
exp: Option<u64>,
current_time: Option<u64>,
},
TokenNotYetValid {
nbf: Option<u64>,
current_time: Option<u64>,
},
InvalidSignature,
InvalidClaim {
claim: String,
reason: String,
value: Option<String>,
},
InvalidIssuer {
expected: String,
actual: String,
},
InvalidClientId {
expected: Vec<String>,
actual: String,
},
InvalidTokenUse {
expected: String,
actual: String,
},
KeyNotFound(String),
JwksFetchError {
url: Option<String>,
error: String,
},
ParseError {
part: Option<String>,
error: String,
},
ConfigurationError {
parameter: Option<String>,
error: String,
},
MissingToken,
UnsupportedTokenType {
token_type: String,
},
InvalidToken(String),
UnexpectedError(String),
}Expand description
Detailed error types for JWT verification failures
Variants§
ExpiredToken
Token has expired
Fields
TokenNotYetValid
Token is not yet valid (nbf claim)
Fields
InvalidSignature
Token signature is invalid
InvalidClaim
A specific claim is invalid
Fields
InvalidIssuer
Token issuer is invalid
InvalidClientId
Token client ID is invalid
Fields
InvalidTokenUse
Token use is invalid
KeyNotFound(String)
JWK key not found
JwksFetchError
Error fetching JWKs
ParseError
Error parsing token
Fields
ConfigurationError
Configuration error
Fields
MissingToken
Missing token
UnsupportedTokenType
Unsupported token type
InvalidToken(String)
Generic token error
UnexpectedError(String)
Unexpected error
Trait Implementations§
Source§impl Error for JwtError
impl Error for JwtError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<DecodeError> for JwtError
impl From<DecodeError> for JwtError
Source§fn from(err: DecodeError) -> Self
fn from(err: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for JwtError
impl From<Error> for JwtError
Source§fn from(err: AnyhowError) -> Self
fn from(err: AnyhowError) -> Self
Converts to this type from the input type.
Source§impl From<JwtError> for PublicJwtError
impl From<JwtError> for PublicJwtError
Source§impl From<JwtError> for RegistryError
impl From<JwtError> for RegistryError
Source§impl JwtErrorResponse for JwtError
impl JwtErrorResponse for JwtError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Convert the error to an HTTP response with appropriate status code
Auto Trait Implementations§
impl Freeze for JwtError
impl RefUnwindSafe for JwtError
impl Send for JwtError
impl Sync for JwtError
impl Unpin for JwtError
impl UnwindSafe for JwtError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.