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

Method local_only

libatomic/src/daemon/sandbox_grants.rs:608–617  ·  view source on GitHub ↗

Refuse a sandbox principal: for local-only methods.

(&self, request: &Request<T>, method: &str)

Source from the content-addressed store, hash-verified

606
607 /// Refuse a sandbox principal: for local-only methods.
608 pub fn local_only<T>(&self, request: &Request<T>, method: &str) -> Result<(), Status> {
609 let has_token = request.metadata().get_bin(SANDBOX_TOKEN_METADATA).is_some();
610 if request.extensions().get::<SandboxGrant>().is_some() || has_token {
611 return Err(domain_status(
612 ErrorCode::Forbidden,
613 format!("only a local caller may call {method}"),
614 ));
615 }
616 Ok(())
617 }
618}
619
620#[cfg(test)]

Callers 6

open_sandboxMethod · 0.80
renew_sandboxMethod · 0.80
close_sandboxMethod · 0.80
create_sandbox_treeMethod · 0.80
stage_sandbox_imageMethod · 0.80
seal_sandbox_imageMethod · 0.80

Calls 3

domain_statusFunction · 0.85
extensionsMethod · 0.80
metadataMethod · 0.45

Tested by

no test coverage detected