pub struct ChiselClaims {
pub standard: StandardClaims,
pub sid: String,
}Expand description
The claims carried by a Chisel session token: tokenkit’s standard
claims (whose role field carries the session’s role name) plus the
session id.
A session carries exactly one role — the Acrobat actor model is one identity, one job — so the vocabulary stays a flat enum, not a set.
Fields§
§standard: StandardClaimsThe standard registered claims; role holds the role name.
sid: StringThe session this token belongs to (refresh pairs share it).
Implementations§
Source§impl ChiselClaims
impl ChiselClaims
Sourcepub fn role(&self) -> Option<Role>
pub fn role(&self) -> Option<Role>
The session’s parsed role, if the name is in the current vocabulary.
Sourcepub fn permits(&self, capability: Capability) -> bool
pub fn permits(&self, capability: Capability) -> bool
Whether the session’s role permits a capability.
Sourcepub fn require(&self, capability: Capability) -> Result<()>
pub fn require(&self, capability: Capability) -> Result<()>
Enforces a capability, mapping failure to Error::Forbidden.
§Errors
When the session’s role does not permit the capability.
Trait Implementations§
Source§impl Clone for ChiselClaims
impl Clone for ChiselClaims
Source§impl Debug for ChiselClaims
impl Debug for ChiselClaims
Source§impl<'de> Deserialize<'de> for ChiselClaims
impl<'de> Deserialize<'de> for ChiselClaims
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChiselClaims
impl RefUnwindSafe for ChiselClaims
impl Send for ChiselClaims
impl Sync for ChiselClaims
impl Unpin for ChiselClaims
impl UnsafeUnpin for ChiselClaims
impl UnwindSafe for ChiselClaims
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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