public DefaultSecuredPathBuilder(Route route) { this.route = route; this.pattern = route.getPathTemplate(); }
@Override public String[] getPermissions() { return route.getPermissions(); }
@Override public Boolean getAllowAnonymous() { return route.getAllowAnonymous(); }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled()) { sc.ignore(config.getTokenInfoEndpointPath()); routes.create() .handle(config.getTokenInfoEndpointPath(), this).disableCsrf().enableCors() .apply(); } }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled()) { sc.ignore(config.getTokenEndpointPath()); routes.create() .post(config.getTokenEndpointPath(), this) .disableCsrf().enableCors() .apply(); } }
protected String getNonApiRoutes(BeanFactory factory, Map<RequestMappingInfo, Object> mappings) { Routes routes = factory.getBean(RouteManager.class).createRoutes(); PathTemplateFactory ptf = factory.getBean(PathTemplateFactory.class); mappings.forEach((info, handler) -> { routes.add(mappingToRoute(ptf, info, handler)); }); DefaultRoutesPrinter printer = new DefaultRoutesPrinter(); printer.setPrintView(false); return routes.size() + " non-api routes (not at swagger.json) : \n\n" + printer.print(routes); }
protected void setApiExtension(RouteBuilder route, String name, Object value) { MApiExtension extension = route.getExtension(MApiExtension.class); if (null == extension) { extension = new MApiExtension(); route.setExtension(extension); } extension.setAttribute(name, value); }
@Override public Boolean getAllowClientOnly() { return route.getAllowClientOnly(); }
@Init private void init() { routesPrinter.setPrintView(false); }
@Override public String[] getRoles() { return route.getRoles(); }
@Override public Boolean getAllowRememberMe() { return route.getAllowRememberMe(); }
@Override public void startEndpoint(App app, Routes routes) throws Throwable { if(config.isSessionRefreshEnabled()) { sc.ignore(config.getSessionRefreshEndpointPath()); routes.create() .handle(config.getSessionRefreshEndpointPath(), this) .disableCsrf().enableCors() .apply(); } }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled()) { sc.ignore(config.getTokenEndpointPath()); routes.create() .post(config.getTokenEndpointPath(), this) .disableCsrf().enableCors() .apply(); } }
@Override public PathPattern getPattern() { return route.getPathTemplate(); }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled()) { sc.ignore(config.getTokenInfoEndpointPath()); routes.create() .handle(config.getTokenInfoEndpointPath(), this).disableCsrf().enableCors() .apply(); } }
@Override public PathPattern getPattern() { return route.getPathTemplate(); }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled() && config.isUserInfoEnabled()) { sc.ignore(config.getUserInfoEndpointPath()); routes.create() .handle(config.getUserInfoEndpointPath(), this ) .enableCors().disableCsrf() .apply(); } }
@Override public SecuredPathConfigurator get(Route route) { PathEntry pe = paths.get(route.getPathTemplate()); if (null == pe) { return null; } else { return pe.configurator; } }
@Override public void startEndpoint(App app, Routes routes) { if(config.isEnabled() && config.isUserInfoEnabled()) { sc.ignore(config.getUserInfoEndpointPath()); routes.create() .handle(config.getUserInfoEndpointPath(), this ) .enableCors().disableCsrf() .apply(); } }