pub enum AuthError {
}Expand description
Auth-specific failures the canonical handlers can raise.
Each backend’s Error associated type must implement
From<AuthError> so the handler can return these variants and
the route layer surfaces them via its existing IntoResponse
plumbing (e.g. vti-common’s AppError::Unauthorized(_) arm).
Variants§
Forbidden
DID is not in the backend’s ACL, or the ACL entry is expired. Returned as 403 Forbidden to avoid revealing whether the DID exists in the ACL system at all (timing-side-channel mitigation; the ACL check happens before any other gate).
DidMethodRejected
The DID’s method (e.g. did:foo:...) is not in the backend’s
allowlist. Distinct from Forbidden so audit logs can
distinguish “wrong method” from “not in ACL”. Surfaced to
callers as a generic 403 to avoid leaking the allowlist
contents.
PendingChallengeLimitReached
Too many concurrent ChallengeSent sessions for this DID;
the per-DID rate limit (default 10) is exhausted. Returned
as 429 Too Many Requests so clients can back off.
SessionNotFound
The session referenced by the request does not exist or has expired (TTL swept it). Returned as 401 Unauthorized; the holder must restart the challenge flow.
SessionStateMismatch
The session exists but was already authenticated (replay) or is otherwise not in the state the request expected. Returned as 401 Unauthorized; the holder must restart.
ChallengeMismatch
The presented challenge does not match what was issued for this session. Constant-time compared. Returned as 401 Unauthorized.
ChallengeExpired
The challenge is older than the backend’s configured TTL. Returned as 401 Unauthorized; the holder must request a fresh challenge.
SignerMismatch
The signer DID extracted from the transport (DIDComm from,
SIOPv2 iss) does not match the DID the session was issued
to. Critical binding — without this check, any leaked
challenge could be redeemed by any signer. Returned as 401
Unauthorized.
StaleMessage
The DIDComm envelope’s created_time is outside the freshness
window. Replay defense for the DIDComm transport. Returned as
401 Unauthorized.
RefreshTokenInvalid
The refresh token was not found or already consumed. Atomic claim semantics: at most one caller succeeds per token. Returned as 401 Unauthorized; the holder must re-authenticate.
RefreshTokenExpired
The refresh token’s absolute expiry has passed. Returned as 401 Unauthorized; the holder must re-authenticate.
AttestationFailed(String)
TEE attestation failed in a TeeMode::Required deployment.
Returned as 503 Service Unavailable (the operator’s TEE is
broken; the caller did nothing wrong).
Internal(String)
Surface for any wrapped error from the backend’s policy or
storage layer that doesn’t fit the variants above. The
canonical handler does not introspect this; it surfaces
unchanged via the backend’s Error::from(AuthError::Internal).
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AuthError> for AppError
Convert the canonical auth-flow errors into AppError so
the route layer’s existing IntoResponse plumbing renders
them without backend-specific glue. Each variant lands on the
HTTP status reflected in the crate::auth::AuthError
doc-comments:
impl From<AuthError> for AppError
Convert the canonical auth-flow errors into AppError so
the route layer’s existing IntoResponse plumbing renders
them without backend-specific glue. Each variant lands on the
HTTP status reflected in the crate::auth::AuthError
doc-comments:
Forbidden,DidMethodRejected→ 403PendingChallengeLimitReached→ 429 via the Validation arm (route layer can return a typed 429 if needed; the canonical variant carries the rate-limit signal in the message).SessionNotFound,SessionStateMismatch,ChallengeMismatch,ChallengeExpired,SignerMismatch,StaleMessage,RefreshTokenInvalid,RefreshTokenExpired→ 401AttestationFailed→ 503 via Internal (TEE outages are not the caller’s fault).Internal→ 500.
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.