Skip to content

Commit 7dc8e47

Browse files
committed
deps(resty-luasocket) switch to resty-luasocket for compat code
The previously bundled compatibility code landed in a new module `lua-resty-luasocket`.
1 parent 0f48145 commit 7dc8e47

9 files changed

+8
-326
lines changed

lua-resty-aws-dev-1.rockspec.template

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ description = {
2525
dependencies = {
2626
"penlight ~> 1",
2727
"lua-resty-http >= 0.16",
28+
"lua-resty-luasocket ~> 1",
2829
}
2930

3031
build = {
@@ -37,8 +38,6 @@ build = {
3738
["resty.aws.request.build"] = "src/resty/aws/request/build.lua",
3839
["resty.aws.request.sign"] = "src/resty/aws/request/sign.lua",
3940
["resty.aws.request.execute"] = "src/resty/aws/request/execute.lua",
40-
["resty.aws.request.http.http"] = "src/resty/aws/request/http/http.lua",
41-
["resty.aws.request.http.socket"] = "src/resty/aws/request/http/socket.lua",
4241
["resty.aws.request.signatures.v4"] = "src/resty/aws/request/signatures/v4.lua",
4342
["resty.aws.request.signatures.none"] = "src/resty/aws/request/signatures/none.lua",
4443
["resty.aws.credentials.Credentials"] = "src/resty/aws/credentials/Credentials.lua",

spec/03-credentials/02-EC2MetadataCredentials_spec.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ describe("EC2MetadataCredentials", function()
4242
local EC2MetadataCredentials
4343

4444
setup(function()
45-
package.loaded["resty.aws.request.http.http"] = http
45+
package.loaded["resty.luasocket.http"] = http
4646
end)
4747

4848
teardown(function()
49-
package.loaded["resty.aws.request.http.http"] = nil
49+
package.loaded["resty.luasocket.http"] = nil
5050
end)
5151

5252
before_each(function()

spec/03-credentials/04-RemoteCredentials_spec.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe("RemoteCredentials", function()
4040
restore.setenv("AWS_CONTAINER_CREDENTIALS_FULL_URI", "https://localhost/test/path")
4141

4242
local _ = require("resty.aws.config").global -- load config before mocking http client
43-
package.loaded["resty.aws.request.http.http"] = http
43+
package.loaded["resty.luasocket.http"] = http
4444

4545
RemoteCredentials = require "resty.aws.credentials.RemoteCredentials"
4646
end)

src/resty/aws/credentials/EC2MetadataCredentials.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- EC2MetadataCredentials class.
22
-- @classmod EC2MetadataCredentials
33

4-
local http = require "resty.aws.request.http.http"
4+
local http = require "resty.luasocket.http"
55
local json = require("cjson.safe").new()
66
local log = ngx.log
77
local DEBUG = ngx.DEBUG

src/resty/aws/credentials/RemoteCredentials.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local DEBUG = ngx.DEBUG
1111
local DEFAULT_SERVICE_REQUEST_TIMEOUT = 5000
1212

1313
local url = require "socket.url"
14-
local http = require "resty.aws.request.http.http"
14+
local http = require "resty.luasocket.http"
1515
local json = require "cjson"
1616

1717

src/resty/aws/request/execute.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local http = require "resty.aws.request.http.http"
1+
local http = require "resty.luasocket.http"
22
local json_decode = require("cjson.safe").new().decode
33

44
-- TODO: retries and back-off: https://docs.aws.amazon.com/general/latest/gr/api-retries.html

src/resty/aws/request/http/http.lua

-24
This file was deleted.

src/resty/aws/request/http/socket.lua

-293
This file was deleted.

src/resty/aws/utils.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-- Provides methods for detecting the AWS Region, as well as fetching metadata.
44

55
local semaphore = require "ngx.semaphore"
6-
local http = require "resty.aws.request.http.http"
6+
local http = require "resty.luasocket.http"
77
local json = require "cjson"
88
local global_config = require("resty.aws.config").global
99

0 commit comments

Comments
 (0)