@Test public void test_should_return_true_when_uri_is_not_in_open_or_anonymous_endpoint_and_uri_is_present_in_rbacwhitelist() throws Exception { RequestContext ctx = RequestContext.getCurrentContext(); request.setRequestURI("/pgr/seva/_create"); ctx.setRequest(request); rbacPreCheckFilter.run(); assertTrue((Boolean) ctx.get("shouldDoRbac")); }
@Override public Object run() { if ((openEndpointsWhitelist.contains(getRequestURI()) || anonymousEndpointsWhitelist.contains(getRequestURI()))) { setShouldDoRbac(false); logger.info(SKIP_RBAC, getRequestURI()); return null; } setShouldDoRbac(true); return null; }
RbacPreCheckFilter extends ZuulFilter { @Override public Object run() { if ((openEndpointsWhitelist.contains(getRequestURI()) || anonymousEndpointsWhitelist.contains(getRequestURI()))) { setShouldDoRbac(false); logger.info(SKIP_RBAC, getRequestURI()); return null; } setShouldDoRbac(true); return null; } }
RbacPreCheckFilter extends ZuulFilter { @Override public Object run() { if ((openEndpointsWhitelist.contains(getRequestURI()) || anonymousEndpointsWhitelist.contains(getRequestURI()))) { setShouldDoRbac(false); logger.info(SKIP_RBAC, getRequestURI()); return null; } setShouldDoRbac(true); return null; } @Autowired  RbacPreCheckFilter(HashSet<String> openEndpointsWhitelist,
                              HashSet<String> anonymousEndpointsWhitelist); }
RbacPreCheckFilter extends ZuulFilter { @Override public Object run() { if ((openEndpointsWhitelist.contains(getRequestURI()) || anonymousEndpointsWhitelist.contains(getRequestURI()))) { setShouldDoRbac(false); logger.info(SKIP_RBAC, getRequestURI()); return null; } setShouldDoRbac(true); return null; } @Autowired  RbacPreCheckFilter(HashSet<String> openEndpointsWhitelist,
                              HashSet<String> anonymousEndpointsWhitelist); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run(); }
RbacPreCheckFilter extends ZuulFilter { @Override public Object run() { if ((openEndpointsWhitelist.contains(getRequestURI()) || anonymousEndpointsWhitelist.contains(getRequestURI()))) { setShouldDoRbac(false); logger.info(SKIP_RBAC, getRequestURI()); return null; } setShouldDoRbac(true); return null; } @Autowired  RbacPreCheckFilter(HashSet<String> openEndpointsWhitelist,
                              HashSet<String> anonymousEndpointsWhitelist); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run();  }