pub struct VectorGuardConfig {
pub vendor_markers: Vec<String>,
pub collection_allowlist: Vec<String>,
pub namespace_allowlist: Option<Vec<String>>,
pub denied_operations: Vec<String>,
pub mutating_operations: Vec<String>,
pub field_paths: VectorFieldPaths,
pub allow_all: bool,
}Expand description
Configuration for VectorDbGuard.
The guard is fail-closed by default: an empty collection_allowlist
denies every call unless allow_all is set.
Fields§
§vendor_markers: Vec<String>Substrings that mark a database identifier (or tool name) as
vector-flavored. Defaults to the four vendors called out in the
roadmap plus the generic "vector" sentinel.
collection_allowlist: Vec<String>Collections the grant may touch. Case-insensitive.
namespace_allowlist: Option<Vec<String>>Optional namespace allowlist. None disables namespace
enforcement; Some(empty) denies every namespaced request.
denied_operations: Vec<String>Operation verbs that are always denied regardless of the active
operation class (for example: "drop_index"). Case-insensitive.
mutating_operations: Vec<String>Operation verbs considered “mutating” for the purposes of
SqlOperationClass::ReadOnly enforcement. Case-insensitive.
field_paths: VectorFieldPathsJSON field path overrides.
allow_all: boolAllow every request that passes field-path parsing, ignoring the allowlists. Parse errors still deny.
Implementations§
Source§impl VectorGuardConfig
impl VectorGuardConfig
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when the operator has not configured any allowlist.
Sourcepub fn collection_allowed(&self, name: &str) -> bool
pub fn collection_allowed(&self, name: &str) -> bool
Case-insensitive collection match.
Sourcepub fn namespace_allowed(&self, name: &str) -> bool
pub fn namespace_allowed(&self, name: &str) -> bool
Case-insensitive namespace match. Returns true when namespace
enforcement is disabled.
Sourcepub fn looks_like_vector(&self, database: &str, tool: &str) -> bool
pub fn looks_like_vector(&self, database: &str, tool: &str) -> bool
Returns true when the tool name or database identifier matches any configured vendor substring (case-insensitive).
Trait Implementations§
Source§impl Clone for VectorGuardConfig
impl Clone for VectorGuardConfig
Source§fn clone(&self) -> VectorGuardConfig
fn clone(&self) -> VectorGuardConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more