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

Function eval_l7_raw_data

crates/openshell-supervisor-network/src/opa.rs:2245–2258  ·  view source on GitHub ↗
(data: serde_json::Value, input: serde_json::Value)

Source from the content-addressed store, hash-verified

2243 }
2244
2245 fn eval_l7_raw_data(data: serde_json::Value, input: serde_json::Value) -> bool {
2246 let mut engine = regorus::Engine::new();
2247 engine
2248 .add_policy("policy.rego".into(), TEST_POLICY.into())
2249 .unwrap();
2250 engine
2251 .add_data_json(&data.to_string())
2252 .expect("add raw data json");
2253 engine.set_input_json(&input.to_string()).unwrap();
2254 let val = engine
2255 .eval_rule("data.openshell.sandbox.allow_request".into())
2256 .unwrap();
2257 val == regorus::Value::from(true)
2258 }
2259
2260 #[test]
2261 fn l7_get_allowed_by_rules() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected