Skip to content

Commit c78c9ed

Browse files
Update AWS packages (#8334) (#8360)
* Update AWS packages * Fix build issues Co-authored-by: Wiktor Kopec <[email protected]>
1 parent 2f08365 commit c78c9ed

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

eng/dependabot/independent/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<!-- Third-party references -->
1515
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
1616
<NJsonSchemaVersion>11.0.0</NJsonSchemaVersion>
17-
<AwsSdkS3Version>3.7.305.7</AwsSdkS3Version>
18-
<AwsSdkSecurityTokenVersion>3.7.300.33</AwsSdkSecurityTokenVersion>
17+
<AwsSdkS3Version>4.0.0.3</AwsSdkS3Version>
18+
<AwsSdkSecurityTokenVersion>4.0.0.2</AwsSdkSecurityTokenVersion>
1919

2020
<!--
2121
Moq version & constants derived from Moq.

src/Extensions/S3Storage/S3Storage.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Amazon;
55
using Amazon.Runtime;
66
using Amazon.Runtime.CredentialManagement;
7+
using Amazon.Runtime.Credentials;
78
using Amazon.S3;
89
using Amazon.S3.Model;
910
using Amazon.S3.Transfer;
@@ -72,17 +73,11 @@ public static async Task<IS3Storage> CreateAsync(S3StorageEgressProviderOptions
7273
throw new AmazonClientException("AWS profile not found");
7374
}
7475

75-
awsCredentials ??= FallbackCredentialsFactory.GetCredentials();
76+
awsCredentials ??= DefaultAWSCredentialsIdentityResolver.GetCredentials();
7677

7778
if (awsCredentials == null)
7879
throw new AmazonClientException("Failed to find AWS Credentials for constructing AWS service client");
7980

80-
if (options.UseKmsEncryption)
81-
{
82-
// Required for generating pre-signed URLs with KMS encryption
83-
AWSConfigsS3.UseSignatureVersion4 = true;
84-
}
85-
8681
IAmazonS3 s3Client = new AmazonS3Client(awsCredentials, configuration);
8782
bool exists = await AmazonS3Util.DoesS3BucketExistV2Async(s3Client, options.BucketName);
8883
if (!exists)
@@ -173,7 +168,7 @@ public async Task<PartETag> UploadPartAsync(string uploadId, int partNumber, int
173168
PartNumber = partNumber
174169
};
175170
var response = await _s3Client.UploadPartAsync(uploadRequest, token);
176-
return new PartETag(response.PartNumber, response.ETag);
171+
return new PartETag(response.PartNumber ?? partNumber, response.ETag);
177172
}
178173

179174
public string GetTemporaryResourceUrl(DateTime expires)

0 commit comments

Comments
 (0)