Address existing issues involving paths in S3 and Signature usages #104
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.
This Pull Request results from a debugging call with one of k6's users.
Problem
They were experiencing issues relating to:
Endpoint
type involved in the signature process is exposed by thesignature.js
bundle but not the overarchingaws.js
one.Solution
To address these issues, this PR applies the following changes:
S3Client
signer'suriEscapePath
attribute totrue
, to ensure paths are always double URI encoded in S3 paths.SignatureV4.sign
andSignatureV4.presign
operations ensure that a leading slash is appended to the target URL (if not present) when generating the resulting URL. That way we avoid potentially generating malformed URLs such ashttps://s3.amazonaws.commy-bucket/object-key
as we've seen happen.Endpoint
type from theindex.ts
entry point, making it available in theaws.js
bundle.Next steps
In order to unblock our user, I'll publish a
v0.12.1
once this is merged.