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
ERRO[0000] S3ServiceError: There were headers present in the request which were not signed
running at value (webpack://k6-jslib-aws/./src/internal/s3.ts:289:16(55))
default at value (webpack://k6-jslib-aws/./src/internal/s3.ts:62:27(40))
at file:///Users/immavalls/Documents/grafana/github/k6-jslib-aws/examples/s3.js:23:20(3)
at native executor=per-vu-iterations scenario=default source=stacktrace
When following the s3 example, with the right credentials, it fails with the previous error.
The same example importing version 0.6.0 (before refactoring to support AWS signature v4 procedure, sign and pre-sign) works:
Thanks a lot for reporting this @immavalls 🤝 It concurs with something pointed out by #27.
The change was initially made to align with the official node sdk's test suite, but it seems I must have missed something indeed and would have been better off trusting the docs instead🤦🏻
As reported in https://community.k6.io/t/s3serviceerror-using-s3client/5586, version
0.7.0
seems to have introduced an error.When following the s3 example, with the right credentials, it fails with the previous error.
The same example importing version
0.6.0
(before refactoring to support AWS signature v4 procedure, sign and pre-sign) works:After some digging, it seems that we need to add the host header in https://github.com/grafana/k6-jslib-aws/blob/main/src/internal/signature.ts#L102.
And we need to fix the test https://github.com/grafana/k6-jslib-aws/blob/main/tests/internal/new_signature.js#L82 adding
delete request.hostname
. Otherwise, the request is adding thehost
in the headers.I've also spotted that we have
accessKeyId: this.awsConfig.accessKeyID
in https://github.com/grafana/k6-jslib-aws/blob/main/src/internal/s3.ts#L27, and it should beaccessKeyId: this.awsConfig.accessKeyId
. Otherwise, theAWS4-HMAC-SHA256 Credential
is missing theaccessKeyId
.The text was updated successfully, but these errors were encountered: