Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(signature): none-signature(unsigned) should support network related config options as well #79

Merged
merged 2 commits into from
Sep 13, 2023
Merged
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion src/resty/aws/request/signatures/none.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand Down
Loading