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
Add filter for cognito identity fields #6005
Conversation
@@ -108,6 +108,9 @@ | |||
# CWD folder of handler code in Lambda containers | |||
DOCKER_TASK_FOLDER = "/var/task" | |||
|
|||
# TODO remove once clarification of apigateway contexts is complete. Really bad hack!! |
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.
It's a good bad hack in the meantime though 😄
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.
Will leave the approval to the others, but from my side I don't see an issue with having it in there as a temporary fix 👍
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.
I think it's an ok fix, the request context that is being to the event is being wrongly passed to the context of the lambda. I'll create an issue to complete the fix, by correctly passing the necessary information to build the content object.
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.
Great catch and nice fix @dfangl ! 👍
5dec774
to
a1daa62
Compare
Due to a lot of lambda integrations tested in there, I added test_apigateway.py to the tests executed for different lambda executors (new test is also in there). At some point we have to find a solution for this which scales better (pytest marks, decide on used fixtures etc). |
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 👍
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 🚀
9fc7702
to
2b4e9c2
Compare
This PR adds a hacky filter, to the cognito_identity field of the lambda context. This will only allow correct values to be passed into it.
Once a real fix is available (by rethinking and redoing the
localstack.services.apigateway.apigateway_listener.invoke_rest_api_integration_backend
andlocalstack.services.apigateway.helpers.get_event_request_context
methods @whummer @calvernaz ) so that this part:does not show up in the cognito_identity part of the lambda context, this PR should be reverted.
Until then, it will only allow
"cognitoIdentityId"
and"cognitoIdentityPoolId"
as directory keys for cognito_identity.This should help fixing #5783 .
Test for apigateway - rust lambda integration added to prevent further regressions.