pub struct RequestIdentity {
pub namespace: String,
pub actor_id: Option<String>,
pub visible_namespaces: Vec<String>,
pub process_ref: Option<String>,
pub request_id: Option<u64>,
}Expand description
Per-request identity context that overrides a VerbRegistry’s
construction-baked default_namespace / actor_id / visible_namespaces
for exactly one VerbRegistry::dispatch_with_identity call (ADR-096
Fork 1 — warm-daemon per-request identity).
A single warm registry is built once with a baked identity, but must be
able to serve requests whose caller resolved a different attribution
identity (e.g. a different project-local [actor]) without a cold
fallback and without mis-stamping writes under the registry’s own baked
actor. Supplying Some(RequestIdentity { .. }) threads the caller’s
identity through token minting for that one call; the registry’s fields
(and every other in-flight call) are untouched. None is exactly
VerbRegistry::dispatch — the baked scalars apply, unchanged from
before this type existed.
Fields§
§namespace: StringStorage/gate default namespace for this request (used when the verb’s
own params carry no explicit namespace field). Overrides
VerbRegistry::default_namespace.
actor_id: Option<String>Write-stamp / gate actor label for this request (ADR-057). Overrides
VerbRegistry::actor_id. None mints ActorRef::anonymous(), same
as an unconfigured baked actor_id.
visible_namespaces: Vec<String>Extra read-visibility namespaces for this request (ADR-007 Rev 4 Rule
3b). Overrides VerbRegistry::visible_namespaces. Entries that fail
Namespace::parse are skipped with a tracing::warn! rather than
failing the whole request — a single malformed visibility entry from a
caller-supplied frame must not block dispatch.
process_ref: Option<String>Opaque process provenance resolved by the originating request process.
None means the origin did not set one; a warm daemon must not replace
it with its own process environment. This field is attribution-only and
never participates in the gate or token authority.
request_id: Option<u64>Caller-supplied correlation id for this request (khive#948), carried
unchanged from the daemon frame’s request_id field. Every operation
in one batch or chain receives the same value: it is a request-group
selector, never an operation-unique id. Stamped into the audit event’s
resource.request_id on every outcome (success, error, and denied) so
a client can join its own pre-send sample to all server-side audit rows
for that request. None means the caller
supplied no id (a pre-#948 client, or an internal/non-benchmark
caller) — the audit row then carries no request_id key at all.
Implementations§
Source§impl RequestIdentity
impl RequestIdentity
Sourcepub fn from_token(token: &NamespaceToken) -> Self
pub fn from_token(token: &NamespaceToken) -> Self
Reconstruct the effective principal and namespace scope carried by an already-authorized token for a nested registry dispatch.
Cross-pack calls must still pass through the registry Gate, but using
the registry’s construction-baked identity would silently replace a
warm daemon request’s actor and visibility (ADR-096). This projection
preserves the token’s exact primary namespace, actor, and read-visible
namespaces, and the origin’s process provenance rider. Nested calls
intentionally use request_id: None even when the token retains the
ingress id for audit rows within its originating dispatch; process_ref IS carried by
the token (ADR-096: an absent value stays absent, a present origin
rider survives nested dispatch without reading the daemon
environment).
Trait Implementations§
Source§impl Clone for RequestIdentity
impl Clone for RequestIdentity
Source§impl Debug for RequestIdentity
impl Debug for RequestIdentity
Auto Trait Implementations§
impl Freeze for RequestIdentity
impl RefUnwindSafe for RequestIdentity
impl Send for RequestIdentity
impl Sync for RequestIdentity
impl Unpin for RequestIdentity
impl UnsafeUnpin for RequestIdentity
impl UnwindSafe for RequestIdentity
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<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 more