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

Function group_deny_rules

crates/openshell-cli/src/policy_update.rs:215–234  ·  view source on GitHub ↗
(specs: &[String])

Source from the content-addressed store, hash-verified

213}
214
215fn group_deny_rules(specs: &[String]) -> Result<BTreeMap<(String, u32), Vec<L7DenyRule>>> {
216 let mut grouped = BTreeMap::new();
217 for spec in specs {
218 let parsed = parse_l7_rule_spec("--add-deny", spec)?;
219 grouped
220 .entry((parsed.host, parsed.port))
221 .or_insert_with(Vec::new)
222 .push(L7DenyRule {
223 method: parsed.method,
224 path: parsed.path,
225 command: String::new(),
226 query: HashMap::default(),
227 operation_type: String::new(),
228 operation_name: String::new(),
229 fields: Vec::new(),
230 params: HashMap::default(),
231 });
232 }
233 Ok(grouped)
234}
235
236#[derive(Debug, Clone)]
237struct ParsedL7RuleSpec {

Callers 1

build_policy_update_planFunction · 0.85

Calls 2

parse_l7_rule_specFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected