Hey there!
I have setup a bucket at Amazon S3 with region "Frankfurt".
Api requests for this bucket require to use AWS Signature Version 4 for authentication.
In 'raw' code I can satisfy this requirement by including parameter `signatureVersion: 'v4'` in the code `var s3 = new AWS.S3({signatureVersion: 'v4', region: 'eu-central-1'});`.
But I can't understand how I can implement it via `loopback-component-storage`.
`Get` request `/containers` works fine and returns my S3 buckets.
But `Get` request `/containers/{container}` doesn't works and I guess it is because of the requirement to use `signatureVersion: 'v4'`:
{
"error": {
"name": "InvalidRequest",
"status": 400,
"message": "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.",
"code": "InvalidRequest",
"time": "2015-01-26T16:11:47.586Z",
"statusCode": 400,
"retryable": false,
"retryDelay": 30,
"stack": "InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.\n at Request.extractError (/Users/alexei/Dropbox/Projects/Placetoview/source/api/node_modules/loopback-component-storage/node_modules/pkgcloud/node_modules/aws-sdk/lib/services/s3.js:343:35)\n at Request.callListeners (...)"
}
}
I tried to specify `signatureVersion` as option in the `loopback.createDataSource`:
var ds = loopback.createDataSource({
connector: require('loopback-component-storage'),
provider: 'amazon',
key: 'CJw1f77+/z0aNy8cc1R/5DZslKMNv5dAq9khpEEK',
keyId: 'AKIAJDRMDXKZTQAOJ34A',
signatureVersion: 'v4'
});
But this doesn't work.
What is the right way to point `signatureVersion` param?