pub struct UmaService { /* private fields */ }Expand description
Thread-safe UMA service
Implementations§
Source§impl UmaService
impl UmaService
pub fn new(config: UmaConfig) -> Self
Sourcepub async fn register_resource_set(
&self,
resource_set: UmaResourceSet,
) -> Result<String>
pub async fn register_resource_set( &self, resource_set: UmaResourceSet, ) -> Result<String>
Registers a resource set as part of the Resource Registration API (UMA §3.1).
Sourcepub async fn create_permission_ticket(
&self,
resource_id: &str,
requested_scopes: Vec<String>,
) -> Result<String>
pub async fn create_permission_ticket( &self, resource_id: &str, requested_scopes: Vec<String>, ) -> Result<String>
Create a permission ticket when a resource server encounters an unauthorized request (UMA §3.2).
Sourcepub async fn request_rpt(
&self,
ticket: &str,
claims: Option<HashMap<String, String>>,
) -> Result<String>
pub async fn request_rpt( &self, ticket: &str, claims: Option<HashMap<String, String>>, ) -> Result<String>
Request an RPT (Requesting Party Token) by presenting a permission ticket and claims (UMA §3.3).
Sourcepub async fn list_resource_sets(
&self,
owner_id: &str,
) -> Result<Vec<UmaResourceSet>>
pub async fn list_resource_sets( &self, owner_id: &str, ) -> Result<Vec<UmaResourceSet>>
List registered resource sets for an owner
Sourcepub async fn delete_resource_set(
&self,
resource_id: &str,
owner_id: &str,
) -> Result<()>
pub async fn delete_resource_set( &self, resource_id: &str, owner_id: &str, ) -> Result<()>
Delete a resource set
Sourcepub async fn cleanup_expired_tickets(&self)
pub async fn cleanup_expired_tickets(&self)
Remove expired permission tickets from the in-memory store.
Sourcepub fn discovery_metadata(&self, issuer: &str) -> UmaDiscoveryMetadata
pub fn discovery_metadata(&self, issuer: &str) -> UmaDiscoveryMetadata
Get the UMA discovery metadata for this service.
Sourcepub async fn ticket_count(&self) -> usize
pub async fn ticket_count(&self) -> usize
Count of active permission tickets.
Sourcepub async fn resource_count(&self) -> usize
pub async fn resource_count(&self) -> usize
Count of registered resource sets.
Sourcepub async fn get_resource_set(
&self,
resource_id: &str,
) -> Option<UmaResourceSet>
pub async fn get_resource_set( &self, resource_id: &str, ) -> Option<UmaResourceSet>
Get a resource set by ID.
Auto Trait Implementations§
impl Freeze for UmaService
impl !RefUnwindSafe for UmaService
impl Send for UmaService
impl Sync for UmaService
impl Unpin for UmaService
impl UnsafeUnpin for UmaService
impl !UnwindSafe for UmaService
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
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