pub struct ClientAssertionVerifier {
started: OffsetDateTime,
spent: Mutex<SpentKeys>,
}Expand description
Checks client assertions, and holds the jti of each one it accepts until
the assertion could no longer be accepted anyway.
Fields§
§started: OffsetDateTimeWhen this verifier began accepting assertions, to the whole second.
For the first window after it, an assertion stamped earlier is
refused (ClientAuthError::PredatesStart).
spent: Mutex<SpentKeys>The jtis spent inside the window, bounded at REPLAY_CAPACITY.
Implementations§
Source§impl ClientAssertionVerifier
impl ClientAssertionVerifier
Sourcefn started_at(started: OffsetDateTime) -> Self
fn started_at(started: OffsetDateTime) -> Self
ClientAssertionVerifier::new, started at started rather than
now, so a test can stamp an assertion on either side of it.
Sourcepub fn authenticate(
&self,
document: &ClientMetadataDocument,
credentials: &ClientCredentials,
issuer: &str,
) -> Result<Option<ClientAuthKey>, ClientAuthError>
pub fn authenticate( &self, document: &ClientMetadataDocument, credentials: &ClientCredentials, issuer: &str, ) -> Result<Option<ClientAuthKey>, ClientAuthError>
How the client document describes authenticated this request: the
key a login it begins is bound to, or None for a public client.
issuer is this server’s own, which an assertion’s aud must name.
An assertion that checks out is spent here, so the same one presented
again is ClientAuthError::Replayed.
fn authenticate_at( &self, document: &ClientMetadataDocument, credentials: &ClientCredentials, issuer: &str, now: OffsetDateTime, ) -> Result<Option<ClientAuthKey>, ClientAuthError>
Sourcefn verify(
&self,
document: &ClientMetadataDocument,
assertion: &str,
issuer: &str,
now: OffsetDateTime,
) -> Result<ClientAuthKey, ClientAuthError>
fn verify( &self, document: &ClientMetadataDocument, assertion: &str, issuer: &str, now: OffsetDateTime, ) -> Result<ClientAuthKey, ClientAuthError>
Checks assertion against document’s keys: the signature first, so
no claim is read before it verifies, then the claims RFC 7523 §3
requires, then the jti.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ClientAssertionVerifier
impl RefUnwindSafe for ClientAssertionVerifier
impl Send for ClientAssertionVerifier
impl Sync for ClientAssertionVerifier
impl Unpin for ClientAssertionVerifier
impl UnsafeUnpin for ClientAssertionVerifier
impl UnwindSafe for ClientAssertionVerifier
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
§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