(specs: &[String])
| 190 | } |
| 191 | |
| 192 | fn 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 | |
| 215 | fn group_deny_rules(specs: &[String]) -> Result<BTreeMap<(String, u32), Vec<L7DenyRule>>> { |
| 216 | let mut grouped = BTreeMap::new(); |
no test coverage detected