pub struct Boundary {
pub roots: Option<Vec<PathBuf>>,
pub allow_secrets: bool,
}Expand description
What this caller is allowed to index.
Two different callers, two different answers. The person typing semlith index owns the machine: they are held to the deny-list, because indexing a
private key by accident is a mistake rather than a decision, and
--include-secrets is how they say they meant it. An agent holding the
agent key is held to both the deny-list and a boundary, because the whole of
what that key can reach is what a leaked key can reach — and “every file this
user can read” is too much for a credential that lives in a config file.
The default is the CLI’s: the deny-list, and no confinement.
Fields§
§roots: Option<Vec<PathBuf>>Directories a path must be under. None means anywhere, which is what
the command line gets.
allow_secrets: boolWhether the deny-list is off for this run, which only the command line can ask for.
Implementations§
Source§impl Boundary
impl Boundary
Sourcepub fn refuses(
&self,
path: &Path,
walked: bool,
home: Option<&Path>,
) -> Option<Refusal>
pub fn refuses( &self, path: &Path, walked: bool, home: Option<&Path>, ) -> Option<Refusal>
Why this path may not be indexed, in a line naming the rule.
walked is whether the walk yielded this path or the caller named it,
and it decides one rule only: the hidden-file rule. A dotfile the walk
yielded is there because the user’s own .gitignore whitelisted it —
dist/* then !dist/.gitkeep — and refusing it as hidden is the walk
contradicting itself, which is what ended a run on the reporter’s
Angular tree. A dotfile the caller named is still refused: semlith index ~/.npmrc is a mistake worth catching. Every other rule — the
credential directories, the credential names — applies to both.
Sourcepub fn resolved(&self, home: Option<&Path>) -> ResolvedBoundary
pub fn resolved(&self, home: Option<&Path>) -> ResolvedBoundary
This boundary with its roots resolved once, for a pass that asks about
many paths. home is the canonical home directory, already resolved.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Boundary
impl RefUnwindSafe for Boundary
impl Send for Boundary
impl Sync for Boundary
impl Unpin for Boundary
impl UnsafeUnpin for Boundary
impl UnwindSafe for Boundary
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.