pub struct JwtSigner { /* private fields */ }Expand description
Product-configured signer with injectable clock and ID source.
Implementations§
Source§impl JwtSigner
impl JwtSigner
Sourcepub fn new(
key: JwtKey,
policy: JwtPolicy,
clock: Arc<dyn Clock>,
ids: Arc<dyn IdSource>,
) -> Self
pub fn new( key: JwtKey, policy: JwtPolicy, clock: Arc<dyn Clock>, ids: Arc<dyn IdSource>, ) -> Self
Creates an issuer with explicit policy, clock, and ID source.
Sourcepub fn with_system_clock(key: JwtKey, policy: JwtPolicy) -> Self
pub fn with_system_clock(key: JwtKey, policy: JwtPolicy) -> Self
Creates a production issuer using system time and UUID v4.
Sourcepub fn issue(
&self,
subject: Subject,
session: SessionId,
version: SessionVersion,
restriction: Restriction,
) -> Result<AuthTokenPair>
pub fn issue( &self, subject: Subject, session: SessionId, version: SessionVersion, restriction: Restriction, ) -> Result<AuthTokenPair>
Issues a pair bound to one subject, session, generation, and restriction.
§Errors
Returns a mechanism error for invalid key size, clock, expiry overflow, ID generation,
encoding, or token size. Returns CryptoProviderNotInitialized until the product has
initialized the JWT backend at startup. Issuing alone does not create a persisted session.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JwtSigner
impl !RefUnwindSafe for JwtSigner
impl Send for JwtSigner
impl Sync for JwtSigner
impl Unpin for JwtSigner
impl UnsafeUnpin for JwtSigner
impl !UnwindSafe for JwtSigner
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