@Test public void test_That_Rbac_Check_Sould_Not_Happen_For_AnonymousEndPoints(){ RequestContext ctx = RequestContext.getCurrentContext(); request.setRequestURI("/pgr/complaintTypeCategories"); ctx.setRequest(request); rbacPreCheckFilter.run(); assertFalse((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();  }