#[non_exhaustive]pub enum PkceError {
StateNotFound,
StateExpired,
StoreFull,
}Expand description
Errors returned by PkceStateStore::consume_state and
PkceStateStore::create_state.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StateNotFound
The state token was not found — either never issued, already consumed, or (when encryption is on) tampered/decryption failed.
Clients receive the same message for unknown and tampered tokens to avoid leaking information about the store.
StateExpired
The state token was found but its TTL has elapsed.
Distinct from PkceError::StateNotFound so that clients can show
a useful “please restart the authorization flow” message rather than
a generic invalid-state error.
StoreFull
The in-memory store has reached MAX_PKCE_ENTRIES entries.
This prevents unbounded memory growth under load or during a DoS attack. Callers should return HTTP 429 to the client and invite them to retry after a short delay.
Trait Implementations§
Source§impl Error for PkceError
impl Error for PkceError
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 PkceError
impl RefUnwindSafe for PkceError
impl Send for PkceError
impl Sync for PkceError
impl Unpin for PkceError
impl UnsafeUnpin for PkceError
impl UnwindSafe for PkceError
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