pub struct AuthorizerMiddleware { /* private fields */ }Expand description
Authorizer middleware — denies a tool call when the agent lacks the
required capability. Uses crate::security::Authorizer::check.
Implementations§
Source§impl AuthorizerMiddleware
impl AuthorizerMiddleware
Sourcepub fn new(authorizer: Arc<Authorizer>, agent_id: impl Into<String>) -> Self
pub fn new(authorizer: Arc<Authorizer>, agent_id: impl Into<String>) -> Self
Create a new authorizer middleware bound to a specific agent id.
Sourcepub fn with_audit(self, audit: Arc<AuditLog>) -> Self
pub fn with_audit(self, audit: Arc<AuditLog>) -> Self
Attach an audit log so denials are recorded as SecurityDecision
entries. Without this, denials are silent on the audit trail.
Trait Implementations§
Source§impl Middleware for AuthorizerMiddleware
impl Middleware for AuthorizerMiddleware
Source§fn phases(&self) -> Vec<MiddlewarePhase>
fn phases(&self) -> Vec<MiddlewarePhase>
Phases at which this middleware wishes to be invoked.
Source§fn handle<'a>(
&'a self,
ctx: &'a MiddlewareContext,
) -> Pin<Box<dyn Future<Output = MiddlewareResult> + Send + 'a>>
fn handle<'a>( &'a self, ctx: &'a MiddlewareContext, ) -> Pin<Box<dyn Future<Output = MiddlewareResult> + Send + 'a>>
Inspect the context for the current phase and return a result.
Auto Trait Implementations§
impl !RefUnwindSafe for AuthorizerMiddleware
impl !UnwindSafe for AuthorizerMiddleware
impl Freeze for AuthorizerMiddleware
impl Send for AuthorizerMiddleware
impl Sync for AuthorizerMiddleware
impl Unpin for AuthorizerMiddleware
impl UnsafeUnpin for AuthorizerMiddleware
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