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

Method call

atomic-cli/tests/it/remote_sandbox_client_test.rs:75–88  ·  view source on GitHub ↗
(&mut self, request: tonic::codegen::http::Request<B>)

Source from the content-addressed store, hash-verified

73 }
74
75 fn call(&mut self, request: tonic::codegen::http::Request<B>) -> Self::Future {
76 let sandbox = request
77 .headers()
78 .contains_key(libatomic::daemon::sandbox_grants::SANDBOX_TOKEN_METADATA);
79 let path = request.uri().path().to_string();
80 if sandbox && !libatomic::daemon::sandbox_grants::is_sandbox_scoped(&path) {
81 let refused = tonic::Status::permission_denied(format!(
82 "atomic:FORBIDDEN: a sandbox may not call {path}"
83 ))
84 .into_http();
85 return Box::pin(async move { Ok(refused) });
86 }
87 Box::pin(self.0.call(request))
88 }
89}
90
91#[derive(Clone)]

Callers

nothing calls this directly

Calls 3

is_sandbox_scopedFunction · 0.85
contains_keyMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected