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

Function group_allow_rules

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

Source from the content-addressed store, hash-verified

190}
191
192fn group_allow_rules(specs: &[String]) -> Result<BTreeMap<(String, u32), Vec<L7Rule>>> {
193 let mut grouped = BTreeMap::new();
194 for spec in specs {
195 let parsed = parse_l7_rule_spec("--add-allow", spec)?;
196 grouped
197 .entry((parsed.host, parsed.port))
198 .or_insert_with(Vec::new)
199 .push(L7Rule {
200 allow: Some(L7Allow {
201 method: parsed.method,
202 path: parsed.path,
203 command: String::new(),
204 query: HashMap::default(),
205 operation_type: String::new(),
206 operation_name: String::new(),
207 fields: Vec::new(),
208 params: HashMap::default(),
209 }),
210 });
211 }
212 Ok(grouped)
213}
214
215fn group_deny_rules(specs: &[String]) -> Result<BTreeMap<(String, u32), Vec<L7DenyRule>>> {
216 let mut grouped = BTreeMap::new();

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