-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: Relaxed OpenApi authorizer definition #5182
Conversation
@@ -152,9 +152,9 @@ def get_authorizers(self, event_type: str = Route.API) -> Dict[str, Authorizer]: | |||
auth_name, | |||
) | |||
|
|||
if not identity_sources: | |||
if not identity_sources and authorizer_type == LambdaAuthorizer.TOKEN: |
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.
can you add a comment to explain this condition
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 Lucas, it looks good to me. Just left a small comment.
…li into relax_auth_validation
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.
LGTM
Which issue(s) does this change fix?
N/A
Why is this change necessary?
Request based authorizers can have no identity sources defined if caching is disabled. We don't check for caching, but we can make the change to allow empty identity sources.
Additionally, the root level authorizer check was incorrectly written to not apply to Rest Apis, however this is not the case.
How does it address the issue?
Relaxes the check only for request based authorizers to allow empty identity sources. Also updates the validation to accept root default authorizers for Rest Apis when using the 3.x version specification.
What side effects does this change have?
None.
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.