based on code -rev from https://github.com/Azure/azure-sdk-for-cpp/pull/2117 (#2125)
* based on code -rev * remove non-required method * Update sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_type.hpp
This commit is contained in:
parent
95051bd19c
commit
b87bda520a
@ -9,8 +9,8 @@
|
||||
### Breaking Changes
|
||||
|
||||
- Removed `Azure::Security::KeyVault::Keys::JsonWebKey::to_json`.
|
||||
- Replaced static functions from `KeyOperation` and `KeyCurveName` for static const members.
|
||||
- Replaced the enum `JsonWebKeyType` for a class with static const members as ext enum.
|
||||
- Replaced static functions from `KeyOperation` and `KeyCurveName` with static const members.
|
||||
- Replaced the enum `JsonWebKeyType` for a class with static const members as an extensible enum called `KeyVaultKeyType`.
|
||||
- Renamed `MaxResults` to `MaxPageResults` for `GetSinglePageOptions`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@ -77,7 +77,5 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
|
||||
: Azure::Core::_internal::ClientOptions(), Version(version)
|
||||
{
|
||||
}
|
||||
|
||||
std::string GetVersionString() const { return Version.ToString(); }
|
||||
};
|
||||
}}}} // namespace Azure::Security::KeyVault::Keys
|
||||
|
||||
@ -25,14 +25,14 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new JWT Type object
|
||||
* @brief Construct a new JSON Web Token (JWT) type object.
|
||||
*
|
||||
* @param jwt The JWT as string.
|
||||
* @param jwt The JWT as a string.
|
||||
*/
|
||||
explicit KeyVaultKeyType(std::string jwt) : m_value(std::move(jwt)) {}
|
||||
|
||||
/**
|
||||
* @brief Construct a default JWT.
|
||||
* @brief Construct a default KeyVaultKeyType with an empty string.
|
||||
*
|
||||
*/
|
||||
KeyVaultKeyType() = default;
|
||||
@ -48,9 +48,9 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the JWK as string.
|
||||
* @brief Return the JSON Web Token (JWT) as a string.
|
||||
*
|
||||
* @return The JWK represented as string.
|
||||
* @return The JWT represented as string.
|
||||
*/
|
||||
std::string const& ToString() const { return m_value; }
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ KeyClient::KeyClient(
|
||||
std::shared_ptr<Core::Credentials::TokenCredential const> credential,
|
||||
KeyClientOptions options)
|
||||
{
|
||||
auto apiVersion = options.GetVersionString();
|
||||
auto apiVersion = options.Version.ToString();
|
||||
|
||||
std::vector<std::unique_ptr<HttpPolicy>> perRetrypolicies;
|
||||
{
|
||||
|
||||
@ -34,24 +34,24 @@ TEST(KeyClient, ServiceVersion)
|
||||
// 7.0
|
||||
EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_0);
|
||||
KeyClient keyClient("vaultUrl", credential, options);
|
||||
EXPECT_EQ(options.GetVersionString(), "7.0"););
|
||||
EXPECT_EQ(options.Version.ToString(), "7.0"););
|
||||
}
|
||||
{
|
||||
// 7.1
|
||||
EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_1);
|
||||
KeyClient keyClient("vaultUrl", credential, options);
|
||||
EXPECT_EQ(options.GetVersionString(), "7.1"););
|
||||
EXPECT_EQ(options.Version.ToString(), "7.1"););
|
||||
}
|
||||
{
|
||||
// 7.2
|
||||
EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_2);
|
||||
KeyClient keyClient("vaultUrl", credential, options);
|
||||
EXPECT_EQ(options.GetVersionString(), "7.2"););
|
||||
EXPECT_EQ(options.Version.ToString(), "7.2"););
|
||||
}
|
||||
{
|
||||
// arbitrary version
|
||||
EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion("1.0"));
|
||||
KeyClient keyClient("vaultUrl", credential, options);
|
||||
EXPECT_EQ(options.GetVersionString(), "1.0"););
|
||||
EXPECT_EQ(options.Version.ToString(), "1.0"););
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam
|
||||
KeyClientOptions const& options = KeyClientOptions())
|
||||
: KeyClient(vaultUrl, nullptr, options)
|
||||
{
|
||||
auto apiVersion = options.GetVersionString();
|
||||
auto apiVersion = options.Version.ToString();
|
||||
|
||||
m_pipeline = std::make_unique<Azure::Security::KeyVault::_internal::KeyVaultPipeline>(
|
||||
Azure::Core::Url(vaultUrl),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user