pub struct OAuthClient { /* private fields */ }Expand description
OAuth client for token introspection
Implementations§
Source§impl OAuthClient
impl OAuthClient
Sourcepub fn new(config: OAuthConfig) -> Self
pub fn new(config: OAuthConfig) -> Self
Create a new OAuth client
Sourcepub async fn introspect(
&self,
token: &str,
) -> Result<IntrospectionResponse, OAuthError>
pub async fn introspect( &self, token: &str, ) -> Result<IntrospectionResponse, OAuthError>
Introspect a token
Sourcepub async fn validate_to_identity(
&self,
token: &str,
) -> Result<Identity, OAuthError>
pub async fn validate_to_identity( &self, token: &str, ) -> Result<Identity, OAuthError>
Validate a token and return identity
Sourcepub fn invalidate_token(&self, token: &str)
pub fn invalidate_token(&self, token: &str)
Invalidate a cached token
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the token cache
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Get cache statistics
Sourcepub fn introspection_url(&self) -> &str
pub fn introspection_url(&self) -> &str
Get introspection URL
Auto Trait Implementations§
impl Freeze for OAuthClient
impl !RefUnwindSafe for OAuthClient
impl Send for OAuthClient
impl Sync for OAuthClient
impl Unpin for OAuthClient
impl UnsafeUnpin for OAuthClient
impl !UnwindSafe for OAuthClient
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