MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / data_view

Function data_view

libatomic/src/daemon/services_sandbox.rs:126–141  ·  view source on GitHub ↗

The view a data op acts on: a sandbox's grant view (an explicit target must be it, and the grant must carry `capability`), or the view a local caller names.

(
    caller: Option<&SandboxCaller>,
    handle: &RepoHandle,
    repository: &RepositoryRef,
    target: Option<&ViewRef>,
    capability: &str,
)

Source from the content-addressed store, hash-verified

124/// must be it, and the grant must carry `capability`), or the view a local
125/// caller names.
126fn data_view(
127 caller: Option<&SandboxCaller>,
128 handle: &RepoHandle,
129 repository: &RepositoryRef,
130 target: Option<&ViewRef>,
131 capability: &str,
132) -> Result<String, Status> {
133 match caller {
134 Some(caller) => {
135 caller.require(capability)?;
136 caller.require_target(handle, repository, target)?;
137 Ok(caller.view().to_string())
138 }
139 None => named_view(target, ""),
140 }
141}
142
143/// The view exists — and, for a grant that recorded the view's id, it is
144/// still the view the grant was issued for (deleting a view and recreating

Callers 6

materializeMethod · 0.85
get_file_statesMethod · 0.85
get_changesMethod · 0.85
publish_provenanceMethod · 0.85
submit_changeMethod · 0.85
submit_attestationMethod · 0.85

Calls 4

named_viewFunction · 0.85
require_targetMethod · 0.80
requireMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected