pub struct SandboxConfig { /* private fields */ }Expand description
Configuration for statement-level sandboxing.
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
Sourcepub fn multi_tenant() -> Self
pub fn multi_tenant() -> Self
Create a sandbox config suitable for multi-tenant environments.
Blocks: COPY FROM/TO, EXPORT/IMPORT/ATTACH/DETACH DATABASE, LOAD EXTENSION. Filters: CALL statements by option name allowlist. Allows: Everything else (MATCH, CREATE, DROP, ALTER, EXPLAIN, etc.).
Sourcepub fn check_query(
&self,
_conn: &Connection<'_>,
query: &str,
) -> Result<(), GraphdError>
pub fn check_query( &self, _conn: &Connection<'_>, query: &str, ) -> Result<(), GraphdError>
Check whether a query is allowed by the sandbox.
Analyzes query keywords to block dangerous operations.
Returns Ok(()) if allowed, Err(message) if blocked.
Sourcepub fn check_query_text(&self, query: &str) -> Result<(), GraphdError>
pub fn check_query_text(&self, query: &str) -> Result<(), GraphdError>
Check query text without needing a connection (for testing).
Auto Trait Implementations§
impl Forget for SandboxConfig
impl Freeze for SandboxConfig
impl Move for SandboxConfig
impl RefUnwindSafe for SandboxConfig
impl Send for SandboxConfig
impl Sync for SandboxConfig
impl Unpin for SandboxConfig
impl UnsafeUnpin for SandboxConfig
impl UnwindSafe for SandboxConfig
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