Skip to content

Commit 4616da0

Browse files
authored
Merge pull request #41 from LEGO/feat/canary-integration
feat: will now work with canary-release plugin
2 parents 8579607 + cb43007 commit 4616da0

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Readme.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
This plugin will sign a request with AWS SIGV4 and temporary credentials from `sts.amazonaws.com` requested using an OAuth token.
88

9-
It enables the secure use of AWS Lambdas as upstreams in Kong using [Lambda URLs](https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/).
9+
The AWS SIGV4 signature enables secure proxying directly towards AWS services such as [Lambda URLs](https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/).
1010

1111
At the same time it drives down cost and complexity by excluding the AWS API Gateway and allowing to use AWS Lambdas directly.
1212

1313
The required AWS setup to make the plugin work with your Lambda HTTPS endpoint is described below.
1414

15+
Note that this plugin cannot be used in combination with Kong [upstreams](https://docs.konghq.com/gateway/latest/get-started/load-balancing/).
16+
1517
## Plugin configuration parameters
1618

1719
```lua
@@ -31,7 +33,7 @@ aws_service - AWS Service you are trying to access (lambda and s3 were tested)
3133
type = "string"
3234
required = true
3335

34-
override_target_host - To be used when deploying multiple lambdas on a single Kong service (because lambdas have differennt URLs)
36+
override_target_host - To be used when deploying multiple lambdas on a single Kong service (because lambdas have different URLs)
3537
type = "string"
3638
required = false
3739

@@ -111,8 +113,8 @@ plugins:
111113
112114
## Signing requests containing a body
113115
114-
In case of requests contanining a body, the plugin is highly reliant on the nginx configuration, because it neets to access the body to sign it.
115-
The behaviour is controlled by the following Kong configuration parameters:
116+
In case of requests containing a body, the plugin is highly reliant on the nginx configuration, because it needs to access the body to sign it.
117+
The behavior is controlled by the following Kong configuration parameters:
116118
117119
```text
118120
nginx_http_client_max_body_size
@@ -135,7 +137,7 @@ The default value for max body size is `0`, which means unlimited, so consider s
135137
</details>
136138

137139
2. Your OpenID Connect provider is added to [AWS IAM](https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-east-1#/identity_providers)
138-
3. You have a role with `arn:aws:iam::aws:policy/AWSLambda_FullAccess` and/or `arn:aws:iam::aws:policy/AmazonS3FullAccess` permision (or any other permision that grants access to your desired AWS service ) and the trust relationship below:
140+
3. You have a role with `arn:aws:iam::aws:policy/AWSLambda_FullAccess` and/or `arn:aws:iam::aws:policy/AmazonS3FullAccess` permission (or any other permission that grants access to your desired AWS service ) and the trust relationship below:
139141

140142
<details>
141143
<summary>Show JSON</summary>

kong-aws-request-signing-1.0.5-3.rockspec renamed to kong-aws-request-signing-1.0.6-3.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local plugin_name = "aws-request-signing"
22
local package_name = "kong-" .. plugin_name
3-
local package_version = "1.0.5"
3+
local package_version = "1.0.6"
44
local rockspec_revision = "3"
55

66
local github_account_name = "LEGO"

kong/plugins/aws-request-signing/handler.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ end
103103
function AWSLambdaSTS:access(conf)
104104
local service = kong.router.get_service()
105105
local request_headers = kong.request.get_headers()
106-
local final_host = conf.override_target_host or service.host
106+
local final_host = conf.override_target_host or ngx.ctx.balancer_data.host
107107

108108
if service == nil then
109109
kong.log.err("Unable to retrieve bound service!")
@@ -188,7 +188,7 @@ function AWSLambdaSTS:access(conf)
188188
kong.service.request.set_raw_query(signed_request.query)
189189
end
190190

191-
AWSLambdaSTS.PRIORITY = 110
192-
AWSLambdaSTS.VERSION = "1.0.5"
191+
AWSLambdaSTS.PRIORITY = 15
192+
AWSLambdaSTS.VERSION = "1.0.6"
193193

194194
return AWSLambdaSTS

0 commit comments

Comments
 (0)