11// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22// SPDX-License-Identifier: Apache-2.0
33
4- //! Compatibility fixtures for RFC 0005 Phase 0 .
4+ //! Compatibility and regression contracts for the shared proxy egress pipeline .
55
66use super :: * ;
77use std:: io:: Write ;
@@ -27,7 +27,7 @@ fn allowed_decision(intent: EgressIntent) -> EgressDecision {
2727 EgressDecision {
2828 intent,
2929 action : NetworkAction :: Allow {
30- matched_policy : Some ( "phase0 " . to_string ( ) ) ,
30+ matched_policy : Some ( "proxy_compatibility " . to_string ( ) ) ,
3131 } ,
3232 l4_policy_generation : 0 ,
3333 identity : ProcessIdentityEvidence :: Available ,
@@ -98,7 +98,7 @@ async fn destination_denials_preserve_adapter_specific_wire_contracts() {
9898 for ( kind, detail) in cases {
9999 let denial = DestinationDenial {
100100 kind,
101- reason : "phase0 destination failure" . to_string ( ) ,
101+ reason : "proxy compatibility destination failure" . to_string ( ) ,
102102 } ;
103103 let peer: SocketAddr = "127.0.0.1:41000" . parse ( ) . unwrap ( ) ;
104104
@@ -142,7 +142,7 @@ async fn destination_denials_preserve_adapter_specific_wire_contracts() {
142142 "42" ,
143143 "/usr/bin/sh" ,
144144 "curl" ,
145- "phase0 " ,
145+ "proxy_compatibility " ,
146146 & allowed_decision ( EgressIntent :: forward_http (
147147 "target.example" . to_string ( ) ,
148148 8080 ,
@@ -213,7 +213,7 @@ fn representative_adapter_denials_preserve_ocsf_fields() {
213213 "42" ,
214214 "/usr/bin/sh" ,
215215 "curl --proxy" ,
216- "phase0 " ,
216+ "proxy_compatibility " ,
217217 & allowed_decision ( EgressIntent :: forward_http (
218218 "target.example" . to_string ( ) ,
219219 8080 ,
@@ -263,7 +263,7 @@ fn representative_adapter_denials_preserve_ocsf_fields() {
263263 assert_eq ! ( forward[ "dst_endpoint" ] [ "domain" ] , "target.example" ) ;
264264 assert_eq ! ( forward[ "dst_endpoint" ] [ "port" ] , 8080 ) ;
265265 assert_eq ! ( forward[ "http_request" ] [ "http_method" ] , "POST" ) ;
266- assert_eq ! ( forward[ "firewall_rule" ] [ "name" ] , "phase0 " ) ;
266+ assert_eq ! ( forward[ "firewall_rule" ] [ "name" ] , "proxy_compatibility " ) ;
267267 assert_eq ! ( forward[ "firewall_rule" ] [ "type" ] , "ssrf" ) ;
268268 assert_eq ! (
269269 forward[ "message" ] ,
@@ -283,7 +283,7 @@ fn representative_adapter_allows_preserve_ocsf_fields() {
283283 "42" ,
284284 "/usr/bin/sh" ,
285285 "curl --proxy" ,
286- "phase0 " ,
286+ "proxy_compatibility " ,
287287 true ,
288288 ) )
289289 . unwrap ( ) ;
@@ -296,7 +296,7 @@ fn representative_adapter_allows_preserve_ocsf_fields() {
296296 assert_eq ! ( connect[ "dst_endpoint" ] [ "domain" ] , "target.example" ) ;
297297 assert_eq ! ( connect[ "dst_endpoint" ] [ "port" ] , 8443 ) ;
298298 assert_eq ! ( connect[ "actor" ] [ "process" ] [ "name" ] , "/usr/bin/curl" ) ;
299- assert_eq ! ( connect[ "firewall_rule" ] [ "name" ] , "phase0 " ) ;
299+ assert_eq ! ( connect[ "firewall_rule" ] [ "name" ] , "proxy_compatibility " ) ;
300300 assert_eq ! ( connect[ "firewall_rule" ] [ "type" ] , "opa" ) ;
301301 assert_eq ! ( connect[ "message" ] , "CONNECT_L7 allowed target.example:8443" ) ;
302302
@@ -310,7 +310,7 @@ fn representative_adapter_allows_preserve_ocsf_fields() {
310310 "42" ,
311311 "/usr/bin/sh" ,
312312 "curl --proxy" ,
313- "phase0 " ,
313+ "proxy_compatibility " ,
314314 ) )
315315 . unwrap ( ) ;
316316 assert_eq ! ( forward[ "class_name" ] , "HTTP Activity" ) ;
@@ -322,7 +322,7 @@ fn representative_adapter_allows_preserve_ocsf_fields() {
322322 assert_eq ! ( forward[ "dst_endpoint" ] [ "domain" ] , "target.example" ) ;
323323 assert_eq ! ( forward[ "dst_endpoint" ] [ "port" ] , 8080 ) ;
324324 assert_eq ! ( forward[ "http_request" ] [ "http_method" ] , "GET" ) ;
325- assert_eq ! ( forward[ "firewall_rule" ] [ "name" ] , "phase0 " ) ;
325+ assert_eq ! ( forward[ "firewall_rule" ] [ "name" ] , "proxy_compatibility " ) ;
326326 assert_eq ! ( forward[ "firewall_rule" ] [ "type" ] , "opa" ) ;
327327 assert_eq ! (
328328 forward[ "message" ] ,
@@ -335,8 +335,8 @@ fn poisoned_engine() -> OpaEngine {
335335 include_str ! ( "../../../data/sandbox-policy.rego" ) ,
336336 r#"
337337network_policies:
338- phase0 :
339- name: phase0
338+ proxy_compatibility :
339+ name: proxy_compatibility
340340 endpoints:
341341 - host: target.example
342342 port: 443
@@ -397,8 +397,8 @@ fn identity_required_policy_accepts_real_binary_and_rejects_empty_exec_path() {
397397 include_str ! ( "../../../data/sandbox-policy.rego" ) ,
398398 r#"
399399network_policies:
400- phase0 :
401- name: phase0
400+ proxy_compatibility :
401+ name: proxy_compatibility
402402 endpoints:
403403 - host: target.example
404404 port: 443
@@ -524,7 +524,7 @@ async fn exercise_benchmark_request(proxy_addr: SocketAddr, target: SocketAddr,
524524 format ! ( "CONNECT {authority} HTTP/1.1\r \n Host: {authority}\r \n \r \n " )
525525 } else {
526526 format ! (
527- "GET http://{authority}/phase0 HTTP/1.1\r \n Host: {authority}\r \n Connection: close\r \n \r \n "
527+ "GET http://{authority}/proxy-baseline HTTP/1.1\r \n Host: {authority}\r \n Connection: close\r \n \r \n "
528528 )
529529 } ;
530530 client. write_all ( request. as_bytes ( ) ) . await . unwrap ( ) ;
@@ -534,10 +534,10 @@ async fn exercise_benchmark_request(proxy_addr: SocketAddr, target: SocketAddr,
534534}
535535
536536/// Run with:
537- /// `cargo test -p openshell-supervisor-network phase0_proxy_performance_baseline -- --ignored --nocapture --test-threads=1`
537+ /// `cargo test -p openshell-supervisor-network proxy_performance_baseline -- --ignored --nocapture --test-threads=1`
538538#[ test]
539- #[ ignore = "manual Phase 0 allocation/query/latency baseline" ]
540- fn phase0_proxy_performance_baseline ( ) {
539+ #[ ignore = "manual proxy allocation/query/latency baseline" ]
540+ fn proxy_performance_baseline ( ) {
541541 temp_env:: with_vars (
542542 [ (
543543 openshell_core:: sandbox_env:: NETWORK_BINARY_IDENTITY ,
@@ -559,8 +559,8 @@ fn phase0_proxy_performance_baseline() {
559559 let policy = format ! (
560560 r#"
561561network_policies:
562- phase0 :
563- name: phase0
562+ proxy_compatibility :
563+ name: proxy_compatibility
564564 endpoints:
565565 - host: {host}
566566 port: {port}
@@ -642,7 +642,7 @@ network_policies:
642642 "{}" ,
643643 serde_json:: json!( {
644644 "iterations" : iterations,
645- "phase0_proxy_baseline " : results,
645+ "proxy_performance_baseline " : results,
646646 "scenario" : "declared_loopback_destination_denied" ,
647647 "schema_version" : 1 ,
648648 } )
0 commit comments