parent
cfd115ed59
commit
613972c4c4
@ -115,6 +115,67 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
CertificateCreateParameters const& parameters,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
/**
|
||||
* @brief Creates a new certificate issuer.
|
||||
*
|
||||
* @details The operation adds or updates the specified certificate issuer.
|
||||
*
|
||||
* @remark This operation requires the certificates/setissuers permission.
|
||||
*
|
||||
* @param issuer The certificate issuer.
|
||||
* @param context The context for the operation can be used for request cancellation.
|
||||
* @return CertificateIssuer instance used to determine create status.
|
||||
*/
|
||||
Azure::Response<CertificateIssuer> CreateIssuer(
|
||||
CertificateIssuer const& issuer,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
/**
|
||||
* @brief Lists the specified certificate issuer.
|
||||
*
|
||||
* @details The GetCertificateIssuer operation returns the specified
|
||||
* certificate issuer resources in the specified key vault.
|
||||
*
|
||||
* @remark This operation requires the certificates/manageissuers/getissuers permission.
|
||||
*
|
||||
* @param name The certificate issuer name.
|
||||
* @param context The context for the operation can be used for request cancellation.
|
||||
* @return CertificateIssuer instance .
|
||||
*/
|
||||
Azure::Response<CertificateIssuer> GetIssuer(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
/**
|
||||
* @brief Updates the specified certificate issuer.
|
||||
*
|
||||
* @details The operation performs an update on the specified certificate issuer entity.
|
||||
*
|
||||
* @remark This operation requires the certificates/setissuers permission.
|
||||
*
|
||||
* @param issuer The certificate issuer.
|
||||
* @param context The context for the operation can be used for request cancellation.
|
||||
* @return CertificateIssuer instance .
|
||||
*/
|
||||
Azure::Response<CertificateIssuer> UpdateIssuer(
|
||||
CertificateIssuer const& issuer,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the specified certificate issuer.
|
||||
*
|
||||
* @details The operation permanently removes the specified certificate issuer from the vault.
|
||||
*
|
||||
* @remark This operation requires the certificates/manageissuers/deleteissuers permission.
|
||||
*
|
||||
* @param name The certificate issuer name.
|
||||
* @param context The context for the operation can be used for request cancellation.
|
||||
* @return CertificateIssuer instance .
|
||||
*/
|
||||
Azure::Response<CertificateIssuer> DeleteIssuer(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> SendRequest(
|
||||
Azure::Core::Http::Request& request,
|
||||
|
||||
@ -832,4 +832,142 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
*/
|
||||
std::unordered_map<std::string, std::string> Tags;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Issuer Credentials
|
||||
*
|
||||
*/
|
||||
struct IssuerCredentials final
|
||||
{
|
||||
/**
|
||||
* @brief Account ID.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> AccountId;
|
||||
|
||||
/**
|
||||
* @brief Password.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> Password;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Administrator details
|
||||
*
|
||||
*/
|
||||
struct AdministratorDetails final
|
||||
{
|
||||
/**
|
||||
* @brief Administrator first name.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> FirstName;
|
||||
|
||||
/**
|
||||
* @brief Administrator last name.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> LastName;
|
||||
|
||||
/**
|
||||
* @brief Administrator email address.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> EmailAddress;
|
||||
|
||||
/**
|
||||
* @brief Administrator phone number.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> PhoneNumber;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Certificate Issuer Properties.
|
||||
*
|
||||
*/
|
||||
struct IssuerProperties final
|
||||
{
|
||||
/**
|
||||
* @brief Issuer enabled.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<bool> Enabled;
|
||||
|
||||
/**
|
||||
* @brief Issuer creation date.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<DateTime> Created;
|
||||
|
||||
/**
|
||||
* @brief Issuer last update date.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<DateTime> Updated;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Organization details.
|
||||
*
|
||||
*/
|
||||
struct OrganizationDetails final
|
||||
{
|
||||
/**
|
||||
* @brief Organization id
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> Id;
|
||||
|
||||
/**
|
||||
* @brief Organization Administators collection.
|
||||
*
|
||||
*/
|
||||
std::vector<AdministratorDetails> AdminDetails;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer.
|
||||
*
|
||||
*/
|
||||
struct CertificateIssuer final
|
||||
{
|
||||
/**
|
||||
* @brief Certificate issuer name.
|
||||
*
|
||||
*/
|
||||
std::string Name;
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer id.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> Id;
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer provider.
|
||||
*
|
||||
*/
|
||||
Azure::Nullable<std::string> Provider;
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer credentials.
|
||||
*
|
||||
*/
|
||||
IssuerCredentials Credentials;
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer organization.
|
||||
*
|
||||
*/
|
||||
OrganizationDetails Organization;
|
||||
|
||||
/**
|
||||
* @brief Certificate issuer properties.
|
||||
*
|
||||
*/
|
||||
IssuerProperties Properties;
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Security::KeyVault::Certificates
|
||||
|
||||
@ -145,4 +145,60 @@ CreateCertificateOperation CertificateClient::StartCreateCertificate(
|
||||
std::make_shared<CertificateClient>(*this), std::move(responseT));
|
||||
}
|
||||
|
||||
Azure::Response<CertificateIssuer> CertificateClient::GetIssuer(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context) const
|
||||
{
|
||||
auto request = CreateRequest(HttpMethod::Get, {CertificatesPath, IssuersPath, name});
|
||||
auto rawResponse = SendRequest(request, context);
|
||||
|
||||
auto value = CertificateIssuerSerializer::Deserialize(name, *rawResponse);
|
||||
return Azure::Response<CertificateIssuer>(std::move(value), std::move(rawResponse));
|
||||
}
|
||||
|
||||
Azure::Response<CertificateIssuer> CertificateClient::DeleteIssuer(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context) const
|
||||
{
|
||||
auto request = CreateRequest(HttpMethod::Delete, {CertificatesPath, IssuersPath, name});
|
||||
auto rawResponse = SendRequest(request, context);
|
||||
|
||||
auto value = CertificateIssuerSerializer::Deserialize(name, *rawResponse);
|
||||
return Azure::Response<CertificateIssuer>(std::move(value), std::move(rawResponse));
|
||||
}
|
||||
|
||||
Azure::Response<CertificateIssuer> CertificateClient::CreateIssuer(
|
||||
CertificateIssuer const& issuer,
|
||||
Azure::Core::Context const& context) const
|
||||
{
|
||||
std::string name = issuer.Name;
|
||||
auto payload = CertificateIssuerSerializer::Serialize(issuer);
|
||||
Azure::Core::IO::MemoryBodyStream payloadStream(
|
||||
reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
|
||||
|
||||
auto request
|
||||
= CreateRequest(HttpMethod::Put, {CertificatesPath, IssuersPath, name}, &payloadStream);
|
||||
|
||||
auto rawResponse = SendRequest(request, context);
|
||||
auto value = CertificateIssuerSerializer::Deserialize(name, *rawResponse);
|
||||
return Azure::Response<CertificateIssuer>(std::move(value), std::move(rawResponse));
|
||||
}
|
||||
|
||||
Azure::Response<CertificateIssuer> CertificateClient::UpdateIssuer(
|
||||
CertificateIssuer const& issuer,
|
||||
Azure::Core::Context const& context) const
|
||||
{
|
||||
std::string name = issuer.Name;
|
||||
auto payload = CertificateIssuerSerializer::Serialize(issuer);
|
||||
Azure::Core::IO::MemoryBodyStream payloadStream(
|
||||
reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
|
||||
|
||||
auto request
|
||||
= CreateRequest(HttpMethod::Patch, {CertificatesPath, IssuersPath, name}, &payloadStream);
|
||||
|
||||
auto rawResponse = SendRequest(request, context);
|
||||
auto value = CertificateIssuerSerializer::Deserialize(name, *rawResponse);
|
||||
return Azure::Response<CertificateIssuer>(std::move(value), std::move(rawResponse));
|
||||
}
|
||||
|
||||
const ServiceVersion ServiceVersion::V7_2("7.2");
|
||||
|
||||
@ -381,3 +381,111 @@ std::string CertificateCreateParametersSerializer::Serialize(
|
||||
|
||||
return parameter.dump();
|
||||
}
|
||||
|
||||
CertificateIssuer CertificateIssuerSerializer::Deserialize(
|
||||
std::string const& name,
|
||||
Azure::Core::Http::RawResponse const& rawResponse)
|
||||
{
|
||||
CertificateIssuer issuer;
|
||||
issuer.Name = name;
|
||||
auto const& body = rawResponse.GetBody();
|
||||
auto jsonResponse = json::parse(body);
|
||||
|
||||
issuer.Id = jsonResponse[IdName];
|
||||
issuer.Provider = jsonResponse[ProviderPropertyValue];
|
||||
|
||||
if (jsonResponse.contains(CredentialsPropertyValue))
|
||||
{
|
||||
auto credentialsJson = jsonResponse[CredentialsPropertyValue];
|
||||
JsonOptional::SetIfExists(issuer.Credentials.AccountId, credentialsJson, AccountIdValue);
|
||||
JsonOptional::SetIfExists(issuer.Credentials.Password, credentialsJson, PwdPropertyValue);
|
||||
}
|
||||
|
||||
if (jsonResponse.contains(OrgDetailsPropertyValue))
|
||||
{
|
||||
auto orgJson = jsonResponse[OrgDetailsPropertyValue];
|
||||
JsonOptional::SetIfExists(issuer.Organization.Id, orgJson, IdName);
|
||||
|
||||
for (auto adminJson : orgJson[AdminDetailsPropertyValue])
|
||||
{
|
||||
AdministratorDetails admin;
|
||||
JsonOptional::SetIfExists(admin.EmailAddress, adminJson, EmailPropertyValue);
|
||||
JsonOptional::SetIfExists(admin.FirstName, adminJson, FirstNamePropertyValue);
|
||||
JsonOptional::SetIfExists(admin.LastName, adminJson, LastNamePropertyValue);
|
||||
JsonOptional::SetIfExists(admin.PhoneNumber, adminJson, PhonePropertyValue);
|
||||
|
||||
issuer.Organization.AdminDetails.emplace_back(admin);
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonResponse.contains(AttributesPropertyName))
|
||||
{
|
||||
auto attributesJson = jsonResponse[AttributesPropertyName];
|
||||
|
||||
JsonOptional::SetIfExists(issuer.Properties.Enabled, attributesJson, EnabledPropertyName);
|
||||
JsonOptional::SetIfExists<int64_t, Azure::DateTime>(
|
||||
issuer.Properties.Created,
|
||||
attributesJson,
|
||||
CreatedPropertyName,
|
||||
PosixTimeConverter::PosixTimeToDateTime);
|
||||
JsonOptional::SetIfExists<int64_t, Azure::DateTime>(
|
||||
issuer.Properties.Updated,
|
||||
attributesJson,
|
||||
UpdatedPropertyName,
|
||||
PosixTimeConverter::PosixTimeToDateTime);
|
||||
}
|
||||
|
||||
return issuer;
|
||||
}
|
||||
|
||||
std::string CertificateIssuerSerializer::Serialize(CertificateIssuer const& issuer)
|
||||
{
|
||||
|
||||
json jsonResponse;
|
||||
JsonOptional::SetFromNullable(issuer.Provider, jsonResponse, ProviderPropertyValue);
|
||||
|
||||
{
|
||||
json credentialsJson;
|
||||
JsonOptional::SetFromNullable(issuer.Credentials.AccountId, credentialsJson, AccountIdValue);
|
||||
JsonOptional::SetFromNullable(issuer.Credentials.Password, credentialsJson, PwdPropertyValue);
|
||||
jsonResponse[CredentialsPropertyValue] = credentialsJson;
|
||||
}
|
||||
|
||||
{
|
||||
json orgJson;
|
||||
JsonOptional::SetFromNullable(issuer.Organization.Id, orgJson, IdName);
|
||||
|
||||
for (auto admin : issuer.Organization.AdminDetails)
|
||||
{
|
||||
json adminJson;
|
||||
JsonOptional::SetFromNullable(admin.EmailAddress, adminJson, EmailPropertyValue);
|
||||
JsonOptional::SetFromNullable(admin.FirstName, adminJson, FirstNamePropertyValue);
|
||||
JsonOptional::SetFromNullable(admin.LastName, adminJson, LastNamePropertyValue);
|
||||
JsonOptional::SetFromNullable(admin.PhoneNumber, adminJson, PhonePropertyValue);
|
||||
|
||||
orgJson[AdminDetailsPropertyValue].emplace_back(adminJson);
|
||||
}
|
||||
|
||||
jsonResponse[OrgDetailsPropertyValue] = orgJson;
|
||||
}
|
||||
|
||||
{
|
||||
json attributesJson;
|
||||
|
||||
JsonOptional::SetFromNullable(issuer.Properties.Enabled, attributesJson, EnabledPropertyName);
|
||||
JsonOptional::SetFromNullable<Azure::DateTime, int64_t>(
|
||||
issuer.Properties.Created,
|
||||
attributesJson,
|
||||
CreatedPropertyName,
|
||||
PosixTimeConverter::DateTimeToPosixTime);
|
||||
JsonOptional::SetFromNullable<Azure::DateTime, int64_t>(
|
||||
issuer.Properties.Updated,
|
||||
attributesJson,
|
||||
UpdatedPropertyName,
|
||||
PosixTimeConverter::DateTimeToPosixTime);
|
||||
|
||||
jsonResponse[AttributesPropertyName] = attributesJson;
|
||||
}
|
||||
|
||||
return jsonResponse.dump();
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
constexpr static const char KeyVaultServicePackageName[] = "keyvault-certificates";
|
||||
constexpr static const char CertificatesPath[] = "certificates";
|
||||
constexpr static const char CertificatesCreatePath[] = "create";
|
||||
constexpr static const char IssuersPath[] = "issuers";
|
||||
|
||||
/***************** Certificates Properties *****************/
|
||||
constexpr static const char IdName[] = "id";
|
||||
@ -94,4 +95,16 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
constexpr static const char AutoRenewValue[] = "AutoRenew";
|
||||
constexpr static const char EmailContactsValue[] = "EmailContacts";
|
||||
|
||||
/***************** Certificates Issuer Action *****************/
|
||||
constexpr static const char CredentialsPropertyValue[] = "credentials";
|
||||
constexpr static const char AccountIdValue[] = "account_id";
|
||||
constexpr static const char PwdPropertyValue[] = "pwd";
|
||||
constexpr static const char ProviderPropertyValue[] = "provider";
|
||||
constexpr static const char OrgDetailsPropertyValue[] = "org_details";
|
||||
constexpr static const char AdminDetailsPropertyValue[] = "admin_details";
|
||||
constexpr static const char FirstNamePropertyValue[] = "first_name";
|
||||
constexpr static const char LastNamePropertyValue[] = "last_name";
|
||||
constexpr static const char EmailPropertyValue[] = "email";
|
||||
constexpr static const char PhonePropertyValue[] = "phone";
|
||||
|
||||
}}}}} // namespace Azure::Security::KeyVault::Certificates::_detail
|
||||
|
||||
@ -69,8 +69,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
}
|
||||
};
|
||||
|
||||
struct CertificatePropertiesSerializer final
|
||||
{
|
||||
class CertificatePropertiesSerializer final {
|
||||
CertificatePropertiesSerializer() = delete;
|
||||
|
||||
public:
|
||||
static std::string Serialize(CertificateProperties const& properties);
|
||||
static Azure::Core::Json::_internal::json JsonSerialize(
|
||||
CertificateProperties const& properties);
|
||||
@ -79,8 +81,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
Azure::Core::Json::_internal::json fragment);
|
||||
};
|
||||
|
||||
struct CertificatePolicySerializer final
|
||||
{
|
||||
class CertificatePolicySerializer final {
|
||||
CertificatePolicySerializer() = delete;
|
||||
|
||||
public:
|
||||
static std::string Serialize(CertificatePolicy const& policy);
|
||||
static Azure::Core::Json::_internal::json JsonSerialize(CertificatePolicy const& policy);
|
||||
static void Deserialize(
|
||||
@ -88,8 +92,21 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat
|
||||
Azure::Core::Json::_internal::json fragment);
|
||||
};
|
||||
|
||||
struct CertificateCreateParametersSerializer final
|
||||
{
|
||||
class CertificateCreateParametersSerializer final {
|
||||
CertificateCreateParametersSerializer() = delete;
|
||||
|
||||
public:
|
||||
static std::string Serialize(CertificateCreateParameters const& parameters);
|
||||
};
|
||||
|
||||
class CertificateIssuerSerializer final {
|
||||
CertificateIssuerSerializer() = delete;
|
||||
|
||||
public:
|
||||
static CertificateIssuer Deserialize(
|
||||
std::string const& name,
|
||||
Azure::Core::Http::RawResponse const& rawResponse);
|
||||
|
||||
static std::string Serialize(CertificateIssuer const& issuer);
|
||||
};
|
||||
}}}}} // namespace Azure::Security::KeyVault::Certificates::_detail
|
||||
|
||||
@ -83,7 +83,7 @@ namespace Azure {
|
||||
Azure::Security::KeyVault::Certificates::CertificateClient const& GetClientForTest(
|
||||
std::string const& testName)
|
||||
{
|
||||
// used for updating testing mode_putenv_s("AZURE_TEST_MODE", "PLAYBACK");
|
||||
// used to test/dev purposes _putenv_s("AZURE_TEST_MODE", "PLAYBACK");
|
||||
InitializeClient();
|
||||
// set the interceptor for the current test
|
||||
m_testContext.RenameTest(testName);
|
||||
@ -160,6 +160,25 @@ namespace Azure {
|
||||
static_cast<typename std::underlying_type<Azure::Core::Http::HttpStatusCode>::type>(
|
||||
expectedCode));
|
||||
}
|
||||
|
||||
static void CheckIssuers(CertificateIssuer const& data, CertificateIssuer const& issuer)
|
||||
{
|
||||
EXPECT_EQ(data.Name, issuer.Name);
|
||||
EXPECT_EQ(data.Provider.Value(), issuer.Provider.Value());
|
||||
EXPECT_TRUE(data.Properties.Enabled.Value());
|
||||
EXPECT_TRUE(data.Id.HasValue());
|
||||
|
||||
EXPECT_EQ(data.Credentials.AccountId.Value(), issuer.Credentials.AccountId.Value());
|
||||
EXPECT_FALSE(data.Credentials.Password.HasValue());
|
||||
|
||||
auto adminRemote = data.Organization.AdminDetails[0];
|
||||
auto adminLocal = issuer.Organization.AdminDetails[0];
|
||||
|
||||
EXPECT_EQ(adminLocal.EmailAddress.Value(), adminRemote.EmailAddress.Value());
|
||||
EXPECT_EQ(adminLocal.FirstName.Value(), adminRemote.FirstName.Value());
|
||||
EXPECT_EQ(adminLocal.LastName.Value(), adminRemote.LastName.Value());
|
||||
EXPECT_EQ(adminLocal.PhoneNumber.Value(), adminRemote.PhoneNumber.Value());
|
||||
}
|
||||
};
|
||||
|
||||
}}}}} // namespace Azure::Security::KeyVault::Certificates::Test
|
||||
|
||||
@ -193,3 +193,76 @@ TEST_F(KeyVaultCertificateClientTest, DISABLED_GetCertificateVersion)
|
||||
EXPECT_NE(cert.Cer.size(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(KeyVaultCertificateClientTest, CreateGetIssuer)
|
||||
{
|
||||
auto const& client
|
||||
= GetClientForTest(::testing::UnitTest::GetInstance()->current_test_info()->name());
|
||||
|
||||
CertificateIssuer issuer;
|
||||
issuer.Name = "issuer01";
|
||||
issuer.Provider = "Test";
|
||||
issuer.Properties.Enabled = true;
|
||||
issuer.Credentials.AccountId = "keyvaultuser";
|
||||
issuer.Credentials.Password = "password";
|
||||
|
||||
AdministratorDetails admin;
|
||||
admin.FirstName = "John";
|
||||
admin.LastName = "Doe";
|
||||
admin.EmailAddress = "admin@microsoft.com";
|
||||
admin.PhoneNumber = "4255555555";
|
||||
|
||||
issuer.Organization.AdminDetails.emplace_back(admin);
|
||||
|
||||
{
|
||||
auto result = client.CreateIssuer(issuer);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
|
||||
{
|
||||
auto result = client.GetIssuer(issuer.Name);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
|
||||
{
|
||||
auto result = client.DeleteIssuer(issuer.Name);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(KeyVaultCertificateClientTest, UpdateIssuer)
|
||||
{
|
||||
auto const& client
|
||||
= GetClientForTest(::testing::UnitTest::GetInstance()->current_test_info()->name());
|
||||
|
||||
CertificateIssuer issuer;
|
||||
issuer.Name = "issuer01";
|
||||
issuer.Provider = "Test";
|
||||
issuer.Properties.Enabled = true;
|
||||
issuer.Credentials.AccountId = "keyvaultuser";
|
||||
issuer.Credentials.Password = "password";
|
||||
|
||||
AdministratorDetails admin;
|
||||
admin.FirstName = "John";
|
||||
admin.LastName = "Doe";
|
||||
admin.EmailAddress = "admin@microsoft.com";
|
||||
admin.PhoneNumber = "4255555555";
|
||||
|
||||
issuer.Organization.AdminDetails.emplace_back(admin);
|
||||
|
||||
{
|
||||
auto result = client.CreateIssuer(issuer);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
|
||||
{
|
||||
issuer.Credentials.Password = "password2";
|
||||
auto result = client.UpdateIssuer(issuer);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
|
||||
{
|
||||
auto result = client.DeleteIssuer(issuer.Name);
|
||||
CheckIssuers(result.Value, issuer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
{
|
||||
"networkCallRecords": [
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "20b2c6bc-1356-4b0a-536a-9f0ecf70e4ca"
|
||||
},
|
||||
"Method": "PUT",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "20b2c6bc-1356-4b0a-536a-9f0ecf70e4ca",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "e9de782a-fa4f-4087-a644-446bc6523cc1",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
},
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "6c507224-d21f-43bd-7384-9e6095e969a2"
|
||||
},
|
||||
"Method": "GET",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "6c507224-d21f-43bd-7384-9e6095e969a2",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "dfd773a0-025f-4db0-bf9c-8f073231ef7b",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
},
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "79f54ba3-1215-4732-7a77-b9d3583c35c7"
|
||||
},
|
||||
"Method": "DELETE",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "79f54ba3-1215-4732-7a77-b9d3583c35c7",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "8629c6bd-b226-4c05-b696-fb9f491bbc42",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
{
|
||||
"networkCallRecords": [
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "e6a97bb8-f607-4013-6254-76d397a0c4b6"
|
||||
},
|
||||
"Method": "PUT",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "e6a97bb8-f607-4013-6254-76d397a0c4b6",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "af9140eb-e3ce-435f-9a5e-56ac84bb9646",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
},
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "df3ae7db-5eca-4aaf-5c81-17a020b236a8"
|
||||
},
|
||||
"Method": "PATCH",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "df3ae7db-5eca-4aaf-5c81-17a020b236a8",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "5a01f575-4147-47fc-92ea-caa536aea29e",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
},
|
||||
{
|
||||
"Headers": {
|
||||
"content-type": "application/json",
|
||||
"user-agent": "azsdk-cpp-keyvault-certificates/4.0.0-beta.1 (Windows 10 Enterprise 6.3 19043 19041.1.amd64fre.vb_release.191206-1406)",
|
||||
"x-ms-client-request-id": "82b269a5-94c6-4b19-7f4c-f5f88c94d9ce"
|
||||
},
|
||||
"Method": "DELETE",
|
||||
"Response": {
|
||||
"BODY": "{\"id\":\"https://REDACTED.vault.azure.net/certificates/issuers/issuer01\",\"provider\":\"Test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"John\",\"last_name\":\"Doe\",\"email\":\"admin@microsoft.com\",\"phone\":\"4255555555\"}]},\"attributes\":{\"enabled\":true,\"created\":1632175983,\"updated\":1632175983}}",
|
||||
"STATUS_CODE": "200",
|
||||
"cache-control": "no-cache",
|
||||
"content-length": "343",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"date": "Mon, 20 Sep 2021 22:13:03 GMT",
|
||||
"expires": "-1",
|
||||
"pragma": "no-cache",
|
||||
"strict-transport-security": "max-age=31536000;includeSubDomains",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-ms-client-request-id": "82b269a5-94c6-4b19-7f4c-f5f88c94d9ce",
|
||||
"x-ms-keyvault-network-info": "conn_type=Ipv4;addr=24.22.157.72;act_addr_fam=InterNetwork;",
|
||||
"x-ms-keyvault-region": "westus2",
|
||||
"x-ms-keyvault-service-version": "1.9.79.2",
|
||||
"x-ms-request-id": "568a3e29-9086-4d4d-ae64-1c295ea65fba",
|
||||
"x-powered-by": "ASP.NET"
|
||||
},
|
||||
"Url": "https://REDACTED.vault.azure.net/certificates/issuers/issuer01?api-version=7.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user