pub struct AuthzRequest {Show 13 fields
pub entity: EntityRef,
pub user_id: UserId,
pub actor: Option<Actor>,
pub client_id: Option<ClientId>,
pub access_scope: Option<AccessScope>,
pub roles: Vec<String>,
pub attributes: BTreeMap<String, Value>,
pub trace_id: TraceId,
pub session_id: Option<SessionId>,
pub context: AuthzContext,
pub context_id: Option<ContextId>,
pub task_id: Option<TaskId>,
pub act_chain: Vec<Actor>,
}Expand description
One authorization question, as sent to the configured hook.
This struct crosses the wire as JSON to an out-of-process hook, so every
field added after user_id is optional on the wire: a hook built against
an older shape must still parse a newer request, or every governed call
would fail closed while the two sides are deployed separately.
actor is the surface the request came through (user, mcp server, agent,
job); its user_id MUST equal the top-level user_id. Build through
AuthzRequest::for_actor so the two cannot diverge. client_id is the
OAuth client from the validated token, never from a request header.
Fields§
§entity: EntityRef§user_id: UserId§actor: Option<Actor>§client_id: Option<ClientId>§access_scope: Option<AccessScope>§roles: Vec<String>§attributes: BTreeMap<String, Value>§trace_id: TraceId§session_id: Option<SessionId>§context: AuthzContext§context_id: Option<ContextId>§task_id: Option<TaskId>§act_chain: Vec<Actor>Implementations§
Trait Implementations§
Source§impl Clone for AuthzRequest
impl Clone for AuthzRequest
Source§fn clone(&self) -> AuthzRequest
fn clone(&self) -> AuthzRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthzRequest
impl Debug for AuthzRequest
Source§impl<'de> Deserialize<'de> for AuthzRequest
impl<'de> Deserialize<'de> for AuthzRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthzRequest
impl RefUnwindSafe for AuthzRequest
impl Send for AuthzRequest
impl Sync for AuthzRequest
impl Unpin for AuthzRequest
impl UnsafeUnpin for AuthzRequest
impl UnwindSafe for AuthzRequest
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
Mutably borrows from an owned value. Read more
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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