mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:10:05 +00:00
Use anonymous AWS credentials
This commit is contained in:
parent
4e79c30209
commit
5fc05ebce6
1 changed files with 9 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <shared_mutex>
|
#include <shared_mutex>
|
||||||
|
|
||||||
|
#include <aws/core/auth/AWSCredentials.h>
|
||||||
#include <aws/s3/S3Client.h>
|
#include <aws/s3/S3Client.h>
|
||||||
#include <aws/s3/model/GetObjectRequest.h>
|
#include <aws/s3/model/GetObjectRequest.h>
|
||||||
#include <aws/s3/model/ListObjectsV2Request.h>
|
#include <aws/s3/model/ListObjectsV2Request.h>
|
||||||
|
|
@ -63,11 +64,18 @@ public:
|
||||||
// Disable HTTP request for region
|
// Disable HTTP request for region
|
||||||
util::SetEnvironment("AWS_EC2_METADATA_DISABLED", "true");
|
util::SetEnvironment("AWS_EC2_METADATA_DISABLED", "true");
|
||||||
|
|
||||||
|
// Use anonymous credentials
|
||||||
|
Aws::Auth::AWSCredentials credentials {};
|
||||||
|
|
||||||
Aws::Client::ClientConfiguration config;
|
Aws::Client::ClientConfiguration config;
|
||||||
config.region = region_;
|
config.region = region_;
|
||||||
config.connectTimeoutMs = 10000;
|
config.connectTimeoutMs = 10000;
|
||||||
|
|
||||||
client_ = std::make_shared<Aws::S3::S3Client>(config);
|
client_ = std::make_shared<Aws::S3::S3Client>(
|
||||||
|
credentials,
|
||||||
|
Aws::MakeShared<Aws::S3::S3EndpointProvider>(
|
||||||
|
Aws::S3::S3Client::ALLOCATION_TAG),
|
||||||
|
config);
|
||||||
}
|
}
|
||||||
|
|
||||||
~Impl() {}
|
~Impl() {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue