From 02a2e049b01224f55250fc6738badc312874b250 Mon Sep 17 00:00:00 2001 From: Christian Sakshaug Date: Thu, 12 Sep 2019 19:01:37 +0200 Subject: [PATCH 1/3] Update README_Cognito_UserPools_PreTokenGen.md (#230) Fix typos --- events/README_Cognito_UserPools_PreTokenGen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/README_Cognito_UserPools_PreTokenGen.md b/events/README_Cognito_UserPools_PreTokenGen.md index eddfcb4e..1cbbaf45 100644 --- a/events/README_Cognito_UserPools_PreTokenGen.md +++ b/events/README_Cognito_UserPools_PreTokenGen.md @@ -16,7 +16,7 @@ import ( func handler(event events.CognitoEventUserPoolsPreTokenGen) (events.CognitoEventUserPoolsPreTokenGen, error) { fmt.Printf("PreTokenGen of user: %s\n", event.UserName) - event.Response.ClaimOverrideDetails.ClaimsToSupress = []string{"family_name"} + event.Response.ClaimsOverrideDetails.ClaimsToSuppress = []string{"family_name"} return event, nil } From 1a58586f6654faed9b53a689ffd76b65dadd3cb3 Mon Sep 17 00:00:00 2001 From: Nick Hibberd Date: Wed, 18 Sep 2019 06:49:21 -0700 Subject: [PATCH 2/3] Add missing 'apiKeyId' to APIGatewayRequestIdentity (#235) * Add missing 'apiKeyId' to APIGatewayRequestIdentity * Update apigw tests with 'apiKeyId' --- events/apigw.go | 1 + events/testdata/apigw-request.json | 5 +++-- events/testdata/apigw-restapi-openapi-request.json | 1 + events/testdata/apigw-websocket-request.json | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/events/apigw.go b/events/apigw.go index 6ed7fe2e..32da810f 100644 --- a/events/apigw.go +++ b/events/apigw.go @@ -49,6 +49,7 @@ type APIGatewayRequestIdentity struct { CognitoIdentityID string `json:"cognitoIdentityId"` Caller string `json:"caller"` APIKey string `json:"apiKey"` + APIKeyID string `json:"apiKeyId"` AccessKey string `json:"accessKey"` SourceIP string `json:"sourceIp"` CognitoAuthenticationType string `json:"cognitoAuthenticationType"` diff --git a/events/testdata/apigw-request.json b/events/testdata/apigw-request.json index 3c5a5c6e..8eac098b 100644 --- a/events/testdata/apigw-request.json +++ b/events/testdata/apigw-request.json @@ -1,4 +1,4 @@ -{ +{ "resource": "/{proxy+}", "path": "/hello/world", "httpMethod": "POST", @@ -67,6 +67,7 @@ "cognitoIdentityId": "theCognitoIdentityId", "caller": "theCaller", "apiKey": "theApiKey", + "apiKeyId": "theApiKeyId", "accessKey": "ANEXAMPLEOFACCESSKEY", "sourceIp": "192.168.196.186", "cognitoAuthenticationType": "theCognitoAuthenticationType", @@ -79,7 +80,7 @@ "principalId": "admin", "clientId": 1, "clientName": "Exata" - }, + }, "resourcePath": "/{proxy+}", "httpMethod": "POST", "apiId": "gy415nuibc" diff --git a/events/testdata/apigw-restapi-openapi-request.json b/events/testdata/apigw-restapi-openapi-request.json index c7a8990c..ee4fad00 100644 --- a/events/testdata/apigw-restapi-openapi-request.json +++ b/events/testdata/apigw-restapi-openapi-request.json @@ -68,6 +68,7 @@ "cognitoIdentityId": "theCognitoIdentityId", "caller": "theCaller", "apiKey": "theApiKey", + "apiKeyId": "theApiKeyId", "accessKey": "ANEXAMPLEOFACCESSKEY", "sourceIp": "192.168.196.186", "cognitoAuthenticationType": "theCognitoAuthenticationType", diff --git a/events/testdata/apigw-websocket-request.json b/events/testdata/apigw-websocket-request.json index 821ffc66..21217a57 100644 --- a/events/testdata/apigw-websocket-request.json +++ b/events/testdata/apigw-websocket-request.json @@ -72,6 +72,7 @@ "cognitoIdentityId": "theCognitoIdentityId", "caller": "theCaller", "apiKey": "theApiKey", + "apiKeyId": "theApiKeyId", "accessKey": "ANEXAMPLEOFACCESSKEY", "sourceIp": "192.168.196.186", "cognitoAuthenticationType": "theCognitoAuthenticationType", From 319e4b3ab8047c2a516df884bcb8f579a153f7cd Mon Sep 17 00:00:00 2001 From: Diego Bernardes Date: Wed, 9 Oct 2019 22:13:56 +0100 Subject: [PATCH 3/3] Enable race detection at tests (#239) --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9bcff110..25cd5987 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,10 +27,10 @@ before_script: - LINT_PKGS=$(go list ./... | grep -Ev 'aws-lambda-go/lambda') script: - - diff -u <(echo -n) <(gofmt -d ./) # Fail if a .go file hasn't been formatted with gofmt - - goverage -v -covermode=atomic -coverprofile=coverage.txt $PKGS # Run all tests with coverage - - go vet -v ./... # static analyisis - - golint $LINT_PKGS # lint - ignore failures for now + - diff -u <(echo -n) <(gofmt -d ./) # Fail if a .go file hasn't been formatted with gofmt + - goverage -v -race -covermode=atomic -coverprofile=coverage.txt $PKGS # Run all tests with coverage + - go vet -v ./... # static analyisis + - golint $LINT_PKGS # lint - ignore failures for now after_success: - bash <(curl -s https://codecov.io/bash)