Expand description
Authenticated-principal task-local plumbing.
Hosts (Session / Transaction execute boundaries) install the current
Principal into a Tokio task-local at the top of each query so deeper
procedure / UDF invocation sites can read it without threading the
principal through every internal API.
This module also exposes maybe_scope_with_principal — the convenience
wrapper that collapses the match principal { Some(p) => scoped..., None => fut }.await pattern previously duplicated across
uni::api::{session,transaction} and uni-query::df_udfs.
§Stability
Moved here in Phase 5 of the §1.2 consolidation pass. uni-query
re-exports the items below for backwards compatibility.
Statics§
- CURRENT_
PRINCIPAL - Tokio task-local carrying the authenticated principal for the in-flight query.
Functions§
- current_
principal - Borrow the principal active for the current execute scope, if any.
- maybe_
scope_ with_ principal - Run
futeither inside a principal task-local scope or unwrapped, depending on whether a principal was supplied. - scoped_
with_ principal - Run
futinside a scope wherecurrent_principalresolves toprincipal.