pub struct AuthenticatedPrincipal {
pub principal: PrincipalId,
pub grant: GrantToken,
/* private fields */
}Expand description
The authenticated principal + the verified grant carried by a bearer token.
Produced by IjimaAuth::verify_bearer. Handlers consult
may to enforce a specific capability. The grant’s
partitions are cryptographically signed, so the geometric containment
check needs only the shared controller (to resolve a required
capability’s partition) and the shared verifier — both cheap Arc
clones.
Fields§
§principal: PrincipalIdThe principal this grant was issued to.
grant: GrantTokenThe verified multi-capability grant.
Implementations§
Source§impl AuthenticatedPrincipal
impl AuthenticatedPrincipal
Sourcepub fn may(&self, required: &str) -> bool
pub fn may(&self, required: &str) -> bool
Returns true if the grant geometrically implies required
(directly or because some granted partition λ satisfies
required.partition ≤ λ component-wise).
An unknown required capability (not in the policy) is denied.
Sourcepub fn granted_capabilities(&self) -> Vec<String>
pub fn granted_capabilities(&self) -> Vec<String>
The list of capabilities explicitly carried by this grant (for
debugging / operator visibility). Note this is the signed set,
not the geometric closure — a grant of [memory:write] also implies
memory:read via may even though read is not
listed here.
Sourcepub fn personal_namespace(&self) -> NamespaceId
pub fn personal_namespace(&self) -> NamespaceId
This principal’s default personal namespace id
(ns_<principal>_private). Every request is scoped to this
namespace unless explicit namespace parameters land later.
Trait Implementations§
Source§impl Clone for AuthenticatedPrincipal
impl Clone for AuthenticatedPrincipal
Source§fn clone(&self) -> AuthenticatedPrincipal
fn clone(&self) -> AuthenticatedPrincipal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AuthenticatedPrincipal
impl !UnwindSafe for AuthenticatedPrincipal
impl Freeze for AuthenticatedPrincipal
impl Send for AuthenticatedPrincipal
impl Sync for AuthenticatedPrincipal
impl Unpin for AuthenticatedPrincipal
impl UnsafeUnpin for AuthenticatedPrincipal
Blanket Implementations§
impl<T> AsyncFriendly for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request