Fix websocket authorizers data located in wrong place #1360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move authorizer and identity data to requestContext in order to follow lambda proxy specs.
Description
This pull request fix a wrong identity and authorizer informations contained in the lambda event instead of requestContext object
Relates to #1379
Motivation and Context
This fix a wrong behaviour for lambda and websocket authorizers.
Authorizer and identity data should be inside requestContext object when used with lambda proxy (like serverless-offline does)
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html
In particular a reference to:
Also integrated changes from #1376 in order to adhere to AWS behaviour: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
How Has This Been Tested?
Detected the difference between AWS and serverless-offline
Reflect the changes in current websocket tests in order to catch the behaviour change
Screenshots (if appropriate):