Some S3 API can be called without being authenticated.
GetObject and ListObject are valid example on public buckets
When using code such as
var s3 = new AWS.S3();
s3.listObjects(params = {Bucket: bucketName, Prefix: prefix }, function (err, data) { ... })
I do receive
Error : "SigningError"
message: "Missing credentials in config"
we would need a way to make anonymous queries for AWS.S3 object
You can do this by removing the signing and credential validation handlers:
function unauthenticatedRequest(operation, params, callback) {
var request = s3[operation](params);
request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS);
request.removeListener('sign', AWS.EventListeners.Core.SIGN);
request.send(callback);
}
unauthenticatedRequest('listObjects', {Bucket: 'mybucket'}, function (err, data) { ... });
As for an unsigned getObject, you can just use a regular http GET to download public objects from S3.
I've publicly exposed the internal makeUnauthenticatedRequest operation we use for some unauthenticated operations, which you will be able to use in the next release of the SDK (you can already use this in the current SDK). See the above commit for a usage example.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
I've publicly exposed the internal
makeUnauthenticatedRequestoperation we use for some unauthenticated operations, which you will be able to use in the next release of the SDK (you can already use this in the current SDK). See the above commit for a usage example.