(specs: &[String])
| 213 | } |
| 214 | |
| 215 | fn 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)] |
| 237 | struct ParsedL7RuleSpec { |
no test coverage detected