From b98dcd0a8383511bf010a6f5c8f3ae472a16cb1c Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Fri, 17 Jun 2016 19:17:50 -0400 Subject: [PATCH] Change /user/:id/verifyPassword from a GET to a POST (this will probably be undone later) --- src/main/java/net/frozenorb/apiv3/APIv3.java | 5 ++++- ...ETUserVerifyPassword.java => POSTUserVerifyPassword.java} | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) rename src/main/java/net/frozenorb/apiv3/route/users/{GETUserVerifyPassword.java => POSTUserVerifyPassword.java} (82%) diff --git a/src/main/java/net/frozenorb/apiv3/APIv3.java b/src/main/java/net/frozenorb/apiv3/APIv3.java index e8bfda5..9f205e0 100644 --- a/src/main/java/net/frozenorb/apiv3/APIv3.java +++ b/src/main/java/net/frozenorb/apiv3/APIv3.java @@ -43,6 +43,7 @@ import net.frozenorb.apiv3.route.auditLog.POSTUserAuditLogEntry; import net.frozenorb.apiv3.route.chatFilterList.GETChatFilterList; import net.frozenorb.apiv3.route.grants.*; import net.frozenorb.apiv3.route.ipBans.*; +import net.frozenorb.apiv3.route.ipIntel.GETIpIntel; import net.frozenorb.apiv3.route.ipLog.GETUserIpLog; import net.frozenorb.apiv3.route.notificationTemplates.DELETENotificationTemplate; import net.frozenorb.apiv3.route.notificationTemplates.GETNotificationTemplate; @@ -261,6 +262,8 @@ public final class APIv3 extends AbstractVerticle { mainRouter.post("/ip/:id/ipBan").blockingHandler(new POSTIpIpBan(), false); mainRouter.delete("/ipBan/:id").blockingHandler(new DELETEIpBan(), false); + mainRouter.get("/ip/:id/intel").handler(new GETIpIntel()); + mainRouter.get("/user/:id/ipLog").handler(new GETUserIpLog()); mainRouter.get("/notificationTemplate/:id").handler(new GETNotificationTemplate()); @@ -301,7 +304,7 @@ public final class APIv3 extends AbstractVerticle { mainRouter.get("/user/:id/meta/:serverGroup").blockingHandler(new GETUserMeta(), false); mainRouter.get("/user/:id/permissions").blockingHandler(new GETUserPermissions(), false); mainRouter.get("/user/:id/requiresTOTP").blockingHandler(new GETUserRequiresTOTP(), false); - mainRouter.get("/user/:id/verifyPassword").blockingHandler(new GETUserVerifyPassword(), false); + mainRouter.post("/user/:id/verifyPassword").blockingHandler(new POSTUserVerifyPassword(), false); mainRouter.post("/user/confirmRegister/:emailToken").blockingHandler(new POSTUserConfirmRegister(), false); mainRouter.post("/user/:id/leave").handler(new POSTUserLeave()); mainRouter.post("/user/:id/login").blockingHandler(new POSTUserLogin()); diff --git a/src/main/java/net/frozenorb/apiv3/route/users/GETUserVerifyPassword.java b/src/main/java/net/frozenorb/apiv3/route/users/POSTUserVerifyPassword.java similarity index 82% rename from src/main/java/net/frozenorb/apiv3/route/users/GETUserVerifyPassword.java rename to src/main/java/net/frozenorb/apiv3/route/users/POSTUserVerifyPassword.java index 5de1c1a..a609762 100644 --- a/src/main/java/net/frozenorb/apiv3/route/users/GETUserVerifyPassword.java +++ b/src/main/java/net/frozenorb/apiv3/route/users/POSTUserVerifyPassword.java @@ -7,7 +7,7 @@ import net.frozenorb.apiv3.APIv3; import net.frozenorb.apiv3.model.User; import net.frozenorb.apiv3.util.ErrorUtils; -public final class GETUserVerifyPassword implements Handler { +public final class POSTUserVerifyPassword implements Handler { public void handle(RoutingContext ctx) { User user = User.findByIdSync(ctx.request().getParam("id")); @@ -22,7 +22,7 @@ public final class GETUserVerifyPassword implements Handler { return; } - boolean authorized = user.checkPassword(ctx.request().getParam("password")); + boolean authorized = user.checkPassword(ctx.getBodyAsJson().getString("password")); APIv3.respondJson(ctx, ImmutableMap.of( "authorized", authorized