#[non_exhaustive]pub enum AuthError {
NotVerified,
Unavailable(String),
}Expand description
Why a caller could not be identified.
Two cases and they are not the same refusal: one is the caller’s problem and one is the deployment’s, so one is a 401 and the other a 503. Collapsing them would tell a user to sign in again while the auth service is down, and they would, and it would not help.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotVerified
A credential was presented and did not verify — malformed, expired, wrong audience, unknown key. One variant on purpose: each answer a caller can tell apart is a hint about how to get closer.
The verifier could not be reached or could not answer.
The message is an adapter’s, so it can carry a connection URL
with credentials in it, or an address. Display runs it through
crate::logging::scrub_text for the reason DbError does
(#135): “this never reaches a caller” is a promise about every
call site rather than about this type, and four credential leaks
in this codebase had exactly that shape. Debug keeps the raw
string, and the logging formatters scrub {:?} too.
Trait Implementations§
impl Eq for AuthError
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
use the Display impl or to_string()
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.