MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / insert_sandbox

Function insert_sandbox

crates/openshell-server/src/grpc/auth_rpc.rs:195–212  ·  view source on GitHub ↗
(state: &Arc<ServerState>, sandbox_id: &str)

Source from the content-addressed store, hash-verified

193 }
194
195 async fn insert_sandbox(state: &Arc<ServerState>, sandbox_id: &str) {
196 let mut sandbox = Sandbox {
197 metadata: Some(ObjectMeta {
198 id: sandbox_id.to_string(),
199 name: sandbox_id.to_string(),
200 created_at_ms: 1_000_000,
201 labels: HashMap::default(),
202 resource_version: 0,
203 }),
204 spec: Some(SandboxSpec {
205 policy: None,
206 ..Default::default()
207 }),
208 ..Default::default()
209 };
210 sandbox.set_phase(SandboxPhase::Ready as i32);
211 state.store.put_message(&sandbox).await.unwrap();
212 }
213
214 fn sandbox_principal(sandbox_id: &str) -> Principal {
215 use crate::auth::principal::SandboxIdentitySource;

Callers 2

state_with_issuerFunction · 0.85

Calls 2

set_phaseMethod · 0.80
put_messageMethod · 0.80

Tested by

no test coverage detected