(data: serde_json::Value, input: serde_json::Value)
| 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() { |
nothing calls this directly
no outgoing calls
no test coverage detected