@@ -48,7 +48,9 @@ class LiveClientTest : public ::testing::Test
48
48
{
49
49
TimeStamp = DateTime::Now ().CalculateLocalTimestampAsString (" %Y%m%dt%H%M%Sz" ).c_str ();
50
50
51
- StandardClient = Aws::MakeShared<Aws::S3::S3Client>(ALLOCATION_TAG);
51
+ ClientConfiguration config;
52
+ config.region = Aws::Region::US_EAST_1;
53
+ StandardClient = Aws::MakeShared<Aws::S3::S3Client>(ALLOCATION_TAG, config);
52
54
BucketName = ComputeUniqueBucketName (ENCRYPTED_BUCKET_TEST_NAME).c_str ();
53
55
Model::CreateBucketRequest createBucketRequest;
54
56
createBucketRequest.WithBucket (BucketName.c_str ())
@@ -86,12 +88,15 @@ TEST_F(LiveClientTest, TestEOMode)
86
88
configuration.SetCryptoMode (CryptoMode::ENCRYPTION_ONLY);
87
89
configuration.SetStorageMethod (StorageMethod::METADATA);
88
90
91
+ ClientConfiguration s3ClientConfig;
92
+ s3ClientConfig.region = Aws::Region::US_EAST_1;
93
+
89
94
auto key = SymmetricCipher::GenerateKey ();
90
95
auto simpleEncryptionMaterials = Aws::MakeShared<Materials::SimpleEncryptionMaterialsWithGCMAAD>(ALLOCATION_TAG, key);
91
96
92
97
static const char * objectKey = " TestEOKey" ;
93
98
94
- S3EncryptionClient client (simpleEncryptionMaterials, configuration);
99
+ S3EncryptionClient client (simpleEncryptionMaterials, configuration, s3ClientConfig );
95
100
96
101
Model::PutObjectRequest putObjectRequest;
97
102
putObjectRequest.WithBucket (BucketName.c_str ())
@@ -164,12 +169,15 @@ TEST_F(LiveClientTest, TestAEMode)
164
169
configuration.SetCryptoMode (CryptoMode::AUTHENTICATED_ENCRYPTION);
165
170
configuration.SetStorageMethod (StorageMethod::METADATA);
166
171
172
+ ClientConfiguration s3ClientConfig;
173
+ s3ClientConfig.region = Aws::Region::US_EAST_1;
174
+
167
175
auto key = SymmetricCipher::GenerateKey ();
168
176
auto simpleEncryptionMaterials = Aws::MakeShared<Materials::SimpleEncryptionMaterialsWithGCMAAD>(ALLOCATION_TAG, key);
169
177
170
178
static const char * objectKey = " TestAEKey" ;
171
179
172
- S3EncryptionClient client (simpleEncryptionMaterials, configuration);
180
+ S3EncryptionClient client (simpleEncryptionMaterials, configuration, s3ClientConfig );
173
181
174
182
Model::PutObjectRequest putObjectRequest;
175
183
putObjectRequest.WithBucket (BucketName.c_str ())
@@ -248,12 +256,15 @@ TEST_F(LiveClientTest, TestAEModeRangeGet)
248
256
configuration.SetCryptoMode (CryptoMode::AUTHENTICATED_ENCRYPTION);
249
257
configuration.SetStorageMethod (StorageMethod::METADATA);
250
258
259
+ ClientConfiguration s3ClientConfig;
260
+ s3ClientConfig.region = Aws::Region::US_EAST_1;
261
+
251
262
auto key = SymmetricCipher::GenerateKey ();
252
263
auto simpleEncryptionMaterials = Aws::MakeShared<Materials::SimpleEncryptionMaterialsWithGCMAAD>(ALLOCATION_TAG, key);
253
264
254
265
static const char * objectKey = " TestAERangeGetKey" ;
255
266
256
- S3EncryptionClient client (simpleEncryptionMaterials, configuration);
267
+ S3EncryptionClient client (simpleEncryptionMaterials, configuration, s3ClientConfig );
257
268
258
269
Model::PutObjectRequest putObjectRequest;
259
270
putObjectRequest.WithBucket (BucketName.c_str ())
@@ -329,10 +340,13 @@ TEST_F(LiveClientTest, TestAEModeRangeGet)
329
340
330
341
TEST_F (LiveClientTest, TestS3EncryptionError)
331
342
{
343
+ ClientConfiguration s3ClientConfig;
344
+ s3ClientConfig.region = Aws::Region::US_EAST_1;
345
+
332
346
auto kmsMaterials = Aws::MakeShared<Aws::S3Encryption::Materials::KMSWithContextEncryptionMaterials>(" s3Encryption" , " badKey" );
333
347
Aws::S3Encryption::CryptoConfiguration cryptoConfiguration (Aws::S3Encryption::StorageMethod::METADATA, Aws::S3Encryption::CryptoMode::ENCRYPTION_ONLY);
334
348
auto credentials = Aws::MakeShared<Aws::Auth::DefaultAWSCredentialsProviderChain>(" s3Encryption" );
335
- Aws::S3Encryption::S3EncryptionClient encryptionClient (kmsMaterials, cryptoConfiguration, credentials);
349
+ Aws::S3Encryption::S3EncryptionClient encryptionClient (kmsMaterials, cryptoConfiguration, credentials, s3ClientConfig );
336
350
337
351
Model::PutObjectRequest putObjectRequest;
338
352
putObjectRequest.WithBucket (" badBucket" ).WithKey (" badKey" );
0 commit comments