pub struct OAuth2Mapper { /* private fields */ }Expand description
OAuth2 to ReBAC mapper
Implementations§
Source§impl OAuth2Mapper
impl OAuth2Mapper
Sourcepub fn add_role_mapping(&mut self, mapping: RoleMapping)
pub fn add_role_mapping(&mut self, mapping: RoleMapping)
Add a role mapping
Sourcepub fn claims_to_tuples(
&self,
claims: &TokenClaims,
scope_mappings: &[ScopeMapping],
) -> Result<Vec<RelationTuple>, String>
pub fn claims_to_tuples( &self, claims: &TokenClaims, scope_mappings: &[ScopeMapping], ) -> Result<Vec<RelationTuple>, String>
Convert token claims to ReBAC tuples based on scope mappings
Sourcepub fn extract_org_membership(
&self,
claims: &TokenClaims,
) -> Option<RelationTuple>
pub fn extract_org_membership( &self, claims: &TokenClaims, ) -> Option<RelationTuple>
Extract organization membership from claims
Sourcepub fn jwt_to_tuples(
&self,
jwt_payload: &str,
scope_mappings: &[ScopeMapping],
) -> Result<Vec<RelationTuple>, String>
pub fn jwt_to_tuples( &self, jwt_payload: &str, scope_mappings: &[ScopeMapping], ) -> Result<Vec<RelationTuple>, String>
Generate tuples from JWT claims (convenience method)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OAuth2Mapper
impl RefUnwindSafe for OAuth2Mapper
impl Send for OAuth2Mapper
impl Sync for OAuth2Mapper
impl Unpin for OAuth2Mapper
impl UnwindSafe for OAuth2Mapper
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> 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