-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple policies, effects, matchers support #122
Comments
How to enforce for multiple matchers? |
@hsluoyz My idea is to use regexp to extrat regexp // compile only once
static ref EXR_P: Regex = Regex::new(r"\b(?P<ptype>p\d*)_").unwrap(); extract function pub fn extract_ptype_from_matcher(m: &str) -> Option<String> {
let mut ptype: Option<String> = None;
for caps in EXR_P.captures_iter(m) {
if ptype.is_none() {
ptype = Some(caps["ptype"].to_string());
continue;
} else if Some(&caps["ptype"]) == ptype.as_deref() {
continue;
} else {
panic!("one matcher can only contain one type of policy. eg. p, p2, p3...");
}
}
return ptype;
} |
once The key thing here is to use something like |
A first version will be in #123 |
No description provided.
The text was updated successfully, but these errors were encountered: