pub struct CallerIdentity { /* private fields */ }Expand description
Authenticated caller metadata supplied by an adapter boundary.
Implementations§
Source§impl CallerIdentity
impl CallerIdentity
Sourcepub fn new(
subject: impl Into<String>,
namespaces: impl IntoIterator<Item = String>,
) -> Self
pub fn new( subject: impl Into<String>, namespaces: impl IntoIterator<Item = String>, ) -> Self
Build a caller identity whose namespace grants came from the
development x-aion-namespaces header.
Sourcepub fn from_token_claims(
subject: impl Into<String>,
namespaces: impl IntoIterator<Item = String>,
) -> Self
pub fn from_token_claims( subject: impl Into<String>, namespaces: impl IntoIterator<Item = String>, ) -> Self
Build a caller identity whose namespace grants came from a validated token’s namespace claim (the real JWT path), so denial messages direct the operator to the token grant instead of the development header.
Sourcepub fn with_deploy(self, deploy: bool) -> Self
pub fn with_deploy(self, deploy: bool) -> Self
Attach the deployment-wide deploy grant decision to this identity.
The grant is engine-global, never namespace-scoped: loading a package re-points routing for a workflow type that is startable from every namespace, so a namespace-valued grant would promise an isolation the engine does not provide.
Sourcepub const fn deploy_granted(&self) -> bool
pub const fn deploy_granted(&self) -> bool
Whether the caller holds the deployment-wide deploy grant.
Sourcepub fn denied(subject: impl Into<String>, reason: impl Into<String>) -> Self
pub fn denied(subject: impl Into<String>, reason: impl Into<String>) -> Self
Build a caller identity that must be denied with a transport-specific reason.
Sourcepub fn namespaces(&self) -> Vec<String>
pub fn namespaces(&self) -> Vec<String>
Namespaces this caller is authorized for, in sorted order.
Backed by a BTreeSet, so the returned vector is already
lexicographically ordered with no duplicates.
Trait Implementations§
Source§impl Clone for CallerIdentity
impl Clone for CallerIdentity
Source§fn clone(&self) -> CallerIdentity
fn clone(&self) -> CallerIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CallerIdentity
impl Debug for CallerIdentity
impl Eq for CallerIdentity
Source§impl PartialEq for CallerIdentity
impl PartialEq for CallerIdentity
Source§fn eq(&self, other: &CallerIdentity) -> bool
fn eq(&self, other: &CallerIdentity) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CallerIdentity
Auto Trait Implementations§
impl Freeze for CallerIdentity
impl RefUnwindSafe for CallerIdentity
impl Send for CallerIdentity
impl Sync for CallerIdentity
impl Unpin for CallerIdentity
impl UnsafeUnpin for CallerIdentity
impl UnwindSafe for CallerIdentity
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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::RequestSource§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