From 472ce4b71ddd93ee1cae68dd13c90efb1926f73b Mon Sep 17 00:00:00 2001 From: windmgc Date: Mon, 13 May 2024 14:03:58 +0800 Subject: [PATCH 1/3] fix(aws-lambda): add missing version field into aws gateway compatible payload --- kong/plugins/aws-lambda/request-util.lua | 1 + spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/kong/plugins/aws-lambda/request-util.lua b/kong/plugins/aws-lambda/request-util.lua index 7a5f241824d6..3dd5b551c9b6 100644 --- a/kong/plugins/aws-lambda/request-util.lua +++ b/kong/plugins/aws-lambda/request-util.lua @@ -246,6 +246,7 @@ local function aws_serializer(ctx, config) end local request = { + version = "1.0", resource = ctx.router_matches.uri, path = path, httpMethod = var.request_method, diff --git a/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua b/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua index 35a8259394c6..0826f6ea9ad4 100644 --- a/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua +++ b/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua @@ -88,6 +88,7 @@ describe("[AWS Lambda] aws-gateway input", function() local out = aws_serialize() assert.same({ + version = "1.0", httpMethod = "GET", path = "/123/strip/more", resource = "/(?\\d+)/strip", @@ -165,6 +166,7 @@ describe("[AWS Lambda] aws-gateway input", function() local out = aws_serialize() assert.same({ + version = "1.0", httpMethod = "GET", path = "/plain/strip/more", resource = "/plain/strip", @@ -262,6 +264,7 @@ describe("[AWS Lambda] aws-gateway input", function() local out = aws_serialize() assert.same({ + version = "1.0", body = tdata.body_out, headers = { ["Content-Type"] = tdata.ct, From e8d43df6a4540a8cfd607bb481ac5ec36a3a6101 Mon Sep 17 00:00:00 2001 From: windmgc Date: Mon, 13 May 2024 14:48:31 +0800 Subject: [PATCH 2/3] docs(changelog): add changelog --- .../kong/fix-aws-lambda-gateway-compat-version-field.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml diff --git a/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml b/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml new file mode 100644 index 000000000000..f66baf905917 --- /dev/null +++ b/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml @@ -0,0 +1,3 @@ +message: "**AWS-Lambda**: fixed an issue that the `version` field is not set in the request payload when `awsgateway_compatible` is enabled" +type: bugfix +scope: Plugin From 73e4ce7afd76409c55977610c75bb990df40ad64 Mon Sep 17 00:00:00 2001 From: Keery Nie Date: Tue, 14 May 2024 15:59:07 +0800 Subject: [PATCH 3/3] Update changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml Co-authored-by: Yufu Zhao --- .../kong/fix-aws-lambda-gateway-compat-version-field.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml b/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml index f66baf905917..95dd88cfc824 100644 --- a/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml +++ b/changelog/unreleased/kong/fix-aws-lambda-gateway-compat-version-field.yml @@ -1,3 +1,3 @@ -message: "**AWS-Lambda**: fixed an issue that the `version` field is not set in the request payload when `awsgateway_compatible` is enabled" +message: "**AWS-Lambda**: Fixed an issue that the `version` field is not set in the request payload when `awsgateway_compatible` is enabled." type: bugfix scope: Plugin