Skip to content

Commit d0dfd29

Browse files
authored
Revert "[6.1] Add new trusted AKV URLs for FR and DE (#3486)" (#3507)
This reverts commit 1ccdf40.
1 parent 6a37506 commit d0dfd29

File tree

5 files changed

+19
-128
lines changed

5 files changed

+19
-128
lines changed

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Constants.cs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,16 @@ internal static class Constants
99
/// <summary>
1010
/// Azure Key Vault Domain Name
1111
/// </summary>
12-
internal static readonly string[] AzureKeyVaultPublicDomainNames =
13-
[
14-
// Azure Key Vaults
15-
"vault.azure.net", // Default
16-
"vault.azure.cn", // China
17-
"vault.usgovcloudapi.net", // US Government
18-
"vault.microsoftazure.de", // Azure Germany
19-
"vault.sovcloud-api.fr", // France (Bleu)
20-
"vault.sovcloud-api.de", // Germany (Delos)
21-
22-
// Managed High Security Modules (HSM) Vaults
23-
"managedhsm.azure.net",
24-
"managedhsm.azure.cn",
25-
"managedhsm.usgovcloudapi.net",
26-
"managedhsm.microsoftazure.de",
27-
"managedhsm.sovcloud-api.fr",
28-
"managedhsm.sovcloud-api.de"
29-
];
12+
internal static readonly string[] AzureKeyVaultPublicDomainNames = new string[] {
13+
@"vault.azure.net", // default
14+
@"vault.azure.cn", // Azure China
15+
@"vault.usgovcloudapi.net", // US Government
16+
@"vault.microsoftazure.de", // Azure Germany
17+
@"managedhsm.azure.net", // public HSM vault
18+
@"managedhsm.azure.cn", // Azure China HSM vault
19+
@"managedhsm.usgovcloudapi.net", // US Government HSM vault
20+
@"managedhsm.microsoftazure.de" // Azure Germany HSM vault
21+
};
3022

3123
/// <summary>
3224
/// Always Encrypted Parameter names for exec handling

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ internal static ArgumentException InvalidAKVPath(string masterKeyPath, bool isSy
141141
internal static ArgumentException InvalidAKVUrl(string masterKeyPath) =>
142142
new(string.Format(CultureInfo.InvariantCulture, Strings.InvalidAkvUrlTemplate, masterKeyPath), Constants.AeParamMasterKeyPath);
143143

144-
internal static ArgumentException InvalidAKVUrlTrustedEndpoints(string masterKeyPath, string endpoints) =>
144+
internal static Exception InvalidAKVUrlTrustedEndpoints(string masterKeyPath, string endpoints) =>
145145
new ArgumentException(string.Format(CultureInfo.InvariantCulture, Strings.InvalidAkvKeyPathTrustedTemplate, masterKeyPath, endpoints),
146146
Constants.AeParamMasterKeyPath);
147147
}

src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ExceptionTestAKVStore.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,23 @@ public void InvalidCertificatePath()
182182
string dummyPathWithOnlyHost = @"https://www.microsoft.com";
183183
string invalidUrlErrorMessage = $@"Invalid url specified: '{dummyPathWithOnlyHost}'";
184184
string dummyPathWithInvalidKey = @"https://www.microsoft.vault.azure.com/keys/dummykey/dummykeyid";
185+
string invalidTrustedEndpointErrorMessage = $@"Invalid Azure Key Vault key path specified: '{dummyPathWithInvalidKey}'. Valid trusted endpoints: vault.azure.net, vault.azure.cn, vault.usgovcloudapi.net, vault.microsoftazure.de, managedhsm.azure.net, managedhsm.azure.cn, managedhsm.usgovcloudapi.net, managedhsm.microsoftazure.de.\s+\(?Parameter (name: )?'?masterKeyPath('\))?";
185186

186187
Exception ex = Assert.Throws<ArgumentException>(
187188
() => _fixture.AkvStoreProvider.EncryptColumnEncryptionKey(dummyPathWithOnlyHost, MasterKeyEncAlgo, cek));
188189
Assert.Matches(invalidUrlErrorMessage, ex.Message);
189190

190191
ex = Assert.Throws<ArgumentException>(
191192
() => _fixture.AkvStoreProvider.EncryptColumnEncryptionKey(dummyPathWithInvalidKey, MasterKeyEncAlgo, cek));
192-
Assert.Matches(TrustedUrlsTest.MakeInvalidVaultErrorMessage(dummyPathWithInvalidKey), ex.Message);
193+
Assert.Matches(invalidTrustedEndpointErrorMessage, ex.Message);
193194

194195
ex = Assert.Throws<ArgumentException>(
195196
() => _fixture.AkvStoreProvider.DecryptColumnEncryptionKey(dummyPathWithOnlyHost, MasterKeyEncAlgo, encryptedCek));
196197
Assert.Matches(invalidUrlErrorMessage, ex.Message);
197198

198199
ex = Assert.Throws<ArgumentException>(
199200
() => _fixture.AkvStoreProvider.DecryptColumnEncryptionKey(dummyPathWithInvalidKey, MasterKeyEncAlgo, encryptedCek));
200-
Assert.Matches(TrustedUrlsTest.MakeInvalidVaultErrorMessage(dummyPathWithInvalidKey), ex.Message);
201+
Assert.Matches(invalidTrustedEndpointErrorMessage, ex.Message);
201202
}
202203

