Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

deps(resty-http) test branch to bump to resty-http master branch #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ servroot
*.rock
# exclude Pongo shell history
.pongo/.ash_history
lua-resty-http
15 changes: 15 additions & 0 deletions .pongo/pongo-setup-host.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# this runs on the host, before the Kong container is started


if pushd lua-resty-http > /dev/null; then
git checkout master
git pull

else
git clone https://github.com/ledgetech/lua-resty-http.git || exit 1
pushd lua-resty-http > /dev/null
fi

popd > /dev/null
11 changes: 11 additions & 0 deletions .pongo/pongo-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this runs inside the Kong container when it starts

luarocks remove kong-plugin-aws-lambda --force

# install pre-fetched private dependencies
cd /kong-plugin/lua-resty-http
luarocks remove lua-resty-http --force
luarocks make

# install public dependencies
find /kong-plugin -maxdepth 1 -type f -name '*.rockspec' -exec luarocks install --only-deps {} \;
1 change: 0 additions & 1 deletion kong-plugin-aws-lambda-3.5.2-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ build = {
["kong.plugins.aws-lambda.iam-ecs-credentials"] = "kong/plugins/aws-lambda/iam-ecs-credentials.lua",
["kong.plugins.aws-lambda.schema"] = "kong/plugins/aws-lambda/schema.lua",
["kong.plugins.aws-lambda.v4"] = "kong/plugins/aws-lambda/v4.lua",
["kong.plugins.aws-lambda.http.connect-better"] = "kong/plugins/aws-lambda/http/connect-better.lua",
["kong.plugins.aws-lambda.request-util"] = "kong/plugins/aws-lambda/request-util.lua",
}
}
12 changes: 6 additions & 6 deletions kong/plugins/aws-lambda/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

local aws_v4 = require "kong.plugins.aws-lambda.v4"
local aws_serializer = require "kong.plugins.aws-lambda.aws-serializer"
local http = require "kong.plugins.aws-lambda.http.connect-better"
local http = require "resty.http"
local cjson = require "cjson.safe"
local meta = require "kong.meta"
local constants = require "kong.constants"
Expand Down Expand Up @@ -230,14 +230,14 @@ function AWSLambdaHandler:access(conf)
local kong_wait_time_start = get_now()

local ok
ok, err = client:connect_better {
ok, err = client:connect {
scheme = "https",
host = host,
port = port,
ssl = { verify = false },
proxy = conf.proxy_url and {
uri = conf.proxy_url,
}
ssl_verify = false,
proxy_opts = conf.proxy_url and {
https_proxy = conf.proxy_url,
} or nil
}
if not ok then
kong.log.err(err)
Expand Down
213 changes: 0 additions & 213 deletions kong/plugins/aws-lambda/http/connect-better.lua

This file was deleted.

24 changes: 11 additions & 13 deletions spec/plugins/aws-lambda/50-http-proxy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@ local max_idle_timeout = 3
local function make_request(http, config)
-- create and connect the client
local client = http.new()
local ok, err = client:connect_better {
local ok, err = client:connect {
scheme = config.scheme,
host = config.host,
port = config.scheme == "https" and 443 or 80,
ssl = config.scheme == "https" and {
server_name = config.host,
verify = false,
},
proxy = config.proxy_url and {
uri = config.proxy_url,
authorization = config.authorization,
}
ssl_verify = false,
ssl_server_name = config.host,
proxy_opts = config.proxy_url and {
https_proxy = config.proxy_url,
https_proxy_authorization = config.authorization,
} or nil
}
assert.is_nil(err)
assert.truthy(ok)
Expand Down Expand Up @@ -105,8 +103,8 @@ describe("#proxy #squid", function()

local http
before_each(function()
package.loaded["kong.plugins.aws-lambda.http.connect-better"] = nil
http = require "kong.plugins.aws-lambda.http.connect-better"
package.loaded["resty.http"] = nil
http = require "resty.http"
end)

lazy_teardown(function()
Expand All @@ -127,8 +125,8 @@ describe("#keepalive #squid", function()

local http
before_each(function()
package.loaded["kong.plugins.aws-lambda.http.connect-better"] = nil
http = require "kong.plugins.aws-lambda.http.connect-better"
package.loaded["resty.http"] = nil
http = require "resty.http"
end)

lazy_teardown(function()
Expand Down