-
Notifications
You must be signed in to change notification settings - Fork 29
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
Issue with AWS API Gateway signed requests in k6 tests #96
Comments
Hey @rgrygorovych, First of all, thanks so much for bringing this topic! 🙏🏻
Looking at the line of code you pointed out, and comparing it to the one you provided, I suspect the problem, in your case, is that the original value of the If so, can you confirm that the header value ( In such case, I'm wondering whether would make sense to slightly modify the current code to only set the value of So, something like: if (!request.headers[constants.HOST_HEADER]) {
request.headers[constants.HOST_HEADER] = request.endpoint.hostname;
} Do you think that would make sense? Could you verify that would work in your case? Thanks! 🙇🏻 |
Out of the blue with my "cache" cold, I think the solution you proposed @joanlopez makes sense indeed. I'd be interested in learning wether that addresses your problem indeed @rgrygorovych. For context the Furthermore, we adjusted it to use the I think we should be open to making changes to it indeed, but we should provide tests ensuring it passes the signature test suite (also ported from the initial AWS implementation), because the |
Hello @oleiade and @joanlopez here is more details related to this, hope you find it helpful. Context: The team is working on accessing API endpoints that require a signature through a VPC endpoint. The following log outputs illustrate the issue and the suggested change:
Another execution with the proposed change:
Summary: Requests were failing before the change but succeeded after the change was applied. We were inspired by the following reference materials:
|
Great! Thanks for such a detailed summary @rgrygorovych! Do you want to open the pull request with the change agreed? I think you did the hard work, so you definitely deserve the credits for that contribution! 🙇🏻 |
sure, just need permissions :). |
Can you fork it and create the PR from your own fork, please? 🙏🏻 |
Here is link #97 |
Dear Team,
We are currently working on integrating k6 tests with our private AWS API Gateway. While doing so, we encountered an issue with performing signed requests using k6 internal libraries.
After some investigation, we found a workaround by modifying the signature implementation in the
signature.ts
file. Specifically, we changed the request header to accommodate a different hostname value compared to the host value in the header.The original line in
signature.ts
:was replaced with:
This change allowed us to successfully perform requests from the open-source k6 tool to our API. Currently, we have forked the k6-jslib-aws repository. However, we would like to seek clarification on whether this modification indicates an issue in the implementation. Should the change be made on your end, or is there something we may be doing incorrectly on our side?
Your guidance on this matter would be greatly appreciated.
The text was updated successfully, but these errors were encountered: