pub struct ImportConfig {
pub enabled: bool,
pub allow_file: bool,
pub allow_http: bool,
pub file_root: Option<PathBuf>,
pub url_allowlist: Vec<String>,
pub allow_unrestricted: bool,
}Expand description
Runtime security configuration for apoc.load.* (and,
ultimately, apoc.export.*). The top-level enabled flag
is the master switch; a still-enabled config with both
allow_file and allow_http off is legal but makes every
call fail — useful for wiring the feature in on a staging
host while the allowlists are still being decided.
Fields§
§enabled: boolMaster gate. When false, every apoc.load.* call
refuses with a message naming the config key.
allow_file: boolWhen true, file:// and plain-path inputs are
accepted. Subject to Self::file_root.
allow_http: boolWhen true, http:// and https:// URLs are accepted.
Subject to Self::url_allowlist.
file_root: Option<PathBuf>When set, file reads are pinned to this directory tree.
An input path must be inside it after canonicalisation;
symlinks pointing outside are rejected. None means no
restriction — allow_file = true with no root is
equivalent to “any file the process can read”, so prefer
setting it even in trusted environments.
url_allowlist: Vec<String>When non-empty, an HTTP URL must start with one of these
prefixes. Simple prefix match — no regex — to keep the
audit story straightforward. An empty list plus
allow_http = true permits any URL.
allow_unrestricted: boolDev-only escape hatch. When true, all other checks are
bypassed — useful for local testing but absolutely never
for production. Keeps the separate gates visible in
config review.
Trait Implementations§
Source§impl Clone for ImportConfig
impl Clone for ImportConfig
Source§fn clone(&self) -> ImportConfig
fn clone(&self) -> ImportConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more