Skip to main content

AuthenticatedContext

Trait AuthenticatedContext 

Source
pub trait AuthenticatedContext: HandlerContext {
    // Required methods
    fn user_id(&self) -> Result<Uuid>;
    fn tenant_id(&self) -> Option<Uuid>;
}
Expand description

Trait for contexts that carry an authenticated user.

Implemented by QueryContext, MutationContext, and McpToolContext. Extends HandlerContext with user identity and tenant accessors.

Sealed: only forge-core can implement this trait.

Required Methods§

Source

fn user_id(&self) -> Result<Uuid>

Returns the authenticated user’s UUID, or Unauthorized if the request is not authenticated or the subject is not a UUID.

Source

fn tenant_id(&self) -> Option<Uuid>

Returns the tenant ID from the tenant_id JWT claim, if present.

Implementors§