From 2ff3883fd2d56b019fea196e705374233a61ffb1 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Wed, 28 Oct 2015 18:05:19 -0700 Subject: [PATCH] Revert "Allow PATCH method on jwt credential endpoint" --- kong/plugins/jwt/api.lua | 4 ---- spec/plugins/jwt/api_spec.lua | 8 +++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/kong/plugins/jwt/api.lua b/kong/plugins/jwt/api.lua index df5dccc5f4ea..e0bb3ea6075b 100644 --- a/kong/plugins/jwt/api.lua +++ b/kong/plugins/jwt/api.lua @@ -40,10 +40,6 @@ return { return helpers.responses.send_HTTP_OK(self.credential) end, - PATCH = function(self, dao_factory) - crud.patch(self.params, self.credential, dao_factory.jwt_secrets) - end, - DELETE = function(self, dao_factory) crud.delete(self.credential, dao_factory.jwt_secrets) end diff --git a/spec/plugins/jwt/api_spec.lua b/spec/plugins/jwt/api_spec.lua index 7115612256e7..f8802bf72be6 100644 --- a/spec/plugins/jwt/api_spec.lua +++ b/spec/plugins/jwt/api_spec.lua @@ -94,11 +94,9 @@ describe("JWT API", function() describe("PATCH", function() - it("[SUCCESS] should update a credential", function() - local response, status = http_client.patch(BASE_URL..jwt_secret.id, {key = "alice",secret = "newsecret"}) - assert.equal(200, status) - jwt_secret = json.decode(response) - assert.equal("newsecret", jwt_secret.secret) + it("[SUCCESS] should not be supported", function() + local _, status = http_client.patch(BASE_URL..jwt_secret.id, {key = "alice"}) + assert.equal(405, status) end) end)