pub enum AuthError {
InvalidToken,
InvalidSignature,
MissingRequiredClaim(String),
ExpiredSignature,
InvalidIssuer,
InvalidAudience,
InvalidSubject,
ImmatureSignature,
InvalidAlgorithm,
MissingAlgorithm,
MissingToken,
InternalError,
}
Expand description
An enum representing the possible errors that can occur when authenticating a request.
These are sourced from the jsonwebtoken
crate and defined here to implement IntoResponse
for
use in the axum
framework.
Variants§
InvalidToken
When the token is invalid
InvalidSignature
When the signature is invalid
MissingRequiredClaim(String)
When a claim required by the validation is not present
ExpiredSignature
When a token’s exp
claim indicates that it has expired
InvalidIssuer
When a token’s iss
claim does not match the expected issuer
InvalidAudience
When a token’s aud
claim does not match one of the expected audience values
InvalidSubject
When a token’s sub
claim does not match one of the expected subject values
ImmatureSignature
When a token’s nbf
claim represents a time in the future
InvalidAlgorithm
When the algorithm in the header doesn’t match the one passed to decode
or the encoding/decoding key
used doesn’t match the alg requested
MissingAlgorithm
When the Validation struct does not contain at least 1 algorithm
MissingToken
When the request is missing a token
InternalError
When an internal error occurs that doesn’t fit into the other categories. This is a catch-all error for any unexpected errors that occur such as network errors, decoding errors, and cryptographic errors.
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl IntoResponse for AuthError
impl IntoResponse for AuthError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
impl StructuralPartialEq for AuthError
Auto Trait Implementations§
impl Freeze for AuthError
impl RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnwindSafe for AuthError
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
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.