Releases: grafana/k6-jslib-aws
v0.13.0
What's Changed
- Introduce more specific error kinds by @oleiade in #108
- Add support for downloading binary files using
S3Client.getObject
by @oleiade in #113 - Disregard
K6_DISCARD_RESPONSE_BODIES
by @oleiade in #114 - Introduce for
SQS.SendMessageBatch
by @lolleko in #101 - Fix unit test + cleanup by @KOConchobhair in #106
- Fix flaky s3
listbuckets
test by @oleiade in #112 - Update project's dependencies to latest compatible versions by @oleiade in #111
New Contributors
- @KOConchobhair made their first contribution in #106
- @lolleko made their first contribution in #101
Full Changelog: v0.12.3...v0.13.0
v0.12.3
Full Changelog: v0.12.2...v0.12.3
v0.12.2
This v0.12.2 release brings minor bug fixes to k6-jslib-aws 🚀
What Changed
- The
S3Client
methods will now useencoreURI
over the object key path as it signs requests. This ensures theS3Client
is compatible with object keys containing spaces and special symbol. - The
S3Client
underlying signatureV4 signer has been reverted to set theuriEscapePath
option tofalse
. After thoroughly reviewing the signature process documentation, S3 is indeed an exception in the AWS stack, and paths should not be double encoded. - The
dist/
folder has been excluded from source control to facilitate contributions, reviews, and merges.
Full Changelog: v0.12.1...v0.12.2
v0.12.1
This release brings minor bug fixes to k6-jslib-aws v0.12.0 🚀
What Changed
- The
S3Client
will now default its signer'suriEscapePath
attribute totrue
. This is to ensure paths are always double URI encoded in S3 paths, and special symbols and space characters are supported in object keys. - The
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 recently. - The
Endpoint
type is now also exposed by theaws.js
bundle file.
Full Changelog: v0.12.0...v0.12.1
v0.12.0
What's Changed
Features
- Added support for AWS Lambda by @nickcaballero in #76
- Added AWS Lambda Invoke method by @jakub-qg in #71
- Added support for aws session token in sms and kms clients by @jing-emma in #87
Fixes
- Improved the headers overwriting policy in the base client #96 by @rgrygorovych in #97
- Added length constraints to secretAccessKey by @egor-romanov in #98
Miscelaneous
- README improvements by @fczuardi in #68
- Refactored client classes to make their properties private and readonly by @oleiade in #79
- Add ESLint typescript configuration and address warnings in src folder by @oleiade in #81
- Update Webpack version by @joanlopez in #90
- Add GitHub Workflow to automate release generation by @joanlopez in #89
- Rename 'build' folder to 'dist' by @joanlopez in #92
- Update CONTRIBUTING.md with new docs link by @mstoykov in #99
New Contributors
- @fczuardi made their first contribution in #68
- @jakub-qg made their first contribution in #71
- @joanlopez made their first contribution in #88
- @jing-emma made their first contribution in #87
- @rgrygorovych made their first contribution in #97
- @egor-romanov made their first contribution in #98
- @mstoykov made their first contribution in #99
Full Changelog: v0.11.0...v0.12.0
v0.11.0
What's Changed
- Add support for attributes and delay seconds for SQS by @nickcaballero in #65
- Fixed #30, by adding a
params
argument to thes3.putObject
method, allowing to pass specific request parameters such ascontentDisposition
,contentLength
,contentType
orcontentMD5
to such requests. - Fixed #52, by renaming the kinesis interfaces and type properties to lowercased camelCase to fit our existing naming convention.
- Improved S3 test coverage.
Full Changelog: v0.10.0...v0.11.0
v0.10.0
What's Changed
- Replace clients
host
andscheme
properties to cater to S3-Compatible backends by @oleiade in #61 - Add support for Event Bridge by @jameshopkins in #55
- Export
AWSConfig
from signature bundle by @oleiade in #58 - Ensure s3 requests send a null body when unset by @oleiade in #60
New Contributors
- @jameshopkins made their first contribution in #55
Full Changelog: v0.9.0...v0.10.0
v0.9.0
What's changed
The following public methods have become asynchronous in this release:
KinesisClient
KMSClient
S3Client
SecretsManagerClient
SQSClient
SystemsManagerClient
However, the SignatureV4
class and its methods remain synchronous.
What this Means for You
Asynchronous Methods
In version v0.9.0
, client methods are now async
functions, which means they return a Promise
instead of a data type. For instance, the S3Client.listBuckets
method, previously defined as listBuckets(): Array<S3Bucket>
, is now an async function: async listBuckets(): Promise<Array<S3Bucket>>
.
Using the Asynchronous Methods
You can handle the returned Promise
using the await
keyword. This way, your asynchronous code will have a synchronous look and feel. Here's an example:
export default async function () {
// ...
const buckets = await s3.listBuckets()
}
Note: k6's setup, teardown, handleSummary, and default functions can be declared as async functions.
## Full Example
```javascript
import exec from 'k6/execution'
import { AWSConfig, S3Client } from 'https://jslib.k6.io/aws/0.9.0/s3.js'
const testFile = open('bonjour.txt', 'r')
const awsConfig = new AWSConfig.fromEnvironment()
const s3 = new S3Client(awsConfig)
const testBucketName = 'test-jslib-aws'
const testFileKey = 'bonjour.txt'
export default async function () {
const buckets = await s3.listBuckets()
if (buckets.filter((b) => b.name === testBucketName).length == 0) {
exec.test.abort()
}
await s3.putObject(testBucketName, testFileKey, testFile)
const objects = await s3.listObjects(testBucketName)
if (objects.filter((o) => o.key === testFileKey).length == 0) {
exec.test.abort()
}
const obj = await s3.getObject(testBucketName, testFileKey)
await s3.deleteObject(testBucketName, testFileKey)
}
Compatibility with Older k6 Versions
If you're using an older version of k6 that doesn't support asynchronous code execution, we recommend staying with v0.8.1 until you upgrade your k6 version.
v0.8.1
What's changed
- S3 now has support for the
copyObject
operation, thanks to @bendennis in #53
New Contributors
- @bendennis made their first contribution in #53
Full changelog
v0.8.0
What's Changed
- Support for Kinesis was added by @autometa101 in #46
- S3 multipart uploads are now supported, thanks to @ryoshindo in #42
- Scheme and bucket pathing honoring has been addressed by @MarkCupitt in #44
- Dynamic URL Scheme support was added by @NPJigaK in #51
New Contributors
- @ryoshindo made their first contribution in #42
- @MarkCupitt made their first contribution in #44
- @NPJigaK made their first contribution in #51
Full Changelog: v0.7.2...v0.8.0