Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .autover/changes/410401de-8685-444c-a85f-dcc4fd167d15.json

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Release 2025-12-16

### Amazon.Extensions.S3.Encryption (3.2.0)
* feat: Add decryption support for AesGcmWithCommitment

## Release 2025-11-12

### Amazon.Extensions.S3.Encryption (3.1.0)
Expand Down
2 changes: 1 addition & 1 deletion src/Amazon.Extensions.S3.Encryption.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0;netcoreapp3.1;net8.0</TargetFrameworks>
<Version>3.1.0</Version>
<Version>3.2.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Amazon.Extensions.S3.Encryption</PackageId>
<Title>Amazon S3 Encryption Client for .NET</Title>
Expand Down
7 changes: 3 additions & 4 deletions src/AmazonS3EncryptionClientBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ internal IAmazonKeyManagementService KMSClient
{
if (this.S3CryptoConfig.KmsConfig != null)
{
kmsClient = new AmazonKeyManagementServiceClient(this.Config.DefaultAWSCredentials,
this.S3CryptoConfig.KmsConfig);
kmsClient = new AmazonKeyManagementServiceClient(ExplicitAWSCredentials ?? Config.DefaultAWSCredentials, S3CryptoConfig.KmsConfig);
}
else
{
Expand All @@ -129,7 +128,7 @@ internal IAmazonKeyManagementService KMSClient
kmsConfig.SetWebProxy(proxySettings);
}

kmsClient = new AmazonKeyManagementServiceClient(this.Config.DefaultAWSCredentials, kmsConfig);
kmsClient = new AmazonKeyManagementServiceClient(ExplicitAWSCredentials ?? Config.DefaultAWSCredentials, kmsConfig);
}
}
}
Expand All @@ -146,7 +145,7 @@ internal AmazonS3Client S3ClientForInstructionFile
{
if (s3ClientForInstructionFile == null)
{
s3ClientForInstructionFile = new AmazonS3Client(this.Config.DefaultAWSCredentials, S3CryptoConfig);
s3ClientForInstructionFile = new AmazonS3Client(ExplicitAWSCredentials ?? Config.DefaultAWSCredentials, S3CryptoConfig);
}
return s3ClientForInstructionFile;
}
Expand Down
12 changes: 10 additions & 2 deletions test/UnitTests/AmazonS3EncryptionClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Amazon.Extensions.S3.Encryption.Primitives;
using Amazon.KeyManagementService;
using Amazon.Runtime;
using Amazon.S3;
using Xunit;

namespace Amazon.Extensions.S3.Encryption.UnitTests
Expand Down Expand Up @@ -82,9 +83,16 @@ public void S3EncryptionClient_AllWrappedClientsInheritBaseConfiguration()
//= type=test
//# If the S3EC accepts SDK client configuration, the configuration MUST be applied to all wrapped SDK clients including the KMS client.
Assert.Equal(config.RegionEndpoint, client.S3ClientForInstructionFile.Config.RegionEndpoint);
Assert.Equal(credentials, client.S3ClientForInstructionFile.Config.DefaultAWSCredentials);
Assert.Equal(config.RegionEndpoint, client.KMSClient.Config.RegionEndpoint);
Assert.Equal(credentials, client.Config.DefaultAWSCredentials);

// Use reflection to get the actual credentials from the s3 and kms clients since ExplicitAWSCredentials is not exposed
var s3ClientCredentials = typeof(AmazonS3Client).GetProperty("ExplicitAWSCredentials", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?
.GetValue(client.S3ClientForInstructionFile);
Assert.Equal(credentials, s3ClientCredentials);

var kmsClientCredentials = typeof(AmazonKeyManagementServiceClient).GetProperty("ExplicitAWSCredentials", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?
.GetValue(client.KMSClient);
Assert.Equal(credentials, kmsClientCredentials);
}
}
}
12 changes: 10 additions & 2 deletions test/UnitTests/AmazonS3EncryptionClientV2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Amazon.Extensions.S3.Encryption.Primitives;
using Amazon.KeyManagementService;
using Amazon.Runtime;
using Amazon.S3;
using Xunit;

namespace Amazon.Extensions.S3.Encryption.UnitTests
Expand Down Expand Up @@ -80,9 +81,16 @@ public void S3EncryptionClient_AllWrappedClientsInheritBaseConfiguration()
//= type=test
//# If the S3EC accepts SDK client configuration, the configuration MUST be applied to all wrapped SDK clients including the KMS client.
Assert.Equal(config.RegionEndpoint, client.S3ClientForInstructionFile.Config.RegionEndpoint);
Assert.Equal(credentials, client.S3ClientForInstructionFile.Config.DefaultAWSCredentials);
Assert.Equal(config.RegionEndpoint, client.KMSClient.Config.RegionEndpoint);
Assert.Equal(credentials, client.Config.DefaultAWSCredentials);

// Use reflection to get the actual credentials from the s3 and kms clients since ExplicitAWSCredentials is not exposed
var s3ClientCredentials = typeof(AmazonS3Client).GetProperty("ExplicitAWSCredentials", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?
.GetValue(client.S3ClientForInstructionFile);
Assert.Equal(credentials, s3ClientCredentials);

var kmsClientCredentials = typeof(AmazonKeyManagementServiceClient).GetProperty("ExplicitAWSCredentials", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?
.GetValue(client.KMSClient);
Assert.Equal(credentials, kmsClientCredentials);
}
}
}
Loading