Skip to content

Commit 08cfa0b

Browse files
committed
Update to LambdaIDV2 to support dashboarding including x-forward-for header
1 parent 3af40c6 commit 08cfa0b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/cloudformation/geocore-stack.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4315,8 +4315,16 @@ Resources:
43154315
responseParameters:
43164316
method.response.header.Access-Control-Allow-Origin: "'*'"
43174317
requestTemplates:
4318-
application/json: "{\r\n \"lang\" : \"$input.params('lang')\",\r\n \
4319-
\ \"id\" : \"$input.params('id')\"\r\n}"
4318+
application/json: |
4319+
{
4320+
"lang": "$input.params('lang')",
4321+
"id": "$input.params('id')",
4322+
"ip_address": "$context.identity.sourceIp",
4323+
"ip_address_forward": "$input.params().header.get('X-Forwarded-For')",
4324+
"timestamp": "$context.requestTimeEpoch",
4325+
"user_agent": "$context.identity.userAgent",
4326+
"http_method": "$context.httpMethod"
4327+
}
43204328
passthroughBehavior: "when_no_templates"
43214329
contentHandling: "CONVERT_TO_TEXT"
43224330
options:

0 commit comments

Comments
 (0)