203204
[InlineData(true)]

src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TrustedUrlsTest.cs

Lines changed: 0 additions & 101 deletions
This file was deleted.

src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,22 @@
3636
<ItemGroup Condition="'$(TestSet)' == '' OR '$(TestSet)' == 'AE'">
3737
<Compile Include="AlwaysEncrypted\AKVTests.cs" />
3838
<Compile Include="AlwaysEncrypted\AKVUnitTests.cs" />
39+
<Compile Include="AlwaysEncrypted\EnclaveAzureDatabaseTests.cs" />
40+
<Compile Include="AlwaysEncrypted\ExceptionTestAKVStore.cs" />
41+
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\AKVTestTable.cs" />
42+
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\AkvColumnMasterKey.cs" />
43+
<Compile Include="AlwaysEncrypted\TestFixtures\SQLSetupStrategyAzureKeyVault.cs" />
3944
<Compile Include="AlwaysEncrypted\ApiShould.cs" />
4045
<Compile Include="AlwaysEncrypted\BulkCopyAE.cs" />
4146
<Compile Include="AlwaysEncrypted\BulkCopyAEErrorMessage.cs" />
4247
<Compile Include="AlwaysEncrypted\ColumnDecryptErrorTests.cs" />
43-
<Compile Include="AlwaysEncrypted\EnclaveAzureDatabaseTests.cs" />
4448
<Compile Include="AlwaysEncrypted\End2EndSmokeTests.cs" />
45-
<Compile Include="AlwaysEncrypted\ExceptionTestAKVStore.cs" />
4649
<Compile Include="AlwaysEncrypted\SqlBulkCopyTruncation.cs" />
4750
<Compile Include="AlwaysEncrypted\SqlNullValues.cs" />
48-
<Compile Include="AlwaysEncrypted\TrustedUrlsTest.cs" />
4951
<Compile Include="AlwaysEncrypted\TestFixtures\AzureKeyVaultKeyFixture.cs" />
5052
<Compile Include="AlwaysEncrypted\TestFixtures\DatabaseHelper.cs" />
5153
<Compile Include="AlwaysEncrypted\TestFixtures\SQLSetupStrategy.cs" />
52-
<Compile Include="AlwaysEncrypted\TestFixtures\SQLSetupStrategyAzureKeyVault.cs" />
5354
<Compile Include="AlwaysEncrypted\TestFixtures\SQLSetupStrategyCertStoreProvider.cs" />
54-
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\AKVTestTable.cs" />
55-
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\AkvColumnMasterKey.cs" />
5655
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\ApiTestTable.cs" />
5756
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\BulkCopyAETestTable.cs" />
5857
<Compile Include="AlwaysEncrypted\TestFixtures\Setup\BulkCopyAEErrorMessageTestTable.cs" />

0 commit comments

Comments
 (0)