Skip to main content

CommandTokenFactory

Struct CommandTokenFactory 

Source
pub struct CommandTokenFactory<'a, P: TokenProvider> { /* private fields */ }
Expand description

Factory de tokens bearer do runtime.

Implementations§

Source§

impl<'a, P: TokenProvider> CommandTokenFactory<'a, P>

Source

pub fn new(provider: &'a P, claims: TokenClaims) -> Self

Creates a bearer token factory.

Source

pub fn create_v1( &self, command_name: Option<&str>, subject: Option<&str>, issued_at_ms: u64, ttl_ms: u64, ) -> Result<String, CommandTokenError>

Issues a V1 command token scoped to one command name.

Source

pub fn create_v1_scoped( &self, command_name: Option<&str>, scope: Option<&str>, subject: Option<&str>, issued_at_ms: u64, ttl_ms: u64, ) -> Result<String, CommandTokenError>

Issues a V1 command token with an explicit scope.

Source

pub fn create_v1_for_purpose( &self, purpose: &str, command_name: Option<&str>, subject: Option<&str>, issued_at_ms: u64, ttl_ms: u64, ) -> Result<String, CommandTokenError>

Issues a V1 token for an isolated purpose.

Source

pub fn create_v1_for_purpose_scoped( &self, purpose: &str, command_name: Option<&str>, scope: Option<&str>, subject: Option<&str>, issued_at_ms: u64, ttl_ms: u64, ) -> Result<String, CommandTokenError>

Issues a V1 purpose token with an explicit scope.

Source

pub fn create_v1_with_jti_and_hash( &self, purpose: &str, command_name: Option<&str>, scope: Option<&str>, subject: Option<&str>, issued_at_ms: u64, ttl_ms: u64, jti: Option<String>, request_hash: Option<String>, ) -> Result<String, CommandTokenError>

Issues a request-bound V1 token with optional replay identity.

Auto Trait Implementations§

§

impl<'a, P> Freeze for CommandTokenFactory<'a, P>
where &'a P: Freeze,

§

impl<'a, P> RefUnwindSafe for CommandTokenFactory<'a, P>

§

impl<'a, P> Send for CommandTokenFactory<'a, P>
where &'a P: Send,

§

impl<'a, P> Sync for CommandTokenFactory<'a, P>
where &'a P: Sync,

§

impl<'a, P> Unpin for CommandTokenFactory<'a, P>
where &'a P: Unpin,

§

impl<'a, P> UnsafeUnpin for CommandTokenFactory<'a, P>

§

impl<'a, P> UnwindSafe for CommandTokenFactory<'a, P>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V