-
Notifications
You must be signed in to change notification settings - Fork 87
Add KeyVault encryption to DataProtection #273
Conversation
|
||
using (var symmetricAlgorithm = DefaultSymmetricAlgorithmFactory()) | ||
{ | ||
var symmetricBlockSize = symmetricAlgorithm.BlockSize / 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blowdart can please check that this is done correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works :)
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="$(AspNetCoreVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove Version="$(AspNetCoreVersion)"
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Testing" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this. It's duplicated from Directory.Build.props
mock.VerifyAll(); | ||
Assert.NotNull(result); | ||
Assert.NotNull(value); | ||
Assert.Equal(typeof(AzureKeyVaultXmlDecryptor), result.DecryptorType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Assert.IsType<AzureKeyVaultXmlDecryptor>(result.DecryptorType)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be wrong, IsType
checks type of an object, I'm checking Type
instance equality.
/// <returns>The value <paramref name="builder"/>.</returns> | ||
public static IDataProtectionBuilder ProtectKeysWithAzureKeyVault(this IDataProtectionBuilder builder, string keyIdentifier, string clientId, string clientSecret) | ||
{ | ||
if (clientId == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string.IsNullOrEmpty
for string parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// Configures the data protection system to protect keys with specified key in Azure KeyVault. | ||
/// </summary> | ||
/// <param name="builder">The builder instance to modify.</param> | ||
/// <param name="keyIdentifier">The Azure KeyVault key identifier used for key encryption.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: params misordered.
#92