From dd374307bfe220485892c3fc52e6c28059f37d4e Mon Sep 17 00:00:00 2001 From: windmgc Date: Wed, 13 Sep 2023 11:06:19 +0800 Subject: [PATCH 1/2] fix(signature): none-signature(unsigned) should support network related config options as well --- src/resty/aws/request/signatures/none.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/resty/aws/request/signatures/none.lua b/src/resty/aws/request/signatures/none.lua index 29f7d85..32a5428 100644 --- a/src/resty/aws/request/signatures/none.lua +++ b/src/resty/aws/request/signatures/none.lua @@ -21,12 +21,21 @@ -- tbl.global_endpoint: if true, then use "us-east-1" as signing region and different -- hostname template: see https://github.com/aws/aws-sdk-js/blob/ae07e498e77000e55da70b20996dc8fd2f8b3051/lib/region_config_data.json local function prepare_request(config, request_data) - local tls = config.tls local host = request_data.host local port = request_data.port local timestamp = ngx.time() local req_date = os.date("!%Y%m%dT%H%M%SZ", timestamp) + local timeout = config.timeout + local keepalive_idle_timeout = config.keepalive_idle_timeout + local tls = config.tls + local ssl_verify = config.ssl_verify + local proxy_opts = { + http_proxy = config.http_proxy, + https_proxy = config.https_proxy, + no_proxy = config.no_proxy, + } + local headers = { ["X-Amz-Date"] = req_date, ["Host"] = host, @@ -39,7 +48,11 @@ local function prepare_request(config, request_data) --url = url, -- "https://lambda.us-east-1.amazon.com:443/some/path?query1=val1" host = host, -- "lambda.us-east-1.amazon.com" port = port, -- 443 + timeout = timeout, -- 60000 + keepalive_idle_timeout = keepalive_idle_timeout, -- 60000 tls = tls, -- true + ssl_verify = ssl_verify, -- true + proxy_opts = proxy_opts, -- table path = request_data.path, -- "/some/path" method = request_data.method, -- "GET" query = request_data.query, -- "query1=val1" From ff4983ed7f309f640d9ff11aa073f1c611929c1b Mon Sep 17 00:00:00 2001 From: windmgc Date: Wed, 13 Sep 2023 11:08:41 +0800 Subject: [PATCH 2/2] add changelog --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index ae4caec..0e45777 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,11 @@ Release process: 1. upload using: `VERSION=x.y.z APIKEY=abc... make upload` 1. test installing the rock from LuaRocks +### Unreleased + +- fix: unsigned request should support network related config option + [79](https://github.com/Kong/lua-resty-aws/pull/79) + ### 1.3.1 (17-Aug-2023) - fix: fix v4 signing request should correctly canonicalized query table as well