package cz.senslog.analytics.server.ws;

import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.ext.auth.User;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.handler.impl.AuthenticationHandlerInternal;

public final class DisableAuthorizationHandler implements AuthenticationHandlerInternal {


    public static DisableAuthorizationHandler create() {
        return new DisableAuthorizationHandler();
    }

    private DisableAuthorizationHandler() {}

    @Override
    public void authenticate(RoutingContext routingContext, Handler<AsyncResult<User>> handler) {
        handler.handle(Future.succeededFuture());
    }

    @Override
    public void handle(RoutingContext routingContext) {
        routingContext.next();
    }

}
