#[non_exhaustive]pub enum AuthError {
Missing,
Malformed,
Rejected(String),
}Expand description
Failure cases for authentication.
Missing and Malformed describe transport-level rejections (no
header / wrong scheme); Rejected carries an authenticator-supplied
diagnostic string that MUST stay server-side — handlers map this to
a JSON-RPC -32001 Unauthenticated envelope on the wire without
echoing the inner message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Missing
The Authorization header was not present on the request.
Malformed
The header is present but does not match the expected format (e.g. wrong scheme prefix).
Rejected(String)
The verifier rejected the credential (bad signature, expired token, revoked, etc.). The string is included for log diagnostics and never returned to the caller.
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)>
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()
Auto Trait Implementations§
impl Freeze for AuthError
impl RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more