Revert "Changelog (#3044)" (#3054)

This reverts commit 8148444413.
This commit is contained in:
Victor Vazquez 2021-11-04 14:05:48 -07:00 committed by GitHub
parent 8148444413
commit 46f6c21124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 29 deletions

View File

@ -1,7 +1,7 @@
# Release History
## 4.0.0-beta.1
## 4.0.0-beta.1 (Unreleased)
### New Features
- initial preview
- Added `CertificateClient` with `GetCertificate()` and `GetCertificateVersion()` APIs.

View File

@ -442,11 +442,13 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
*
* @remark This operation requires the certificates/import permission.
*
* @param name The name of the certificate.
* @param options The options for the request.
* @param context The context for the operation can be used for request cancellation.
* @return Imported certificate bundle to the vault.
*/
Azure::Response<KeyVaultCertificateWithPolicy> ImportCertificate(
std::string const& name,
ImportCertificateOptions const& options,
Azure::Core::Context const& context = Azure::Core::Context()) const;
@ -458,11 +460,13 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
*
* @remark This operation requires the certificates/create permission.
*
* @param name The name of the certificate.
* @param options The options for the request.
* @param context The context for the operation can be used for request cancellation.
* @return Merged certificate bundle to the vault.
*/
Azure::Response<KeyVaultCertificateWithPolicy> MergeCertificate(
std::string const& name,
MergeCertificateOptions const& options,
Azure::Core::Context const& context = Azure::Core::Context()) const;

View File

@ -1441,7 +1441,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
* needs to contain the private key.
*
*/
std::string Certificate;
std::string Value;
/**
* @brief If the private key in base64EncodedCertificate is encrypted, the password used for
@ -1467,12 +1467,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
*
*/
std::unordered_map<std::string, std::string> Tags;
/**
* @brief The name of the certificate.
*
*/
std::string Name;
};
/**
@ -1495,12 +1489,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
*
*/
std::unordered_map<std::string, std::string> Tags;
/**
* @brief The name of the certificate
*
*/
std::string Name;
};
/**

View File

@ -437,6 +437,7 @@ DeletedCertificatesPagedResponse CertificateClient::GetDeletedCertificates(
}
Azure::Response<KeyVaultCertificateWithPolicy> CertificateClient::ImportCertificate(
std::string const& name,
ImportCertificateOptions const& options,
Azure::Core::Context const& context) const
{
@ -444,15 +445,16 @@ Azure::Response<KeyVaultCertificateWithPolicy> CertificateClient::ImportCertific
Azure::Core::IO::MemoryBodyStream payloadStream(
reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
auto request = CreateRequest(
HttpMethod::Post, {CertificatesPath, options.Name, ImportPath}, &payloadStream);
auto request
= CreateRequest(HttpMethod::Post, {CertificatesPath, name, ImportPath}, &payloadStream);
auto rawResponse = SendRequest(request, context);
auto value = KeyVaultCertificateSerializer::Deserialize(options.Name, *rawResponse);
auto value = KeyVaultCertificateSerializer::Deserialize(name, *rawResponse);
return Azure::Response<KeyVaultCertificateWithPolicy>(std::move(value), std::move(rawResponse));
}
Azure::Response<KeyVaultCertificateWithPolicy> CertificateClient::MergeCertificate(
std::string const& name,
MergeCertificateOptions const& options,
Azure::Core::Context const& context) const
{
@ -461,10 +463,10 @@ Azure::Response<KeyVaultCertificateWithPolicy> CertificateClient::MergeCertifica
reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
auto request = CreateRequest(
HttpMethod::Post, {CertificatesPath, options.Name, PendingPath, MergePath}, &payloadStream);
HttpMethod::Post, {CertificatesPath, name, PendingPath, MergePath}, &payloadStream);
auto rawResponse = SendRequest(request, context);
auto value = KeyVaultCertificateSerializer::Deserialize(options.Name, *rawResponse);
auto value = KeyVaultCertificateSerializer::Deserialize(name, *rawResponse);
return Azure::Response<KeyVaultCertificateWithPolicy>(std::move(value), std::move(rawResponse));
}

View File

@ -783,7 +783,7 @@ std::string ImportCertificateOptionsSerializer::Serialize(ImportCertificateOptio
{
json importOptions;
importOptions[ValuePropertyName] = options.Certificate;
importOptions[ValuePropertyName] = options.Value;
JsonOptional::SetFromNullable(options.Password, importOptions, PwdPropertyValue);
importOptions[PolicyPropertyName] = CertificatePolicySerializer::JsonSerialize(options.Policy);
importOptions[AttributesPropertyName]

View File

@ -753,15 +753,15 @@ TEST_F(KeyVaultCertificateClientTest, DownloadImportPkcs)
{
auto result = DownloadCertificate(pkcs, client);
ImportCertificateOptions options;
options.Certificate = result.Value.Certificate;
options.Value = result.Value.Certificate;
options.Policy.Enabled = true;
options.Policy.KeyType = CertificateKeyType::Rsa;
options.Policy.KeySize = 2048;
options.Policy.ContentType = CertificateContentType::Pkcs12;
options.Policy.Exportable = true;
options.Name = importName;
auto imported = client.ImportCertificate(options).Value;
auto imported = client.ImportCertificate(importName, options).Value;
EXPECT_EQ(imported.Properties.Name, importName);
EXPECT_EQ(imported.Policy.ContentType.Value(), originalCertificate.Policy.ContentType.Value());
@ -786,16 +786,15 @@ TEST_F(KeyVaultCertificateClientTest, DownloadImportPem)
{
auto result = DownloadCertificate(pem, client);
ImportCertificateOptions options;
options.Certificate = result.Value.Certificate;
options.Value = result.Value.Certificate;
options.Policy.Enabled = true;
options.Policy.KeyType = CertificateKeyType::Rsa;
options.Policy.KeySize = 2048;
options.Policy.ContentType = CertificateContentType::Pem;
options.Policy.Exportable = true;
options.Name = importName;
auto imported = client.ImportCertificate(options).Value;
auto imported = client.ImportCertificate(importName, options).Value;
EXPECT_EQ(imported.Properties.Name, importName);
EXPECT_EQ(imported.Policy.ContentType.Value(), originalCertificate.Policy.ContentType.Value());
@ -880,8 +879,7 @@ TEST_F(KeyVaultCertificateClientTest, DISABLED_MergeCertificate)
{
try
{
mergeOptions.Name = mergeTarget;
auto merged = client.MergeCertificate(mergeOptions);
auto merged = client.MergeCertificate(mergeTarget, mergeOptions);
cont = false;
}
catch (...)