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

Function handle_update_config

crates/openshell-server/src/grpc/policy.rs:1438–1452  ·  view source on GitHub ↗
(
    state: &Arc<ServerState>,
    request: Request<UpdateConfigRequest>,
)

Source from the content-addressed store, hash-verified

1436// ---------------------------------------------------------------------------
1437
1438pub(super) async fn handle_update_config(
1439 state: &Arc<ServerState>,
1440 request: Request<UpdateConfigRequest>,
1441) -> Result<Response<UpdateConfigResponse>, Status> {
1442 let principal = request.extensions().get::<Principal>().cloned();
1443 let sandbox_caller = matches!(principal, Some(Principal::Sandbox(_)));
1444 let update = request.get_ref();
1445 let should_emit_policy_failure = should_emit_config_update_policy_telemetry(sandbox_caller)
1446 && (update.policy.is_some() || !update.merge_operations.is_empty());
1447 let result = handle_update_config_inner(state, request, principal, sandbox_caller).await;
1448 if result.is_err() && should_emit_policy_failure {
1449 emit_sandbox_policy_update_failure();
1450 }
1451 result
1452}
1453
1454async fn handle_update_config_inner(
1455 state: &Arc<ServerState>,

Tested by

no test coverage detected