pub struct CallEffects {
pub keys: Vec<EffectKey>,
pub complete: bool,
pub understood: bool,
}Expand description
The effects of one call, declared by its tool from the arguments.
Fields§
§keys: Vec<EffectKey>§complete: boolkeys lists everything the call does. false means the tool could
not tell (an opaque script), so policies must not read the list as
exhaustive.
understood: boolEvery part of the call was read and keys name what it changes,
though the tool does not vouch for the list as complete (a shell
command made only of programs it models: a copy into the work area,
a listing, date). After the owner declines a step, such a call that
deletes nothing and reaches nothing outside is not taken for the
declined action by another route.
Implementations§
Source§impl CallEffects
impl CallEffects
Sourcepub fn from_access(
access: &AccessManifest,
annotations: ToolAnnotations,
) -> Self
pub fn from_access( access: &AccessManifest, annotations: ToolAnnotations, ) -> Self
The effects a call’s declared access implies, for a tool that
declares crate::Tool::access but not crate::Tool::effects:
every written path (EffectKey::path) a EffectClass::Write
(and a EffectClass::Delete too for a destructive tool), every
host contacted an EffectClass::Egress (host:port, the port
from the declaration, else the scheme’s, https for a bare host), every command a
EffectClass::Process named by its program. A read-only tool
changes nothing, so only its hosts count. Never complete: the tool
declared what it touches, not that the list is all it does. A
relative path names no key (declare absolute paths, as
Workspace::declare gives). CallEffects::unknown for an empty
manifest.
With these keys an owner’s denial binds the rest of the run: a later call that writes the same path, by any tool, is refused.
Sourcepub fn touches_no_paths(&self) -> bool
pub fn touches_no_paths(&self) -> bool
The tool vouches that the call changes no file: the list is
complete and names no path. For a call that may change things
(whose default effects are CallEffects::unknown), scope and
approval policies take an empty crate::AccessManifest as “changes
no path”, not “paths not declared”. A delegation, a ticket or an
order lookup declares this with CallEffects::none or its own
non-path keys. Effects never describe reads.