pub struct KeyFile { /* private fields */ }Expand description
A TokenVerifier of JWTs with the keys in a file, read again when the file changes.
The file holds a JWK or a JWK set, as --auth-key takes it. Before each
token the verifier compares the file’s modification time and size with
the ones it last read, as moq-auth’s reference policy does for browsers,
so a rotated or revoked key takes effect for the next session without a
restart. A file that is gone or no longer holds a key rejects every token
until it is fixed. Sessions already admitted keep their authorization.
Wrap it in a Verify to use it as a policy.
Implementations§
Trait Implementations§
Source§impl TokenVerifier<PublicKey> for KeyFile
impl TokenVerifier<PublicKey> for KeyFile
Source§fn verify(&self, token: &str, request: &PeerRequest<EndpointId>) -> Decision
fn verify(&self, token: &str, request: &PeerRequest<EndpointId>) -> Decision
Verifies
token for the request’s peer and returns what it authorizes. Read moreAuto Trait Implementations§
impl Freeze for KeyFile
impl RefUnwindSafe for KeyFile
impl Send for KeyFile
impl Sync for KeyFile
impl Unpin for KeyFile
impl UnsafeUnpin for KeyFile
impl UnwindSafe for KeyFile
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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