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>
impl<'a, P: TokenProvider> CommandTokenFactory<'a, P>
Sourcepub fn new(provider: &'a P, claims: TokenClaims) -> Self
pub fn new(provider: &'a P, claims: TokenClaims) -> Self
Creates a bearer token factory.
Sourcepub fn create_v1(
&self,
command_name: Option<&str>,
subject: Option<&str>,
issued_at_ms: u64,
ttl_ms: u64,
) -> Result<String, CommandTokenError>
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub 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>
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>
impl<'a, P> RefUnwindSafe for CommandTokenFactory<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for CommandTokenFactory<'a, P>where
P: Sync,
impl<'a, P> Sync for CommandTokenFactory<'a, P>where
P: Sync,
impl<'a, P> Unpin for CommandTokenFactory<'a, P>
impl<'a, P> UnsafeUnpin for CommandTokenFactory<'a, P>
impl<'a, P> UnwindSafe for CommandTokenFactory<'a, P>where
P: RefUnwindSafe,
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