pub enum JwtError {
JwtSecretHexDecodeError(FromHexError),
InvalidLength(usize, usize),
UnsupportedSignatureAlgorithm,
InvalidSignature,
InvalidIssuanceTimestamp,
MissingOrInvalidAuthorizationHeader,
JwtDecodingError(String),
CreateDir {
source: Error,
path: PathBuf,
},
Read {
source: Error,
path: PathBuf,
},
Write {
source: Error,
path: PathBuf,
},
}
Available on crate feature
jwt
only.Expand description
Errors returned by the JwtSecret
Variants§
JwtSecretHexDecodeError(FromHexError)
An error encountered while decoding the hexadecimal string for the JWT secret.
InvalidLength(usize, usize)
The JWT key length provided is invalid, expecting a specific length.
UnsupportedSignatureAlgorithm
The signature algorithm used in the JWT is not supported. Only HS256 is supported.
InvalidSignature
The provided signature in the JWT is invalid.
InvalidIssuanceTimestamp
The “iat” (issued-at) claim in the JWT is not within the allowed ±60 seconds from the current time.
MissingOrInvalidAuthorizationHeader
The Authorization header is missing or invalid in the context of JWT validation.
JwtDecodingError(String)
An error occurred during JWT decoding.
CreateDir
Available on crate feature
std
only.An error occurred while creating a directory to store the JWT.
Read
Available on crate feature
std
only.An error occurred while reading the JWT from a file.
Write
Available on crate feature
std
only.An error occurred while writing the JWT to a file.
Trait Implementations§
Source§impl Error for JwtError
Available on crate feature std
only.
impl Error for JwtError
Available on crate feature
std
only.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<FromHexError> for JwtError
impl From<FromHexError> for JwtError
Source§fn from(err: FromHexError) -> Self
fn from(err: FromHexError) -> Self
Converts to this type from the input type.
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more