Rename handlers to filters to better express functionality
This commit is contained in:
parent
a72f10618a
commit
641dccd06b
@ -37,10 +37,10 @@ import io.vertx.ext.web.handler.LoggerHandler;
|
||||
import io.vertx.ext.web.handler.TimeoutHandler;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.frozenorb.apiv3.handler.ActorAttributeHandler;
|
||||
import net.frozenorb.apiv3.handler.AuthorizationHandler;
|
||||
import net.frozenorb.apiv3.handler.MetricsHandler;
|
||||
import net.frozenorb.apiv3.handler.WebsiteUserSessionHandler;
|
||||
import net.frozenorb.apiv3.filter.AuthenticationFilter;
|
||||
import net.frozenorb.apiv3.filter.AuthorizationFilter;
|
||||
import net.frozenorb.apiv3.filter.MetricsFilter;
|
||||
import net.frozenorb.apiv3.filter.WebsiteUserSessionFilter;
|
||||
import net.frozenorb.apiv3.model.*;
|
||||
import net.frozenorb.apiv3.route.*;
|
||||
import net.frozenorb.apiv3.route.accessTokens.DELETEAccessTokensId;
|
||||
@ -301,10 +301,10 @@ public final class APIv3 extends AbstractVerticle {
|
||||
http.route().handler(LoggerHandler.create(LoggerFormat.TINY));
|
||||
http.route().handler(TimeoutHandler.create(TimeUnit.SECONDS.toMillis(5)));
|
||||
http.route().method(HttpMethod.PUT).method(HttpMethod.POST).method(HttpMethod.DELETE).handler(BodyHandler.create());
|
||||
http.route().handler(new ActorAttributeHandler());
|
||||
http.route().handler(new MetricsHandler());
|
||||
http.route().handler(new WebsiteUserSessionHandler());
|
||||
http.route().handler(new AuthorizationHandler());
|
||||
http.route().handler(new AuthenticationFilter());
|
||||
http.route().handler(new MetricsFilter());
|
||||
http.route().handler(new WebsiteUserSessionFilter());
|
||||
http.route().handler(new AuthorizationFilter());
|
||||
http.exceptionHandler(Throwable::printStackTrace);
|
||||
|
||||
// TODO: The commented out routes
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.frozenorb.apiv3.handler;
|
||||
package net.frozenorb.apiv3.filter;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import io.vertx.core.Handler;
|
||||
@ -8,7 +8,7 @@ import net.frozenorb.apiv3.actor.SimpleActor;
|
||||
import net.frozenorb.apiv3.model.AccessToken;
|
||||
import net.frozenorb.apiv3.util.ErrorUtils;
|
||||
|
||||
public final class ActorAttributeHandler implements Handler<RoutingContext> {
|
||||
public final class AuthenticationFilter implements Handler<RoutingContext> {
|
||||
|
||||
@Override
|
||||
public void handle(RoutingContext ctx) {
|
@ -1,4 +1,4 @@
|
||||
package net.frozenorb.apiv3.handler;
|
||||
package net.frozenorb.apiv3.filter;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import io.vertx.core.Handler;
|
||||
@ -6,7 +6,7 @@ import io.vertx.ext.web.RoutingContext;
|
||||
import net.frozenorb.apiv3.actor.Actor;
|
||||
import net.frozenorb.apiv3.util.ErrorUtils;
|
||||
|
||||
public final class AuthorizationHandler implements Handler<RoutingContext> {
|
||||
public final class AuthorizationFilter implements Handler<RoutingContext> {
|
||||
|
||||
@Override
|
||||
public void handle(RoutingContext ctx) {
|
@ -1,4 +1,4 @@
|
||||
package net.frozenorb.apiv3.handler;
|
||||
package net.frozenorb.apiv3.filter;
|
||||
|
||||
import io.vertx.core.Handler;
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
@ -6,7 +6,7 @@ import io.vertx.redis.RedisClient;
|
||||
import io.vertx.redis.RedisOptions;
|
||||
import net.frozenorb.apiv3.APIv3;
|
||||
|
||||
public final class MetricsHandler implements Handler<RoutingContext> {
|
||||
public final class MetricsFilter implements Handler<RoutingContext> {
|
||||
|
||||
private static final RedisClient redisClient = RedisClient.create(APIv3.getVertxInstance(),
|
||||
new RedisOptions()
|
@ -1,4 +1,4 @@
|
||||
package net.frozenorb.apiv3.handler;
|
||||
package net.frozenorb.apiv3.filter;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import io.vertx.core.Handler;
|
||||
@ -12,7 +12,7 @@ import net.frozenorb.apiv3.util.IpUtils;
|
||||
import net.frozenorb.apiv3.util.UserSessionUtils;
|
||||
|
||||
@Slf4j
|
||||
public final class WebsiteUserSessionHandler implements Handler<RoutingContext> {
|
||||
public final class WebsiteUserSessionFilter implements Handler<RoutingContext> {
|
||||
|
||||
@Override
|
||||
public void handle(RoutingContext ctx) {
|
Loading…
Reference in New Issue
Block a user