/** * Something has happened, so handle it. * @param event the event to handle */ public void handle(io.vertx.rxjava.ext.web.RoutingContext event) { delegate.handle(event.getDelegate()); }
/** * Something has happened, so handle it. * @param event the event to handle */ public void handle(io.vertx.rxjava.ext.web.RoutingContext event) { delegate.handle(event.getDelegate()); }
@Override public void handle(RoutingContext context) { context.put(AUTH_HANDLER_PROP, authHandler); MemberUtil.recoverContextUser(context); authHandler.handle(context); }
private void handle(InterceptableRoutingContext context, int orLevelIndex, int andLevelIndex) { // reset context context.clearUser(); context.setNextCallback(null); context.setFailedCallback(null); // prepare routing next of failure behaviours if (andLevelIndex < security.get(orLevelIndex).size() - 1) { context.setNextCallback(() -> handle(context, orLevelIndex, andLevelIndex + 1)); } if (orLevelIndex < security.size() - 1) { context.setFailedCallback(() -> handle(context, orLevelIndex + 1, 0)); } // navigate to the auth provider at given orIndex and andIndex and call it. // if it fails, the context will call the next auth handler at the OR level, or fail or no more are available. // if it succeeds, the context will call the next auth handler at the AND level, or call the next route handler if no more are available. Map<String, List<String>> orSecurityIdentifiers = security.get(orLevelIndex); if (!orSecurityIdentifiers.isEmpty()) { List<String> andSecurityIdentifiers = new ArrayList<>(orSecurityIdentifiers.keySet()); String securityIdentifier = andSecurityIdentifiers.get(andLevelIndex); AuthHandler handler = SwaggerAuthHandlerFactory.this.getAuthHandler(securityIdentifier); if (handler != null) { context.put(SwaggerRouter.AUTH_PROVIDER_NAME_HEADER_KEY, securityIdentifier); handler.addAuthorities(this.authorities).handle(context); } else { context.fail(401); } } else { context.fail(401); } }