pub enum SecurityError {
Show 16 variants
Config(String),
AuthenticationFailed(String),
AuthorizationFailed(String),
InvalidToken(String),
TokenExpired,
MissingAuth,
RateLimitExceeded,
InvalidApiKey,
JwtValidation(String),
Environment(VarError),
Io(Error),
Json(Error),
Random(String),
Crypto(String),
Http(String),
Internal(String),
}Expand description
Errors that can occur in the security middleware
Variants§
Config(String)
Configuration error
AuthenticationFailed(String)
Authentication failed
AuthorizationFailed(String)
Authorization failed
InvalidToken(String)
Invalid token
TokenExpired
Token expired
MissingAuth
Missing authentication
RateLimitExceeded
Rate limit exceeded
InvalidApiKey
Invalid API key
JwtValidation(String)
JWT validation error
Environment(VarError)
Environment variable error
Io(Error)
IO error
Json(Error)
JSON error
Random(String)
Random generation error
Crypto(String)
Cryptographic error
Http(String)
HTTP error
Internal(String)
Generic internal error
Implementations§
Source§impl SecurityError
impl SecurityError
Sourcepub fn invalid_token<S: Into<String>>(msg: S) -> Self
pub fn invalid_token<S: Into<String>>(msg: S) -> Self
Create an invalid token error
Trait Implementations§
Source§impl Debug for SecurityError
impl Debug for SecurityError
Source§impl Display for SecurityError
impl Display for SecurityError
Source§impl Error for SecurityError
impl Error for SecurityError
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<Error> for SecurityError
impl From<Error> for SecurityError
Source§impl From<Error> for SecurityError
impl From<Error> for SecurityError
Source§impl From<Error> for SecurityError
impl From<Error> for SecurityError
Auto Trait Implementations§
impl Freeze for SecurityError
impl !RefUnwindSafe for SecurityError
impl Send for SecurityError
impl Sync for SecurityError
impl Unpin for SecurityError
impl !UnwindSafe for SecurityError
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