pub struct RoleJwt {
pub issuer: String,
pub subject: String,
pub name: String,
pub issued_at: u64,
pub expires: Option<u64>,
pub kind: RoleKind,
}Expand description
A minimal NATS JWT for a role whose current broker RPC carries only issuer,
subject, name, and expiry (server, curve, account-signer). The nats
claim block is just {type, version}.
Fields§
§issuer: StringIssuer = the public NKey of the signing key.
subject: StringSubject = the public NKey the credential is for.
name: StringHuman-readable 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.
kind: RoleKindThe role this token is for, setting its nats.type claim.
Implementations§
Source§impl RoleJwt
impl RoleJwt
Sourcepub fn signing_input(&self) -> Result<String, Error>
pub fn signing_input(&self) -> Result<String, Error>
Produce the JWS signing input (base64url(header).base64url(claims)).
§Errors
Error::Json if claim serialization fails.
Auto Trait Implementations§
impl Freeze for RoleJwt
impl RefUnwindSafe for RoleJwt
impl Send for RoleJwt
impl Sync for RoleJwt
impl Unpin for RoleJwt
impl UnsafeUnpin for RoleJwt
impl UnwindSafe for RoleJwt
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