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,
capid: String,
vendor: String,
rev: Option<i32>,
ver: Option<String>,
hashes: HashMap<String, String>
) -> Claims<CapabilityProvider>
pub fn new( name: String, issuer: String, subject: String, capid: 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,
capid: 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, capid: 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<Actor>
impl Claims<Actor>
sourcepub fn new(
name: String,
issuer: String,
subject: String,
caps: Option<Vec<String>>,
tags: Option<Vec<String>>,
provider: bool,
rev: Option<i32>,
ver: Option<String>,
call_alias: Option<String>
) -> Claims<Actor>
pub fn new( name: String, issuer: String, subject: String, caps: Option<Vec<String>>, tags: Option<Vec<String>>, provider: bool, rev: Option<i32>, ver: Option<String>, call_alias: Option<String> ) -> Claims<Actor>
Creates a new non-expiring Claims wrapper for metadata representing an actor
sourcepub fn with_dates(
name: String,
issuer: String,
subject: String,
caps: Option<Vec<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<Actor>
pub fn with_dates( name: String, issuer: String, subject: String, caps: Option<Vec<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<Actor>
Creates a new Claims wrapper for metadata representing an actor, with optional valid before and expiration dates