Sync a locally-discovered policy using an existing client connection.
(
client: &mut OpenShellClient<AuthedChannel>,
sandbox: &str,
policy: &ProtoSandboxPolicy,
)
| 599 | |
| 600 | /// Sync a locally-discovered policy using an existing client connection. |
| 601 | async fn sync_policy_with_client( |
| 602 | client: &mut OpenShellClient<AuthedChannel>, |
| 603 | sandbox: &str, |
| 604 | policy: &ProtoSandboxPolicy, |
| 605 | ) -> Result<()> { |
| 606 | client |
| 607 | .update_config(UpdateConfigRequest { |
| 608 | name: sandbox.to_string(), |
| 609 | policy: Some(policy.clone()), |
| 610 | setting_key: String::new(), |
| 611 | setting_value: None, |
| 612 | delete_setting: false, |
| 613 | global: false, |
| 614 | merge_operations: vec![], |
| 615 | expected_resource_version: 0, |
| 616 | }) |
| 617 | .await |
| 618 | .into_diagnostic() |
| 619 | .wrap_err("failed to sync policy to server")?; |
| 620 | |
| 621 | Ok(()) |
| 622 | } |
| 623 | |
| 624 | /// Discover and sync policy using a single gRPC connection. |
| 625 | /// |
no test coverage detected