Fetch sandbox policy from `OpenShell` server via gRPC. Returns `Ok(Some(policy))` when the server has a policy configured, or `Ok(None)` when the sandbox was created without a policy (the sandbox should discover one from disk or use the restrictive default).
(endpoint: &str, sandbox_id: &str)
| 564 | /// or `Ok(None)` when the sandbox was created without a policy (the sandbox |
| 565 | /// should discover one from disk or use the restrictive default). |
| 566 | pub async fn fetch_policy(endpoint: &str, sandbox_id: &str) -> Result<Option<ProtoSandboxPolicy>> { |
| 567 | debug!(endpoint = %endpoint, sandbox_id = %sandbox_id, "Connecting to OpenShell server"); |
| 568 | |
| 569 | let mut client = connect(endpoint).await?; |
| 570 | |
| 571 | debug!("Connected, fetching sandbox policy"); |
| 572 | |
| 573 | fetch_policy_with_client(&mut client, sandbox_id).await |
| 574 | } |
| 575 | |
| 576 | /// Fetch sandbox policy using an existing client connection. |
| 577 | async fn fetch_policy_with_client( |
no test coverage detected