-
Notifications
You must be signed in to change notification settings - Fork 421
feat(data-classes): authorizer for http api and rest api #620
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
feat(data-classes): authorizer for http api and rest api #620
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #620 +/- ##
=========================================
Coverage 99.95% 99.95%
=========================================
Files 114 115 +1
Lines 4599 4828 +229
Branches 254 265 +11
=========================================
+ Hits 4597 4826 +229
Partials 2 2
Continue to review full report at Codecov.
|
@heitorlessa - do you know of any other sources for documentation on http api authorizers payload v2 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor suggested change on Authorizer Response class name for v2, and could you create a new section for HTTP API authorizers in the data class docs?
That will make it faster to release it tomorrow, pretty plz ;)
aws_lambda_powertools/utilities/data_classes/api_gateway_authorizer_event.py
Outdated
Show resolved
Hide resolved
@heitorlessa Done and added in a policy builder based on the blueprint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for making the other improvements. Two tiny changes to improve UX and we're good to go!
aws_lambda_powertools/utilities/data_classes/api_gateway_authorizer_event.py
Outdated
Show resolved
Hide resolved
APIGatewayAuthorizerResponse, | ||
HttpVerb, | ||
) | ||
from secrets import compare_digest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh shiny!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much Mike! I'm merging as-is, and fixing some typos and the allow/deny_all_routes
to take a method param w/ ALL by default.
Issue #, if available:
Description of changes:
Changes / TODO
Examples
Rest api example for a request type event and build iam policy with context info:
Rest api with a token request event and a simple allow all or deny all
Http api payload version 2 example of a http api authorizer checks it the Authorization header is "foo"
Http api payload version 2 A more complicated example getting the user details by an authorization header and setting the context
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.