pub struct SqlQueryGuard { /* private fields */ }Expand description
Built-in SQL query guard (roadmap phase 7.1).
Implementations§
Source§impl SqlQueryGuard
impl SqlQueryGuard
Sourcepub fn new(config: SqlGuardConfig) -> Self
pub fn new(config: SqlGuardConfig) -> Self
Construct a new guard with the given configuration.
Invalid or over-broad denylisted_predicates produce a guard that
denies every SQL query. Use Self::try_new when policy loading should
reject invalid configurations directly.
Sourcepub fn try_new(config: SqlGuardConfig) -> Result<Self, String>
pub fn try_new(config: SqlGuardConfig) -> Result<Self, String>
Construct a new guard or reject invalid user-supplied regex patterns.
Sourcepub fn config(&self) -> &SqlGuardConfig
pub fn config(&self) -> &SqlGuardConfig
Read-only access to the configuration (useful for tests and observability).
Sourcepub fn analyze(&self, query: &str) -> Result<SqlAnalysis, SqlGuardDenyReason>
pub fn analyze(&self, query: &str) -> Result<SqlAnalysis, SqlGuardDenyReason>
Evaluate a raw SQL query string against the configured policy.
Returns Ok(()) to allow, Err(SqlGuardDenyReason) to deny. This
is the primary testing and integration entry point; the
chio_kernel::Guard impl is a thin wrapper that maps this result
to Verdict.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqlQueryGuard
impl RefUnwindSafe for SqlQueryGuard
impl Send for SqlQueryGuard
impl Sync for SqlQueryGuard
impl Unpin for SqlQueryGuard
impl UnsafeUnpin for SqlQueryGuard
impl UnwindSafe for SqlQueryGuard
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