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
pub fn with_dates( name: String, issuer: String, subject: String, not_before: Option<u64>, expires: Option<u64>, tags: Option<HashMap<String, String>>, ) -> Claims<Host>
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Claims<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Claims<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<T> StructuralPartialEq for Claims<T>
Auto Trait Implementations§
impl<T> Freeze for Claims<T>where
T: Freeze,
impl<T> RefUnwindSafe for Claims<T>where
T: RefUnwindSafe,
impl<T> Send for Claims<T>where
T: Send,
impl<T> Sync for Claims<T>where
T: Sync,
impl<T> Unpin for Claims<T>where
T: Unpin,
impl<T> UnwindSafe for Claims<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)