pub struct RequestContext {
pub sender_tenant: String,
pub sender_identity: String,
pub sender_account: String,
pub sender_session: String,
pub on_behalf_of: String,
pub expected_version: Option<u64>,
pub correlation_id: String,
pub causation_id: String,
pub trace_id: String,
pub bypass_authorization: bool,
pub attributes: Vec<Attribute>,
}Expand description
Who sends a request and in which context. Signed by the client together with the request,
and stored with every event the request causes, so audit and listeners can see it. The kernel
only acts on expected_version and bypass_authorization; the rest is for the domain.
Options for a single call (how long to wait) are not part of it; see SubmitRequest.
Fields§
§sender_tenant: StringThe sender: the real principal, also when acting on behalf of someone else.
sender_identity: String§sender_account: String§sender_session: String§on_behalf_of: Stringauthorize as this identity of the target tenant instead
expected_version: Option<u64>Commands only: rejected with version_mismatch unless the aggregate is at this version
when the command runs (0: the aggregate has no events yet). Absent: no check.
correlation_id: Stringshared by everything one original request causes
causation_id: Stringthe command that caused this one, if any
trace_id: StringPrivileged switch that tells the domain to skip its own authorization: only keys granted
privileged for bypass_authorization may set it (otherwise PERMISSION_DENIED).
attributes: Vec<Attribute>Signed in the given order. Business data only, never security decisions.
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn expected_version(&self) -> u64
pub fn expected_version(&self) -> u64
Returns the value of expected_version, or the default value if expected_version is unset.
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§impl Debug for RequestContext
impl Debug for RequestContext
Source§impl Default for RequestContext
impl Default for RequestContext
Source§impl Message for RequestContext
impl Message for RequestContext
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for RequestContext
impl PartialEq for RequestContext
impl StructuralPartialEq for RequestContext
Auto Trait Implementations§
impl Forget for RequestContext
impl Freeze for RequestContext
impl Move 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
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> 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