#[non_exhaustive]pub enum AuthError {
InvalidCredentials,
TokenExpired,
InvalidToken {
reason: String,
},
ProviderError {
provider: String,
message: String,
},
InvalidState,
UserDenied,
SessionNotFound,
SessionExpired,
InsufficientPermissions {
required: String,
},
RefreshTokenInvalid,
AccountLocked {
reason: String,
},
}Expand description
Domain-level auth errors for HTTP response mapping.
These are the client-facing auth error variants that get converted
to HTTP status codes via RuntimeError. For internal OIDC/JWT processing
errors, see fraiseql_auth::AuthError. For wire-protocol SCRAM errors,
see fraiseql_wire::auth::AuthError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidCredentials
The supplied username/password (or API key) did not match any account.
TokenExpired
The access token has passed its expiry time and must be refreshed.
InvalidToken
The access token is structurally invalid or has been tampered with.
ProviderError
An upstream OAuth / OIDC provider returned an error during the flow.
Fields
InvalidState
The OAuth state parameter did not match the stored value, indicating a
possible CSRF attack or a stale/replayed authorisation request.
UserDenied
The resource owner explicitly declined the authorisation request at the provider’s consent screen.
SessionNotFound
No active session exists for the supplied session identifier.
SessionExpired
The session existed but has expired and can no longer be used.
InsufficientPermissions
The authenticated principal does not have the scopes or roles required to perform the requested operation.
RefreshTokenInvalid
The refresh token has been revoked, used more than once, or has expired.
AccountLocked
The account has been administratively locked and cannot be used.
Implementations§
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()
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> 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> 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