Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Add KeyVault encryption to DataProtection #273

Merged
merged 10 commits into from
Sep 11, 2017
Merged

Add KeyVault encryption to DataProtection #273

merged 10 commits into from
Sep 11, 2017

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Sep 1, 2017

#92

@pakrym pakrym requested a review from blowdart September 1, 2017 22:25

using (var symmetricAlgorithm = DefaultSymmetricAlgorithmFactory())
{
var symmetricBlockSize = symmetricAlgorithm.BlockSize / 8;
Copy link
Contributor Author

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?

Copy link
Member

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)" />
Copy link
Contributor

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" />
Copy link
Contributor

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);
Copy link
Contributor

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).

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor

@ajaybhargavb ajaybhargavb left a 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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: params misordered.

@pakrym pakrym merged commit ee00998 into dev Sep 11, 2017
@natemcmaster natemcmaster deleted the pakrym/kv-encryption branch June 8, 2018 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants