Skip to content

Commit 29e89a2

Browse files
authored
fix(windows): restore MXC MSVC builds (NVIDIA#3488)
* fix(windows): restore MXC MSVC builds Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(windows): satisfy MXC policy mapper lint Signed-off-by: Drew Newberry <anewberry@nvidia.com> * test(windows): permit legacy TLS compatibility case Signed-off-by: Drew Newberry <anewberry@nvidia.com> --------- Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 4cd5e54 commit 29e89a2

4 files changed

Lines changed: 14 additions & 18 deletions

File tree

‎crates/openshell-driver-mxc/Cargo.toml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ name = "openshell_driver_mxc"
1515

1616
[dependencies]
1717
openshell-core = { path = "../openshell-core", default-features = false }
18+
openshell-policy = { path = "../openshell-policy" }
1819
# OCSF builders + emit target used by the Windows ETW audit consumer. OS-agnostic
1920
# crate (no windows deps), so safe to depend on from all targets; only the
2021
# windows-gated `etw_consumer` module actually uses it.
@@ -39,9 +40,6 @@ windows = { workspace = true }
3940
tokio = { workspace = true }
4041
# tempfile is not a workspace dependency; 3.27 is already resolved in Cargo.lock.
4142
tempfile = "3"
42-
# Used by Windows-only integration tests to parse policy YAML into the typed
43-
# proto. Inert on non-Windows.
44-
openshell-policy = { path = "../openshell-policy" }
4543
# Needed by the real-wxc integration test (wxc_exec_real.rs) which builds
4644
# --config-base64 payloads without going through the async WxcExecInvoker.
4745
# base64 and serde_json are already [dependencies] but dev-dependency resolution

‎crates/openshell-driver-mxc/src/grpc.rs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ impl ComputeDriver for ComputeDriverService {
6767
request: Request<GetSandboxRequest>,
6868
) -> Result<Response<GetSandboxResponse>, Status> {
6969
let req = request.into_inner();
70-
if req.sandbox_name.is_empty() {
71-
return Err(Status::invalid_argument("sandbox_name is required"));
70+
if req.name.is_empty() {
71+
return Err(Status::invalid_argument("name is required"));
7272
}
7373
let sandbox = self
7474
.backend
75-
.get_sandbox(&req.sandbox_name)
75+
.get_sandbox(&req.name)
7676
.await
77-
.ok_or_else(|| Status::not_found(format!("sandbox {} not found", req.sandbox_name)))?;
77+
.ok_or_else(|| Status::not_found(format!("sandbox {} not found", req.name)))?;
7878
if !req.sandbox_id.is_empty() && req.sandbox_id != sandbox.id {
7979
return Err(Status::failed_precondition(
8080
"sandbox_id did not match the fetched sandbox",
@@ -110,10 +110,10 @@ impl ComputeDriver for ComputeDriverService {
110110
request: Request<StopSandboxRequest>,
111111
) -> Result<Response<StopSandboxResponse>, Status> {
112112
let req = request.into_inner();
113-
if req.sandbox_name.is_empty() {
114-
return Err(Status::invalid_argument("sandbox_name is required"));
113+
if req.name.is_empty() {
114+
return Err(Status::invalid_argument("name is required"));
115115
}
116-
self.backend.stop_sandbox(&req.sandbox_name).await?;
116+
self.backend.stop_sandbox(&req.name).await?;
117117
Ok(Response::new(StopSandboxResponse {}))
118118
}
119119

@@ -134,12 +134,12 @@ impl ComputeDriver for ComputeDriverService {
134134
if req.sandbox_id.is_empty() {
135135
return Err(Status::invalid_argument("sandbox_id is required"));
136136
}
137-
if req.sandbox_name.is_empty() {
138-
return Err(Status::invalid_argument("sandbox_name is required"));
137+
if req.name.is_empty() {
138+
return Err(Status::invalid_argument("name is required"));
139139
}
140140
let deleted = self
141141
.backend
142-
.delete_sandbox(&req.sandbox_id, &req.sandbox_name)
142+
.delete_sandbox(&req.sandbox_id, &req.name)
143143
.await?;
144144
Ok(Response::new(DeleteSandboxResponse { deleted }))
145145
}

‎crates/openshell-driver-mxc/src/policy_map/map.rs‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,7 @@ fn report_endpoint_l7_losses(endpoint: &NetworkEndpoint, path: &str, items: &mut
524524
items,
525525
&format!("{path}.tls"),
526526
severity,
527-
&format!(
528-
"MXC has no OpenShell TLS inspection mode equivalent for '{}'.",
529-
tls
530-
),
527+
&format!("MXC has no OpenShell TLS inspection mode equivalent for '{tls}'."),
531528
"TLS inspection mode",
532529
"MXC network policy is host-level only.",
533530
);
@@ -563,7 +560,7 @@ fn report_endpoint_l7_losses(endpoint: &NetworkEndpoint, path: &str, items: &mut
563560
items,
564561
&format!("{path}.access"),
565562
"error",
566-
&format!("MXC has no access preset equivalent for '{}'.", access),
563+
&format!("MXC has no access preset equivalent for '{access}'."),
567564
"REST/WebSocket/GraphQL access preset",
568565
"MXC cannot enforce method or operation-level access.",
569566
);

‎crates/openshell-driver-mxc/tests/policy_mapper_matrix.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ fn b_tls_skip_warning() {
452452

453453
/// endpoint.tls = "full" (any non-skip) → "error".
454454
#[test]
455+
#[allow(deprecated)]
455456
fn b_tls_non_skip_error() {
456457
let policy = net_policy(
457458
"r",

0 commit comments

Comments
 (0)