You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the changes in #980 and have brought back #273 and #274
Essentially, when serverless-offline authorizer is running, it is using a methodArn that looks like: /user/{pathParam}
Based on API Gateway authorizer behavior, the methodArn in the authorizer should replace path parameters with their values injected, such as: /user/123
While request.path replaces path parameter placeholders with values, the request.route.path does not. Unfortunately I am not sure how to solve this without bringing back #980, but if anyone has suggestions I can create a PR.
Nice catch, @sahandseifi! The API Gateway conventions are very confusing to understand and unfortunately this project does not have a nice test suite around these fields. (I believe there are no tests for authorizer context at all).
I'm not sure what is the best path there. Perhaps we could start by writing one integration test which validates all the fields in an authorizer event and context, based on a real invocation. This way, we will be able to identify this and many more other issues.
I'm really sorry of unintentionally breaking this with my PR
zoellner
added a commit
to BrightCrowd/serverless-offline
that referenced
this issue
Oct 7, 2021
Hey there,
I believe the changes in #980 and have brought back #273 and #274
Essentially, when serverless-offline authorizer is running, it is using a methodArn that looks like:
/user/{pathParam}
Based on API Gateway authorizer behavior, the methodArn in the authorizer should replace path parameters with their values injected, such as:
/user/123
I believe the issue to be originating from this line:
5ff81fb#diff-cc0b2fc7c5601d386cac620be80b0f54R47
While
request.path
replaces path parameter placeholders with values, therequest.route.path
does not. Unfortunately I am not sure how to solve this without bringing back #980, but if anyone has suggestions I can create a PR.serverless-offline: 6.4.0
serverless: 1.73.1
npm: 6.14.5
The text was updated successfully, but these errors were encountered: