pub struct ActAs {
pub namespace: String,
pub space_id: String,
pub grant: u32,
}Expand description
The per-request effective-identity selector the gateway sets when running a
BrainPool::shared service pool: build one with ActAs { namespace, space_id } (or the SDK request builders’ .act_as(..)) to run each op as a
resolved tenant on behalf of the trusted service principal. Re-exported so a
gateway consuming brain_edge need not also name brain_db_sdk directly.
Per-request effective-identity selector carried on data-plane op requests.
When present, the op runs as this (namespace, space_id) on behalf of the
authenticated connection principal; when the field is absent (the common
case, omitted on the wire) the op runs as the connection’s own key-bound
identity.
Honored server-side only when the connection principal holds can_act_as
and namespace lies within its granted allowlist — otherwise the op is
rejected with ErrorCodeWire::ActAsDenied. This is the wire form only;
the trust model is enforced by the server, not this codec.
Fields§
§namespace: StringEffective namespace. Must be within the principal’s allowlist.
space_id: StringStructured, opaque effective-space selector (e.g.
"support-bot:user123") — a CBOR text string on the wire. The server
derives the 16-byte storage space id from it at ingress. An empty
string selects the connection’s key-bound space.
grant: u32Extra capability bits granted to the effective caller for this op,
on top of the standard space mask. Only SCHEMA_UPLOAD (1 << 4)
and ADMIN (1 << 5) are grantable, and only when the connection
principal holds them itself. 0 is omitted on the wire, so a
grant-less selector encodes byte-identically to the pre-grant form.