pub struct UserJwt {
pub issuer: String,
pub issuer_account: Option<String>,
pub subject_user: String,
pub name: String,
pub issued_at: u64,
pub expires: Option<u64>,
pub permissions: UserPermissions,
}Expand description
A NATS user JWT to be signed by its issuing account key.
Fields§
§issuer: StringIssuer (iss) = the public NKey (A…) of the key that signs the token:
either the account identity key or an account signing key.
issuer_account: Option<String>nats.issuer_account = the owning account’s identity public NKey (A…).
Set this when issuer is an account signing key, so
nats-server can bind the user to its account; leave None when issuer
is the account identity key itself.
subject_user: StringSubject = the user public NKey (U…) the credential is for.
name: StringHuman-readable user name (the name claim).
issued_at: u64Issued-at time (iat), Unix seconds.
expires: Option<u64>Optional expiry (exp), Unix seconds; None mints a non-expiring token.
permissions: UserPermissionsPublish/subscribe permissions embedded in the user claims.
Implementations§
Auto Trait Implementations§
impl Freeze for UserJwt
impl RefUnwindSafe for UserJwt
impl Send for UserJwt
impl Sync for UserJwt
impl Unpin for UserJwt
impl UnsafeUnpin for UserJwt
impl UnwindSafe for UserJwt
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