@Test @Ignore public void shouldNotAbortWhenUserIsRequestingURIAndAuthorizedURIHasMultipleDynamicPlaceHolders() throws Exception { User user = new User(); Action action1 = new Action(); action1.setUrl("/pgr/seva/{tenantCode}/{id}/_update"); user.setActions(new ArrayList<>(Arrays.asList(action1))); RequestContext ctx = RequestContext.getCurrentContext(); ctx.set(USER_INFO_KEY, user); request.setRequestURI("/pgr/seva/default/123/_update"); ctx.setRequest(request); rbacFilter.run(); assertEquals(null, ctx.get(ERROR_CODE_KEY)); }
@Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); final boolean isIncomingURIInAuthorizedActionList = isIncomingURIInAuthorizedActionList(ctx); if (isIncomingURIInAuthorizedActionList) return null; ExceptionUtils.raiseCustomException(HttpStatus.FORBIDDEN, FORBIDDEN_MESSAGE); return null; }
RbacFilter extends ZuulFilter { @Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); final boolean isIncomingURIInAuthorizedActionList = isIncomingURIInAuthorizedActionList(ctx); if (isIncomingURIInAuthorizedActionList) return null; ExceptionUtils.raiseCustomException(HttpStatus.FORBIDDEN, FORBIDDEN_MESSAGE); return null; } }
RbacFilter extends ZuulFilter { @Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); final boolean isIncomingURIInAuthorizedActionList = isIncomingURIInAuthorizedActionList(ctx); if (isIncomingURIInAuthorizedActionList) return null; ExceptionUtils.raiseCustomException(HttpStatus.FORBIDDEN, FORBIDDEN_MESSAGE); return null; } @Autowired  RbacFilter(RestTemplate restTemplate, String authorizationUrl, ObjectMapper objectMapper); }
RbacFilter extends ZuulFilter { @Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); final boolean isIncomingURIInAuthorizedActionList = isIncomingURIInAuthorizedActionList(ctx); if (isIncomingURIInAuthorizedActionList) return null; ExceptionUtils.raiseCustomException(HttpStatus.FORBIDDEN, FORBIDDEN_MESSAGE); return null; } @Autowired  RbacFilter(RestTemplate restTemplate, String authorizationUrl, ObjectMapper objectMapper); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run(); }
RbacFilter extends ZuulFilter { @Override public Object run() { RequestContext ctx = RequestContext.getCurrentContext(); final boolean isIncomingURIInAuthorizedActionList = isIncomingURIInAuthorizedActionList(ctx); if (isIncomingURIInAuthorizedActionList) return null; ExceptionUtils.raiseCustomException(HttpStatus.FORBIDDEN, FORBIDDEN_MESSAGE); return null; } @Autowired  RbacFilter(RestTemplate restTemplate, String authorizationUrl, ObjectMapper objectMapper); @Override String filterType(); @Override int filterOrder(); @Override boolean shouldFilter(); @Override Object run();  }