Make ApiVersion field within client options settable for keyvault packages (#6130)

This commit is contained in:
Ahson Khan 2024-10-29 21:13:44 -07:00 committed by GitHub
parent cb655deb44
commit c168d736dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 47 additions and 7 deletions

View File

@ -8,6 +8,8 @@
### Bugs Fixed
- Allow the `ApiVersion` field within `SettingsClientOptions` to be settable.
### Other Changes
## 4.0.0-beta.5 (2024-08-06)

View File

@ -27,7 +27,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Administra
* @brief Service Version used.
*
*/
const std::string ApiVersion{"7.4"};
std::string ApiVersion{"7.4"};
};
}}}} // namespace Azure::Security::KeyVault::Administration

View File

@ -107,3 +107,19 @@ TEST_F(SettingsClientTest, UpdateSetting_RECORDEDONLY_)
SkipTest();
}
}
TEST(KeyVaultSettingsClientTest, ServiceVersion)
{
auto credential
= std::make_shared<Azure::Identity::ClientSecretCredential>("tenantID", "AppId", "SecretId");
// Default - 7.4
EXPECT_NO_THROW(auto options = SettingsClientOptions(); SettingsClient settingsClient(
"http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.4"););
// 7.4
EXPECT_NO_THROW(
auto options = SettingsClientOptions(); options.ApiVersion = "7.4";
SettingsClient settingsClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.4"););
}

View File

@ -8,6 +8,8 @@
### Bugs Fixed
- Allow the `ApiVersion` field within `CertificateClientOptions` to be settable.
### Other Changes
## 4.3.0-beta.2 (2024-06-11)

View File

@ -29,7 +29,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
* @brief Service Version used.
*
*/
const std::string ApiVersion{"7.5"};
std::string ApiVersion{"7.5"};
};
}}}} // namespace Azure::Security::KeyVault::Certificates

View File

@ -900,8 +900,14 @@ TEST_F(KeyVaultCertificateClientTest, ServiceVersion)
{
auto credential
= std::make_shared<Azure::Identity::ClientSecretCredential>("tenantID", "AppId", "SecretId");
// 7.5
// Default - 7.5
EXPECT_NO_THROW(auto options = CertificateClientOptions(); CertificateClient certificateClient(
"http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.5"););
// 7.4
EXPECT_NO_THROW(
auto options = CertificateClientOptions(); options.ApiVersion = "7.4";
CertificateClient certificateClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.4"););
}

View File

@ -8,6 +8,8 @@
### Bugs Fixed
- Allow the `ApiVersion` field within `KeyClientOptions` to be settable.
### Other Changes
## 4.5.0-beta.2 (2024-06-11)

View File

@ -59,7 +59,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
* @brief Service Version used.
*
*/
const std::string ApiVersion{"7.5"};
std::string ApiVersion{"7.5"};
};
/**

View File

@ -32,10 +32,15 @@ TEST(KeyVaultKeyClientUnitTest, ServiceVersion)
{
auto credential
= std::make_shared<Azure::Identity::ClientSecretCredential>("tenantID", "AppId", "SecretId");
// 7.5
// Default - 7.5
EXPECT_NO_THROW(auto options = KeyClientOptions();
KeyClient keyClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.5"););
// 7.4
EXPECT_NO_THROW(auto options = KeyClientOptions(); options.ApiVersion = "7.4";
KeyClient keyClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.4"););
}
TEST(KeyVaultKeyClientUnitTest, GetUrl)

View File

@ -8,6 +8,8 @@
### Bugs Fixed
- Allow the `ApiVersion` field within `SecretClientOptions` to be settable.
### Other Changes
## 4.3.0-beta.2 (2024-06-11)

View File

@ -22,7 +22,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
* @brief Service Version used.
*
*/
const std::string ApiVersion{"7.5"};
std::string ApiVersion{"7.5"};
};
/**

View File

@ -30,10 +30,15 @@ TEST(SecretClient, ServiceVersion)
{
auto credential
= std::make_shared<Azure::Identity::ClientSecretCredential>("tenantID", "AppId", "SecretId");
// 7.5
// Default - 7.5
EXPECT_NO_THROW(auto options = SecretClientOptions();
SecretClient SecretClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.5"););
// 7.4
EXPECT_NO_THROW(auto options = SecretClientOptions(); options.ApiVersion = "7.4";
SecretClient SecretClient("http://account.vault.azure.net", credential, options);
EXPECT_EQ(options.ApiVersion, "7.4"););
}
TEST(SecretClient, GetUrl)