Struct drawbridge::server::OidcClaims
source · pub struct OidcClaims(/* private fields */);
Implementations§
source§impl Claims
impl Claims
pub fn subject(&self) -> &str
sourcepub fn assert_scope(
&self,
context: ScopeContext,
level: ScopeLevel
) -> Result<(), impl IntoResponse>
pub fn assert_scope( &self, context: ScopeContext, level: ScopeLevel ) -> Result<(), impl IntoResponse>
Asserts that the token has a scope that satisfies the given context and level.
sourcepub async fn assert_user<'a>(
&self,
store: &'a Store,
cx: &Context,
scope_context: ScopeContext,
scope_level: ScopeLevel
) -> Result<User<'a>, impl IntoResponse>
pub async fn assert_user<'a>( &self, store: &'a Store, cx: &Context, scope_context: ScopeContext, scope_level: ScopeLevel ) -> Result<User<'a>, impl IntoResponse>
Assert that the client is the user identified by cx
, and that the token has a scope that
satisfies the given context and level.
Trait Implementations§
source§impl<B> FromRequest<B> for Claimswhere
B: Send,
impl<B> FromRequest<B> for Claimswhere
B: Send,
§type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
source§fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Claims, <Claims as FromRequest<B>>::Rejection>> + Send + 'async_trait>>where
'life0: 'async_trait,
Claims: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Claims, <Claims as FromRequest<B>>::Rejection>> + Send + 'async_trait>>where
'life0: 'async_trait,
Claims: 'async_trait,
Perform the extraction.
Auto Trait Implementations§
impl Freeze for Claims
impl RefUnwindSafe for Claims
impl Send for Claims
impl Sync for Claims
impl Unpin for Claims
impl UnwindSafe for Claims
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