pub struct AuthCtx {
pub agent_id: Uuid,
pub agent_name: String,
pub team_id: Uuid,
pub team_slug: String,
pub session: String,
pub session_id: Option<Uuid>,
pub session_epoch: Option<i64>,
pub token_id: Option<Uuid>,
}Expand description
Identity resolved from the bearer token, injected into the HTTP request extensions so tool handlers can read it. Every tool call is scoped to this.
Fields§
§agent_id: Uuid§agent_name: String§team_id: Uuid§team_slug: String§session: StringWhich of the agent’s concurrent working contexts is calling. Empty is the shared session: what every client that sends no header gets, and what every row created before sessions existed carries.
This is deliberately not identity. It arrives from a header rather than from the token, so it is caller-controlled and must never be used to decide which agent is speaking — only to partition that agent’s own presence, claims and locks.
When Self::session_id is set the value was proven rather than
asserted: it came from the session credential, and a header that
disagreed was refused before this struct existed.
session_id: Option<Uuid>Set when the caller authenticated with a session credential
(acss_…): the row in agent_sessions it belongs to. None is a
plain agent token, where session is only a label.
session_epoch: Option<i64>Connection epoch of that session, for callers that fence stale
connections. None without a session credential.
token_id: Option<Uuid>The api_tokens row that authenticated this request, when it was an
agent token. Carried so that registering a session can hang it off
the exact credential used without the tool layer ever handling the
secret. None for a session credential (which cannot register) and
for the dashboard’s team-only context.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthCtx
impl RefUnwindSafe for AuthCtx
impl Send for AuthCtx
impl Sync for AuthCtx
impl Unpin for AuthCtx
impl UnsafeUnpin for AuthCtx
impl UnwindSafe for AuthCtx
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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