Skip to content

Commit

Permalink
Merge branch 'hotfix/lint' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Feb 26, 2016
2 parents f4d9b8a + 82f12a2 commit c35b4bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/plugins/basic-auth/access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("Authentication Plugin", function()
end)

it("should pass the right headers to the upstream server", function()
local response, status = http_client.get(PROXY_URL.."/headers", {}, {host = "basicauth.com", authorization = "hello", ["authorization"] = "Basic dXNlcm5hbWU6cGFzc3dvcmQ="})
local response, status = http_client.get(PROXY_URL.."/headers", {}, {host = "basicauth.com", ["authorization"] = "Basic dXNlcm5hbWU6cGFzc3dvcmQ="})
assert.equal(200, status)
local parsed_response = cjson.decode(response)
assert.truthy(parsed_response.headers["X-Consumer-Id"])
Expand Down
10 changes: 5 additions & 5 deletions spec/plugins/oauth2/access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local STUB_GET_URL = spec_helper.STUB_GET_URL
local STUB_POST_URL = spec_helper.STUB_POST_URL

local function provision_code()
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = cjson.decode(response)
local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?code=([\\w]{32,32})&state=hello$")
local code
Expand Down Expand Up @@ -237,7 +237,7 @@ describe("Authentication Plugin", function()
end)

it("should return success and store authenticated user properties", function()
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = cjson.decode(response)
assert.are.equal(200, status)
assert.are.equal(1, utils.table_size(body))
Expand All @@ -257,7 +257,7 @@ describe("Authentication Plugin", function()
end)

it("should return success with a dotted scope and store authenticated user properties", function()
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "user.email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "user.email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = cjson.decode(response)
assert.are.equal(200, status)
assert.are.equal(1, utils.table_size(body))
Expand Down Expand Up @@ -301,7 +301,7 @@ describe("Authentication Plugin", function()
end)

it("should return success and store authenticated user properties", function()
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response, status = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = cjson.decode(response)
assert.are.equal(200, status)
assert.are.equal(1, utils.table_size(body))
Expand All @@ -325,7 +325,7 @@ describe("Authentication Plugin", function()
end)

it("should return set the right upstream headers", function()
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = "clientid123", scope = "email profile", response_type = "token", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = cjson.decode(response)

local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?access_token=([\\w]{32,32})&token_type=bearer$")
Expand Down
2 changes: 1 addition & 1 deletion spec/plugins/oauth2/hooks_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("OAuth2 Authentication Hooks", function()
end)

local function provision_code(client_id)
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", authenticated_userid = "id123", client_id = client_id, scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local response = http_client.post(PROXY_SSL_URL.."/oauth2/authorize", { provision_key = "provision123", client_id = client_id, scope = "email", response_type = "code", state = "hello", authenticated_userid = "userid123" }, {host = "oauth2.com"})
local body = json.decode(response)
if body.redirect_uri then
local matches = rex.gmatch(body.redirect_uri, "^http://google\\.com/kong\\?code=([\\w]{32,32})&state=hello$")
Expand Down

0 comments on commit c35b4bf

Please sign in to comment.