pub struct DpopVerifier {
pub allowed_clock_skew: Duration,
/* private fields */
}Expand description
Verifies DPoP proof JWTs.
Fields§
§allowed_clock_skew: DurationImplementations§
Source§impl DpopVerifier
impl DpopVerifier
pub fn new(jti_tracker: Arc<dyn DpopReplayStore>) -> Self
Sourcepub fn new_async(replay_store: Arc<dyn AsyncDpopReplayStore>) -> Self
pub fn new_async(replay_store: Arc<dyn AsyncDpopReplayStore>) -> Self
Construct a verifier with an asynchronous replay store.
Sourcepub fn verify(
&self,
dpop_header: &str,
access_token: &str,
htm: &str,
htu: &str,
expected_jkt: &str,
) -> Result<()>
pub fn verify( &self, dpop_header: &str, access_token: &str, htm: &str, htu: &str, expected_jkt: &str, ) -> Result<()>
Verify a DPoP proof.
dpop_header: theDPoPheader value (compact JWS)access_token: the access token bound to this DPoP proof. Used only to compute theathclaim (RFC 9449 §4.2: SHA-256 base64url-no-pad).htm: HTTP method (e.g.POST)htu: HTTP URI (must match exactly, RFC 9449 §4.2 strict equality)expected_jkt: the JWK SHA-256 thumbprint (RFC 7638) of the public key the access token is bound to. Extracted from the access token’scnf.jktclaim by the caller. Required — DPoP without a known jkt cannot establish proof-of-possession.
§Errors
Returns AuthError::DpopInvalid on any structural, alg, or jkt
problem, AuthError::DpopReplay on jti reuse, or
AuthError::DpopCapacityExceeded if replay tracking is full.
Sourcepub async fn verify_async(
&self,
dpop_header: &str,
access_token: &str,
htm: &str,
htu: &str,
expected_jkt: &str,
) -> Result<()>
pub async fn verify_async( &self, dpop_header: &str, access_token: &str, htm: &str, htu: &str, expected_jkt: &str, ) -> Result<()>
Verify a DPoP proof using either sync or async replay storage.
Cryptographic validation remains synchronous; remote replay-state I/O is awaited without blocking an async runtime worker.
Trait Implementations§
Source§impl Clone for DpopVerifier
impl Clone for DpopVerifier
Source§fn clone(&self) -> DpopVerifier
fn clone(&self) -> DpopVerifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DpopVerifier
impl !RefUnwindSafe for DpopVerifier
impl Send for DpopVerifier
impl Sync for DpopVerifier
impl Unpin for DpopVerifier
impl !UnwindSafe for DpopVerifier
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
Converts
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>
Converts
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