pub struct Claims<T> {
pub expires: Option<u64>,
pub id: String,
pub issued_at: u64,
pub issuer: String,
pub subject: String,
pub not_before: Option<u64>,
pub metadata: Option<T>,
/* private fields */
}
Expand description
Represents a set of RFC 7519 compliant JSON Web Token claims.
Fields§
§expires: Option<u64>
All timestamps in JWTs are stored in seconds since the epoch format
as described as NumericDate
in the RFC. Corresponds to the exp
field in a JWT.
id: String
Corresponds to the jti
field in a JWT.
issued_at: u64
The iat
field, stored in seconds since the epoch
issuer: String
Issuer of the token, by convention usually the public key of the account that signed the token
subject: String
Subject of the token, usually the public key of the module corresponding to the WebAssembly file being signed
not_before: Option<u64>
The nbf
JWT field, indicates the time when the token becomes valid. If None
token is valid immediately
metadata: Option<T>
Custom jwt claims in the wascap
namespace
Implementations§
Source§impl Claims<Account>
impl Claims<Account>
Source§impl Claims<CapabilityProvider>
impl Claims<CapabilityProvider>
Sourcepub fn new(
name: String,
issuer: String,
subject: String,
vendor: String,
rev: Option<i32>,
ver: Option<String>,
hashes: HashMap<String, String>,
) -> Claims<CapabilityProvider>
pub fn new( name: String, issuer: String, subject: String, vendor: String, rev: Option<i32>, ver: Option<String>, hashes: HashMap<String, String>, ) -> Claims<CapabilityProvider>
Creates a new non-expiring Claims wrapper for metadata representing a capability provider
Sourcepub fn with_provider(
issuer: String,
subject: String,
not_before: Option<u64>,
expires: Option<u64>,
provider: CapabilityProvider,
) -> Claims<CapabilityProvider>
pub fn with_provider( issuer: String, subject: String, not_before: Option<u64>, expires: Option<u64>, provider: CapabilityProvider, ) -> Claims<CapabilityProvider>
Creates a new Claims non-expiring wrapper for metadata representing a capability provider, with optional valid before and expiration dates
Sourcepub fn with_dates(
name: String,
issuer: String,
subject: String,
vendor: String,
rev: Option<i32>,
ver: Option<String>,
hashes: HashMap<String, String>,
not_before: Option<u64>,
expires: Option<u64>,
) -> Claims<CapabilityProvider>
pub fn with_dates( name: String, issuer: String, subject: String, vendor: String, rev: Option<i32>, ver: Option<String>, hashes: HashMap<String, String>, not_before: Option<u64>, expires: Option<u64>, ) -> Claims<CapabilityProvider>
Creates a new Claims wrapper for metadata representing a capability provider, with optional valid before and expiration dates
Source§impl Claims<Operator>
impl Claims<Operator>
Source§impl Claims<Cluster>
impl Claims<Cluster>
Source§impl Claims<Component>
impl Claims<Component>
Sourcepub fn new(
name: String,
issuer: String,
subject: String,
tags: Option<Vec<String>>,
provider: bool,
rev: Option<i32>,
ver: Option<String>,
call_alias: Option<String>,
) -> Self
pub fn new( name: String, issuer: String, subject: String, tags: Option<Vec<String>>, provider: bool, rev: Option<i32>, ver: Option<String>, call_alias: Option<String>, ) -> Self
Creates a new non-expiring Claims wrapper for metadata representing an component
Sourcepub fn with_dates(
name: String,
issuer: String,
subject: String,
tags: Option<Vec<String>>,
not_before: Option<u64>,
expires: Option<u64>,
provider: bool,
rev: Option<i32>,
ver: Option<String>,
call_alias: Option<String>,
) -> Claims<Component>
pub fn with_dates( name: String, issuer: String, subject: String, tags: Option<Vec<String>>, not_before: Option<u64>, expires: Option<u64>, provider: bool, rev: Option<i32>, ver: Option<String>, call_alias: Option<String>, ) -> Claims<Component>
Creates a new Claims wrapper for metadata representing an component, with optional valid before and expiration dates
Source§impl Claims<Invocation>
impl Claims<Invocation>
Source§impl Claims<Host>
impl Claims<Host>
Sourcepub fn new(
name: String,
issuer: String,
subject: String,
tags: Option<HashMap<String, String>>,
) -> Self
pub fn new( name: String, issuer: String, subject: String, tags: Option<HashMap<String, String>>, ) -> Self
Creates a new non-expiring Claims wrapper for metadata representing a host