Keyvault regen (#5445)

* mroe quotes

* dssf

* update to api version 7.5 , added field to key properties , regen tests

* update hsm location

* fds
This commit is contained in:
George Arama 2024-03-15 11:00:41 -07:00 committed by GitHub
parent 1ecceb6f7a
commit a733518306
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 26 additions and 12 deletions

View File

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/keyvault",
"Tag": "cpp/keyvault_51f59d3347"
"Tag": "cpp/keyvault_c86efa6555"
}

View File

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

View File

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

View File

@ -41,6 +41,6 @@ namespace Azure {
* @brief Construct a new Key Client Options object.
*
*/
CryptographyClientOptions() : Azure::Core::_internal::ClientOptions() { Version = "7.3"; }
CryptographyClientOptions() : Azure::Core::_internal::ClientOptions() { Version = "7.5"; }
};
}}}}} // namespace Azure::Security::KeyVault::Keys::Cryptography

View File

@ -559,6 +559,12 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
*/
Azure::Nullable<bool> Exportable;
/**
* @brief Indicates if the private key can be exported.
*
*/
Azure::Nullable<std::string> HsmPlatform;
/**
* @brief Construct a new Key Properties object.
*

View File

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

View File

@ -80,6 +80,9 @@ void _detail::KeyVaultKeySerializer::KeyVaultKeyDeserialize(
attributes,
_detail::UpdatedPropertyName,
PosixTimeConverter::PosixTimeToDateTime);
JsonOptional::SetIfExists<std::string>(
key.Properties.HsmPlatform, attributes, _detail::HsmPlatformPropertyName);
}
JsonOptional::SetIfExists<json, KeyReleasePolicy>(

View File

@ -32,6 +32,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam
constexpr static const char UpdatedPropertyName[] = "updated";
constexpr static const char RecoverableDaysPropertyName[] = "recoverableDays";
constexpr static const char RecoveryLevelPropertyName[] = "recoveryLevel";
constexpr static const char HsmPlatformPropertyName[] = "hsmPlatform";
/***************** Key Request Parameters *****************/
constexpr static const char KeyTypePropertyName[] = "kty";

View File

@ -27,6 +27,7 @@ TEST_F(KeyVaultKeyHSMClient, CreateEcHsmKey)
CheckValidResponse(keyResponse);
auto keyVaultKey = keyResponse.Value;
EXPECT_EQ(keyVaultKey.Name(), keyName);
EXPECT_TRUE(keyVaultKey.Properties.HsmPlatform.HasValue());
EXPECT_TRUE(keyVaultKey.Properties.Enabled.Value());
}
{
@ -36,6 +37,7 @@ TEST_F(KeyVaultKeyHSMClient, CreateEcHsmKey)
auto keyVaultKey = keyResponse.Value;
EXPECT_EQ(keyVaultKey.Name(), keyName);
EXPECT_FALSE(keyResponse.Value.Properties.ReleasePolicy.HasValue());
EXPECT_TRUE(keyVaultKey.Properties.HsmPlatform.HasValue());
EXPECT_TRUE(keyVaultKey.Properties.Enabled.Value());
}
}
@ -54,6 +56,7 @@ TEST_F(KeyVaultKeyHSMClient, CreateRsaHsmKey)
CheckValidResponse(keyResponse);
auto keyVaultKey = keyResponse.Value;
EXPECT_EQ(keyVaultKey.Name(), keyName);
EXPECT_TRUE(keyVaultKey.Properties.HsmPlatform.HasValue());
}
{
// Now get the key
@ -63,6 +66,7 @@ TEST_F(KeyVaultKeyHSMClient, CreateRsaHsmKey)
EXPECT_EQ(keyVaultKey.Name(), keyName);
EXPECT_FALSE(keyResponse.Value.Properties.ReleasePolicy.HasValue());
EXPECT_TRUE(keyVaultKey.Properties.Enabled.Value());
EXPECT_TRUE(keyVaultKey.Properties.HsmPlatform.HasValue());
}
}

View File

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

View File

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

View File

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

View File

@ -62,7 +62,7 @@ extends:
- Name: AZURE_KEYVAULT_URL
Value: "https://non-real-account.vault.azure.net"
- Name: AZURE_KEYVAULT_HSM_URL
Value: "https://non-real-account.managedhsm.azure.net/"
Value: "https://non-real-account.vault.azure.net"
# Tenant ID should use the uniqueID format for playback recordings
- Name: AZURE_TENANT_ID
Value: "33333333-3333-3333-3333-333333333333"