pub struct JwtSigner { /* private fields */ }Expand description
Signs JWTs using HMAC-SHA256.
Implementations§
Source§impl JwtSigner
impl JwtSigner
Sourcepub fn sign(&self, key_id: &str, scopes: &[Scope]) -> Result<String, JwtError>
pub fn sign(&self, key_id: &str, scopes: &[Scope]) -> Result<String, JwtError>
Sign a new JWT for the given API key ID and scopes.
The token expires after 24 hours.
Sourcepub fn sign_with_tenant(
&self,
key_id: &str,
scopes: &[Scope],
team_id: Option<String>,
org_id: Option<String>,
) -> Result<String, JwtError>
pub fn sign_with_tenant( &self, key_id: &str, scopes: &[Scope], team_id: Option<String>, org_id: Option<String>, ) -> Result<String, JwtError>
Sign a JWT that additionally carries a tenant scope (AAASM-3139).
team_id / org_id confine a non-admin caller to its own tenant for
per-tenant data endpoints. Pass None for either to leave it unscoped.
The token expires after 24 hours.
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