pub struct DotfileAllowlist { /* private fields */ }Expand description
Dotfile allowlist (aggregate root).
Immutable after construction. Matching is by exact component equality (case-sensitive, as Solid paths are case-sensitive).
Implementations§
Source§impl DotfileAllowlist
impl DotfileAllowlist
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load from DOTFILE_ALLOWLIST (comma-separated). Falls back to
the default allowlist (.acl, .meta) when unset or empty.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Construct the default allowlist: .acl, .meta, .account.
Sourcepub fn new(entries: Vec<String>) -> Self
pub fn new(entries: Vec<String>) -> Self
Construct with an explicit allowlist. Each entry is normalised
to include the leading ..
Sourcepub fn with_metrics(self, metrics: SecurityMetrics) -> Self
pub fn with_metrics(self, metrics: SecurityMetrics) -> Self
Attach a metrics sink; counter is incremented on every deny.
Sourcepub fn entries(&self) -> &[String]
pub fn entries(&self) -> &[String]
Return the current allowlist entries (normalised; each begins
with .).
Sourcepub fn is_allowed(&self, path: &Path) -> bool
pub fn is_allowed(&self, path: &Path) -> bool
Returns false if ANY path component starts with . AND is
not on the allowlist. Returns true if the path is free of
dotfile components, or if every dotfile component present is
on the allowlist.
. and .. navigation components are always rejected
(callers MUST normalise paths before reaching this primitive,
but we defend in depth).
Trait Implementations§
Source§impl Clone for DotfileAllowlist
impl Clone for DotfileAllowlist
Source§fn clone(&self) -> DotfileAllowlist
fn clone(&self) -> DotfileAllowlist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more