/** * Returns a new handler that can allow or deny access to a resource based an at attribute of the exchange * * @param next The next handler in the chain * @param defaultAllow Determine if a non-matching user agent will be allowed by default * @return A new user agent access control handler */ public static final AccessControlListHandler acl(final HttpHandler next, boolean defaultAllow, ExchangeAttribute attribute) { return new AccessControlListHandler(next, attribute).setDefaultAllow(defaultAllow); }
@Override public HttpHandler wrap(HttpHandler handler) { AccessControlListHandler res = new AccessControlListHandler(handler, attribute); for(AclMatch match: peerMatches) { if(match.deny) { res.addDeny(match.pattern.pattern()); } else { res.addAllow(match.pattern.pattern()); } } res.setDefaultAllow(defaultAllow); return res; } }
/** * Returns a new handler that can allow or deny access to a resource based an at attribute of the exchange * * @param next The next handler in the chain * @param defaultAllow Determine if a non-matching user agent will be allowed by default * @return A new user agent access control handler */ public static final AccessControlListHandler acl(final HttpHandler next, boolean defaultAllow, ExchangeAttribute attribute) { return new AccessControlListHandler(next, attribute).setDefaultAllow(defaultAllow); }
/** * Returns a new handler that can allow or deny access to a resource based an at attribute of the exchange * * @param next The next handler in the chain * @param defaultAllow Determine if a non-matching user agent will be allowed by default * @return A new user agent access control handler */ public static final AccessControlListHandler acl(final HttpHandler next, boolean defaultAllow, ExchangeAttribute attribute) { return new AccessControlListHandler(next, attribute).setDefaultAllow(defaultAllow); }
@Override public HttpHandler wrap(HttpHandler handler) { AccessControlListHandler res = new AccessControlListHandler(handler, attribute); for(AclMatch match: peerMatches) { if(match.deny) { res.addDeny(match.pattern.pattern()); } else { res.addAllow(match.pattern.pattern()); } } res.setDefaultAllow(defaultAllow); return res; } }
@Override public HttpHandler wrap(HttpHandler handler) { AccessControlListHandler res = new AccessControlListHandler(handler, attribute); for(AclMatch match: peerMatches) { if(match.deny) { res.addDeny(match.pattern.pattern()); } else { res.addAllow(match.pattern.pattern()); } } res.setDefaultAllow(defaultAllow); return res; } }