pub struct Resolver<'a, State> { /* private fields */ }
Expand description
Struct responsible for resolving JWT auth identities (cf. the rjwt
crate).
Implementations§
Trait Implementations§
Source§impl<'a, State> Resolve for Resolver<'a, State>
impl<'a, State> Resolve for Resolver<'a, State>
type HostId = Link
type ActorId = Value
type Claims = Vec<PathBuf>
Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
host: &'life1 Link,
actor_id: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Actor, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
host: &'life1 Link,
actor_id: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Actor, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Given a host and actor ID, return a corresponding
Actor
.Source§fn verify<'life0, 'async_trait>(
&'life0 self,
encoded: String,
now: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<SignedToken<Self::HostId, Self::ActorId, Self::Claims>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn verify<'life0, 'async_trait>(
&'life0 self,
encoded: String,
now: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<SignedToken<Self::HostId, Self::ActorId, Self::Claims>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Decode and verify the given
encoded
token.Auto Trait Implementations§
impl<'a, State> Freeze for Resolver<'a, State>
impl<'a, State> !RefUnwindSafe for Resolver<'a, State>
impl<'a, State> Send for Resolver<'a, State>
impl<'a, State> Sync for Resolver<'a, State>
impl<'a, State> Unpin for Resolver<'a, State>
impl<'a, State> !UnwindSafe for Resolver<'a, State>
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> 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 moreSource§impl<F> Match for F
impl<F> Match for F
Source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
Source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.Source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.Source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
Source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.Source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.Source§fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns
Ok(T)
if self
can be cast into T
, otherwise calls on_err
.