pub struct AccessGate { /* private fields */ }Expand description
Single entry point for all authorization decisions.
Every tool execution, path access, command execution, network request, and agent fork must pass through this gate.
§Example
use oxios_kernel::access_manager::{AccessGate, CheckRequest, PathMode};
// AccessGate is constructed during kernel initialization with internal
// parking_lot::Mutex<AccessManager>, ExecConfig, and an AuditSink.
// Security checks use AgentContext (provided by the kernel's agent lifecycle).
//
// gate.check(CheckRequest::Tool { context: &ctx, tool_name: "exec" })?;
// gate.check(CheckRequest::Path {
// context: &ctx,
// path: Path::new("/workspace/file.rs"),
// mode: PathMode::Read,
// })?;Implementations§
Source§impl AccessGate
impl AccessGate
Sourcepub fn new(
access: Arc<Mutex<AccessManager>>,
exec_config: Arc<ExecConfig>,
audit: Arc<dyn AuditSink>,
) -> Self
pub fn new( access: Arc<Mutex<AccessManager>>, exec_config: Arc<ExecConfig>, audit: Arc<dyn AuditSink>, ) -> Self
Create a new access gate.
Sourcepub fn access_clone(&self) -> Arc<Mutex<AccessManager>> ⓘ
pub fn access_clone(&self) -> Arc<Mutex<AccessManager>> ⓘ
Clone the inner access manager Arc (for ExecTool fallback).
Sourcepub fn check(&self, req: CheckRequest<'_>) -> Result<(), AccessDenied>
pub fn check(&self, req: CheckRequest<'_>) -> Result<(), AccessDenied>
Perform a synchronous authorization check.
All decisions (allow and deny) are recorded to the audit sink. Checks are evaluated in order with short-circuit: the first layer to deny stops further evaluation.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AccessGate
impl !UnwindSafe for AccessGate
impl Freeze for AccessGate
impl Send for AccessGate
impl Sync for AccessGate
impl Unpin for AccessGate
impl UnsafeUnpin for AccessGate
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