Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiGatewayV2CustomAuthorizerV2Request identity_source as optional #860

Merged
merged 3 commits into from
Apr 22, 2024
Merged

ApiGatewayV2CustomAuthorizerV2Request identity_source as optional #860

merged 3 commits into from
Apr 22, 2024

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
Contributor

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
Contributor

Could you fix the linting errors?

@bnusunny bnusunny merged commit aed8295 into awslabs:main Apr 22, 2024
5 checks passed
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