SignatureV4.presign() pre-signs a URL with the AWS Signature V4 algorithm. Given an HTTP request description, it returns a new HTTP request with the AWS signature v4 authorization added. It returns an Object holding a
url containing the authorization information encoded in its query string, ready to use in the context of a k6 HTTP call.
The first parameter of the
presign method consists of an Object with the following properties.
|method||string||The HTTP method of the request|
|protocol||The network protocol of the request|
|hostname||string||The hostname the request is sent to|
|path||string||The path of the request|
|headers||Object||The headers of the HTTP request|
You can provide further options and override SignatureV4 options in the context of this specific request.
To do this, pass a second parameter to the
presign method, which is an Object with the following parameters.
|expiresIn||number||The number of seconds before the pre-signed URL expires|
|signingDate||Date||overrides the Date used in the signing operation|
|signingService||string||overrides the signer’s AWS service in the context of the |
|signingRegion||string||overrides the signer’s AWS region in the context of the |
|unsignableHeaders||excludes headers from the signing process|
|signableHeaders||mark headers as signed|
presign operation returns an Object with the following properties.
|headers||Object||The pre-signed request headers to use in the context of a k6 HTTP request|
|url||string||The pre-signed url to use in the context of a k6 HTTP request|