pub struct PrivateKeyJwtManager { /* private fields */ }
Expand description
Private Key JWT Manager
Implementations§
Source§impl PrivateKeyJwtManager
impl PrivateKeyJwtManager
Sourcepub fn new(jwt_validator: SecureJwtValidator) -> Self
pub fn new(jwt_validator: SecureJwtValidator) -> Self
Create a new Private Key JWT Manager
Sourcepub async fn register_client(&self, config: ClientJwtConfig) -> Result<()>
pub async fn register_client(&self, config: ClientJwtConfig) -> Result<()>
Register a client for private key JWT authentication
Sourcepub async fn authenticate_client(
&self,
client_assertion: &str,
) -> Result<JwtAuthResult>
pub async fn authenticate_client( &self, client_assertion: &str, ) -> Result<JwtAuthResult>
Authenticate a client using private key JWT
Sourcepub fn create_client_assertion(
&self,
client_id: &str,
audience: &str,
_signing_key: &[u8],
algorithm: Algorithm,
) -> Result<String>
pub fn create_client_assertion( &self, client_id: &str, audience: &str, _signing_key: &[u8], algorithm: Algorithm, ) -> Result<String>
Create a client assertion JWT (for testing/client-side use)
Sourcepub async fn cleanup_expired_jtis(&self)
pub async fn cleanup_expired_jtis(&self)
Clean up expired JTIs
Sourcepub fn with_cleanup_interval(self, interval: Duration) -> Self
pub fn with_cleanup_interval(self, interval: Duration) -> Self
Set the cleanup interval for JTI management
Sourcepub fn get_cleanup_interval(&self) -> Duration
pub fn get_cleanup_interval(&self) -> Duration
Get the current cleanup interval
Sourcepub fn update_cleanup_interval(&mut self, interval: Duration)
pub fn update_cleanup_interval(&mut self, interval: Duration)
Update the cleanup interval
Sourcepub fn revoke_jwt_token(&self, jti: &str) -> Result<()>
pub fn revoke_jwt_token(&self, jti: &str) -> Result<()>
Revoke a JWT by its JTI using the enhanced validator
Sourcepub fn is_jwt_token_revoked(&self, jti: &str) -> Result<bool>
pub fn is_jwt_token_revoked(&self, jti: &str) -> Result<bool>
Check if a JWT is revoked using the enhanced validator
Sourcepub async fn schedule_automatic_cleanup(&self)
pub async fn schedule_automatic_cleanup(&self)
Schedule automatic cleanup of expired JTIs based on cleanup interval
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PrivateKeyJwtManager
impl !RefUnwindSafe for PrivateKeyJwtManager
impl Send for PrivateKeyJwtManager
impl Sync for PrivateKeyJwtManager
impl Unpin for PrivateKeyJwtManager
impl !UnwindSafe for PrivateKeyJwtManager
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