Enum JwtError
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,
},
}
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
std
only.An error occurred while creating a directory to store the JWT.
Read
std
only.An error occurred while reading the JWT from a file.
Write
std
only.An error occurred while writing the JWT to a file.
Trait Implementations§
§impl Error for JwtError
Available on crate feature std
only.
impl Error for JwtError
std
only.§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
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes
Size for each variant:
JwtSecretHexDecodeError
: 16 bytesInvalidLength
: 16 bytesUnsupportedSignatureAlgorithm
: 0 bytesInvalidSignature
: 0 bytesInvalidIssuanceTimestamp
: 0 bytesMissingOrInvalidAuthorizationHeader
: 0 bytesJwtDecodingError
: 24 bytesCreateDir
: 32 bytesRead
: 32 bytesWrite
: 32 bytes