pub enum DpopError {
Show 19 variants
MoreThanOneProof,
Malformed,
InvalidEncoding(&'static str),
MissingClaim(&'static str),
JtiTooLong {
length: usize,
},
WrongTyp(Option<String>),
UnsupportedAlgorithm(String),
UnsupportedKey,
BadSignature,
MethodMismatch {
proof: String,
expected: String,
},
UriMismatch {
proof: String,
expected: String,
},
ClockSkew {
iat: OffsetDateTime,
now: OffsetDateTime,
window: Duration,
},
PredatesStart {
iat: OffsetDateTime,
started: OffsetDateTime,
},
Replayed {
jti: String,
},
ReplayWindowFull,
ThumbprintMismatch,
AccessTokenHashMismatch,
NonceRequired {
fresh: String,
},
NonceMismatch {
fresh: String,
},
}Expand description
Why a presented DPoP proof, or the binding it claims, was refused.
Each variant names the one check that failed rather than folding every
failure into a single “invalid proof” – in particular
DpopError::ClockSkew carries both timestamps and the window, so a
refusal caused by clock drift between two honest clocks reads as exactly
that rather than as a forged signature.
Variants§
MoreThanOneProof
The request carried more than one DPoP header.
Malformed
Not three .-separated segments.
InvalidEncoding(&'static str)
A segment was not valid, unpadded base64url, or the JSON it decoded
to did not have the shape this module reads. The &'static str names
which segment.
MissingClaim(&'static str)
A required claim (jti, htm, htu, or iat) was absent.
JtiTooLong
The jti is longer than MAX_JTI_BYTES, so the replay window
will not keep it.
WrongTyp(Option<String>)
typ was missing, or present and not "dpop+jwt".
UnsupportedAlgorithm(String)
alg was not "ES256".
UnsupportedKey
The embedded jwk did not name an EC P-256 key with well-formed x
and y members, or did not decode to a point on the curve.
BadSignature
The signature did not verify over header.payload.
MethodMismatch
htm did not match the request’s method.
UriMismatch
htu did not match the request’s target, once both are normalized
(query and fragment dropped, scheme and host lowercased).
Fields
ClockSkew
iat fell outside the accepted clock-skew window.
Fields
iat: OffsetDateTimeThe proof’s own iat, as an absolute time.
now: OffsetDateTimeThis verifier’s own clock at the moment it checked.
window: DurationThe window on either side of now that would have been accepted.
PredatesStart
The proof was stamped before this verifier began accepting proofs,
and it is still inside the first clock-skew window since. Its own
refusal rather than DpopError::ClockSkew, because the clocks
agree: the proof is simply older than the replay window can speak
for.
Fields
iat: OffsetDateTimeThe proof’s own iat, as an absolute time.
started: OffsetDateTimeWhen this verifier began accepting proofs.
Replayed
This jti was already accepted once, inside the window during which
it is still considered fresh.
ReplayWindowFull
The replay window is holding as many jtis as it will, so this
verifier cannot promise this one has not been seen. Refused rather
than admitted: a replay cache that forgets to make room is a replay
cache that lets one through. See REPLAY_CAPACITY.
ThumbprintMismatch
A binding was requested (expected_thumbprint in
DpopVerifier::verify) and the proof’s key does not have it.
AccessTokenHashMismatch
An access token was supplied to check against and the proof’s ath
does not hash to it – either absent or wrong.
NonceRequired
This verifier requires a nonce and the proof carried none. The client resolves this by retrying with the carried nonce, which is now the only nonce this verifier accepts.
NonceMismatch
A nonce was presented and it is not one this verifier currently
accepts. Same resolution as DpopError::NonceRequired.
Implementations§
Trait Implementations§
Source§impl Error for DpopError
impl Error for DpopError
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 Eq for DpopError
impl StructuralPartialEq for DpopError
Auto Trait Implementations§
impl Freeze for DpopError
impl RefUnwindSafe for DpopError
impl Send for DpopError
impl Sync for DpopError
impl Unpin for DpopError
impl UnsafeUnpin for DpopError
impl UnwindSafe for DpopError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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