Skip to main content

oxios_kernel/kernel_handle/
exec_api.rs

1//! Exec API — execution configuration and access management facade.
2
3use crate::access_manager::AccessManager;
4use crate::config::ExecConfig;
5use std::sync::Arc;
6
7/// Execution management system calls.
8///
9/// Wraps [`ExecConfig`] for execution policy and [`AccessManager`] for
10/// RBAC / path sandboxing enforcement.
11pub struct ExecApi {
12    config: Arc<ExecConfig>,
13    access_manager: Arc<parking_lot::Mutex<AccessManager>>,
14}
15
16impl ExecApi {
17    /// Create a new ExecApi.
18    pub fn new(
19        config: Arc<ExecConfig>,
20        access_manager: Arc<parking_lot::Mutex<AccessManager>>,
21    ) -> Self {
22        Self {
23            config,
24            access_manager,
25        }
26    }
27
28    /// Execution configuration reference.
29    pub fn config(&self) -> &ExecConfig {
30        &self.config
31    }
32
33    /// Access manager reference.
34    pub fn access_manager(&self) -> &Arc<parking_lot::Mutex<AccessManager>> {
35        &self.access_manager
36    }
37}