pub struct RequestContext {
pub tenant_id: TenantId,
pub subject_id: SubjectId,
pub roles: BTreeSet<String>,
pub locale: String,
pub request_id: RequestId,
pub entitlements: BTreeSet<String>,
}Expand description
Caller identity and ambient product policy resolved from transport metadata. It is deliberately absent from Agent and Docs request bodies.
Fields§
§tenant_id: TenantIdTenant that owns this record.
subject_id: SubjectIdSubject (user or service principal) acting on or owning this record.
roles: BTreeSet<String>Roles granted to the subject.
locale: StringBCP 47 locale for user-facing text.
request_id: RequestIdTransport request identity for tracing and idempotency.
entitlements: BTreeSet<String>Product entitlements granted to the subject.
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn validate(&self) -> Result<(), ContextError>
pub fn validate(&self) -> Result<(), ContextError>
Reject a context whose identity fields are blank; roles and entitlements may be empty.
Sourcepub fn durable_identity(&self) -> RequestContext
pub fn durable_identity(&self) -> RequestContext
Durable records retain identity only. Roles and entitlements are re-resolved before every recovered execution.
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§fn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestContext
impl Debug for RequestContext
Source§impl<'de> Deserialize<'de> for RequestContext
impl<'de> Deserialize<'de> for RequestContext
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequestContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RequestContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RequestContext
Source§impl PartialEq for RequestContext
impl PartialEq for RequestContext
Source§impl Serialize for RequestContext
impl Serialize for RequestContext
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for RequestContext
Auto Trait Implementations§
impl Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnsafeUnpin for RequestContext
impl UnwindSafe for RequestContext
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
Mutably borrows from an owned value. Read more
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.