@Override public HandlerWrapper build(Map<String, Object> config) { String[] acl = (String[]) config.get("acl"); Boolean defaultAllow = (Boolean) config.get("default-allow"); ExchangeAttribute attribute = (ExchangeAttribute) config.get("attribute"); List<AclMatch> peerMatches = new ArrayList<>(); for(String rule :acl) { String[] parts = rule.split(" "); if(parts.length != 2) { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } if(parts[1].trim().equals("allow")) { peerMatches.add(new AclMatch(false, parts[0].trim())); } else if(parts[1].trim().equals("deny")) { peerMatches.add(new AclMatch(true, parts[0].trim())); } else { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } } return new Wrapper(peerMatches, defaultAllow == null ? false : defaultAllow, attribute); }
private AccessControlListHandler addRule(final String userAgent, final boolean deny) { this.acl.add(new AclMatch(deny, userAgent)); return this; }
@Override public HandlerWrapper build(Map<String, Object> config) { String[] acl = (String[]) config.get("acl"); Boolean defaultAllow = (Boolean) config.get("default-allow"); ExchangeAttribute attribute = (ExchangeAttribute) config.get("attribute"); List<AclMatch> peerMatches = new ArrayList<>(); for(String rule :acl) { String[] parts = rule.split(" "); if(parts.length != 2) { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } if(parts[1].trim().equals("allow")) { peerMatches.add(new AclMatch(false, parts[0].trim())); } else if(parts[1].trim().equals("deny")) { peerMatches.add(new AclMatch(true, parts[0].trim())); } else { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } } return new Wrapper(peerMatches, defaultAllow == null ? false : defaultAllow, attribute); }
@Override public HandlerWrapper build(Map<String, Object> config) { String[] acl = (String[]) config.get("acl"); Boolean defaultAllow = (Boolean) config.get("default-allow"); ExchangeAttribute attribute = (ExchangeAttribute) config.get("attribute"); List<AclMatch> peerMatches = new ArrayList<>(); for(String rule :acl) { String[] parts = rule.split(" "); if(parts.length != 2) { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } if(parts[1].trim().equals("allow")) { peerMatches.add(new AclMatch(false, parts[0].trim())); } else if(parts[1].trim().equals("deny")) { peerMatches.add(new AclMatch(true, parts[0].trim())); } else { throw UndertowMessages.MESSAGES.invalidAclRule(rule); } } return new Wrapper(peerMatches, defaultAllow == null ? false : defaultAllow, attribute); }
private AccessControlListHandler addRule(final String userAgent, final boolean deny) { this.acl.add(new AclMatch(deny, userAgent)); return this; }
private AccessControlListHandler addRule(final String userAgent, final boolean deny) { this.acl.add(new AclMatch(deny, userAgent)); return this; }