Skip to content

Conversation

@HVKukkonen
Copy link
Contributor

Issue #, if available: None

Description of changes:
Fixes typing issue with ApiGatewayV2CustomAuthorizerV2Request not allowing for None as the identity_source. I suspect this being an issue as per the docs

When caching is turned off, it is not necessary to specify an identity source. API Gateway directly passes the request to the authorizer Lambda function.

Also, I have run into issues with this in the wild as not having the identity source in the API Gateway Terraform configuration results in DeserializeError { inner: Error { path: Path { segments: [Map { key: \"identitySource\" }] }, original: Error(\"invalid type: null, expected a sequence\" in my Authorizer code. And after specifying an arbitrary field from the API Gateway event as the identity source it worked fine.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@bnusunny
Copy link
Collaborator

Could you add a test to cover this case?

@HVKukkonen
Copy link
Contributor Author

Added. Of course, nothing guarantees that the fixture used exactly matches the event from the API Gateway but that's the same issue with all of the fixtures, right? 🥲

@bnusunny
Copy link
Collaborator

Could you fix the linting errors?

@bnusunny bnusunny merged commit aed8295 into aws:main Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants