diff --git a/src/main/java/net/frozenorb/apiv3/handler/WebsiteUserSessionHandler.java b/src/main/java/net/frozenorb/apiv3/handler/WebsiteUserSessionHandler.java index f7176d8..9579730 100644 --- a/src/main/java/net/frozenorb/apiv3/handler/WebsiteUserSessionHandler.java +++ b/src/main/java/net/frozenorb/apiv3/handler/WebsiteUserSessionHandler.java @@ -4,11 +4,13 @@ import com.google.common.collect.ImmutableMap; import io.vertx.core.Handler; import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.RoutingContext; +import lombok.extern.slf4j.Slf4j; import net.frozenorb.apiv3.actor.Actor; import net.frozenorb.apiv3.actor.ActorType; import net.frozenorb.apiv3.util.ErrorUtils; import net.frozenorb.apiv3.util.UserSessionUtils; +@Slf4j public final class WebsiteUserSessionHandler implements Handler { @Override @@ -46,21 +48,44 @@ public final class WebsiteUserSessionHandler implements Handler HttpMethod method = ctx.request().method(); String path = ctx.request().path().toLowerCase(); + /* + http.get("/emailTokens/:emailToken/owner").blockingHandler(new GETEmailTokensIdOwner(), false); + http.get("/ranks/:rankId").handler(new GETRanksId()); + http.get("/serverGroups/:serverGroupId").handler(new GETServerGroupsId()); + http.get("/servers/:serverId").handler(new GETServersId()); + http.get("/dumps/:dumpType").handler(new GETDumpsType()); + http.get("/users/:userId").handler(new GETUsersId()); + http.get("/users/:userId/compoundedPermissions").handler(new GETUsersIdCompoundedPermissions()); + http.get("/users/:userId/details").blockingHandler(new GETUsersIdDetails(), false); + http.get("/users/:userId/requiresTotp").handler(new GETUsersIdRequiresTotp()); + http.get("/users/:userId/verifyPassword").blockingHandler(new GETUsersIdVerifyPassword(), false); + + http.post("/users/:userId/changePassword").blockingHandler(new POSTUsersIdChangePassword(), false); + http.post("/users/:userId/passwordReset").blockingHandler(new POSTUsersIdPasswordReset(), false); + http.post("/users/:userId/verifyTotp").handler(new POSTUsersIdVerifyTotp()); + http.post("/logout").handler(new POSTLogout()); + http.post("/emailTokens/:emailToken/confirm").blockingHandler(new POSTEmailTokensIdConfirm(), false); + */ + /*if (method == HttpMethod.GET) { switch (path) { - case "/grants": + case "/ranks": + case "/metrics": + case "/staff": case "/servers": case "/servergroups": case "/whoami": return false; } - if (path.contains("/dumps")) { - return false; + for (String allowedRoutes : new String[] { "/emailTokens", "/ranks", "/serverGroups", "/servers", "/dumps", "/users" }) { + if (path.contains(allowedRoutes)) { + return false; + } } } else if (method == HttpMethod.POST) { switch (path) { - case "/grants": + case "/logout": return false; } }*/