Skip to main content

RefreshTokenService

Struct RefreshTokenService 

Source
pub struct RefreshTokenService<S: ?Sized> { /* private fields */ }
Expand description

Refresh workflow combining strict JWT checks, a shared instance coordinator, and product CAS. The coordinator can be reused while products rebuild signers for dynamic lifetime configuration.

Implementations§

Source§

impl<S: RefreshSessionStore + ?Sized> RefreshTokenService<S>

Source

pub fn new( signer: JwtSigner, verifier: JwtVerifier, store: Arc<S>, clock: Arc<dyn Clock>, policy: RefreshPolicy, coordinator: RefreshCoordinator, ) -> Self

Creates a workflow using the product-owned, cloneable coordinator resource.

Source

pub async fn refresh( &self, token: &str, client: ClientContext, ) -> Result<RefreshOutcome, RefreshError<S::Error>>

Rotates or rejects a refresh credential. Dropping the future releases coordination resources.

§Errors

Returns classified mechanism failures or the original store error; a failed commit never returns credentials. If the response is lost after commit, retrying cannot mint another pair.

Source

pub async fn refresh_with_cancellation( &self, token: &str, client: ClientContext, cancel: &CancellationToken, ) -> Result<RefreshOutcome, RefreshError<S::Error>>

Refreshes with cancellation while queued or before entering persistence. Once a store transaction starts, it is allowed to finish, preserving explicit commit semantics rather than returning cancellation with an unknown mutation outcome. Shutdown rejects new/queued work; products drain already-started transactions before closing the writer database.

§Errors

Returns cancellation/resource/auth failures or the original store/commit error.

Trait Implementations§

Source§

impl<S: ?Sized> Debug for RefreshTokenService<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for RefreshTokenService<S>
where S: ?Sized,

§

impl<S> !RefUnwindSafe for RefreshTokenService<S>

§

impl<S> Send for RefreshTokenService<S>
where S: Sync + Send + ?Sized,

§

impl<S> Sync for RefreshTokenService<S>
where S: Sync + Send + ?Sized,

§

impl<S> Unpin for RefreshTokenService<S>
where S: ?Sized,

§

impl<S> UnsafeUnpin for RefreshTokenService<S>
where S: ?Sized,

§

impl<S> !UnwindSafe for RefreshTokenService<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.