parent
87b8a6146b
commit
697f45a454
@ -101,6 +101,15 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
|
||||
*/
|
||||
std::string Version;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define a model for a purged key.
|
||||
*
|
||||
*/
|
||||
struct PurgedSecret final
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The SecretClient provides synchronous methods to manage a secret in the Azure Key
|
||||
* Vault. The client supports creating, retrieving, updating, deleting, purging, backing up,
|
||||
@ -265,6 +274,21 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
|
||||
Azure::Response<KeyVaultSecret> RestoreSecretBackup(
|
||||
std::vector<uint8_t> const& backup,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
|
||||
/**
|
||||
* @brief Permanently deletes the specified secret.
|
||||
* The purge deleted secret operation removes the secret permanently, without the possibility of
|
||||
* recovery. This operation can only be enabled on a soft-delete enabled vault. This operation
|
||||
* requires the secrets/purge permission.
|
||||
*
|
||||
* @param name The name of the secret<span class="x x-first x-last">.</span>
|
||||
* @param context The context for the operation can be used for request cancellation.
|
||||
*
|
||||
* @return Response<PurgedSecret> is success.
|
||||
*/
|
||||
Azure::Response<PurgedSecret> PurgeDeletedSecret(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context = Azure::Core::Context()) const;
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Security::KeyVault::Secrets
|
||||
|
||||
@ -164,3 +164,14 @@ Azure::Response<KeyVaultSecret> SecretClient::RestoreSecretBackup(
|
||||
},
|
||||
{_detail::SecretPath, _detail::RestoreSecretPath});
|
||||
}
|
||||
|
||||
Azure::Response<PurgedSecret> SecretClient::PurgeDeletedSecret(
|
||||
std::string const& name,
|
||||
Azure::Core::Context const& context) const
|
||||
{
|
||||
return m_protocolClient->SendRequest<PurgedSecret>(
|
||||
context,
|
||||
Azure::Core::Http::HttpMethod::Delete,
|
||||
[](Azure::Core::Http::RawResponse const&) { return PurgedSecret(); },
|
||||
{_detail::DeletedSecretPath, name});
|
||||
}
|
||||
|
||||
@ -29,7 +29,10 @@ int main()
|
||||
// just a response, with a secret
|
||||
// auto response3 = secretClient.GetDeletedSecret("someSecret");
|
||||
|
||||
auto response4 = secretClient.BackupSecret("someSecret2");
|
||||
auto response5 = secretClient.RestoreSecretBackup(response4.Value.Secret);
|
||||
// auto response4 = secretClient.BackupSecret("someSecret2");
|
||||
// auto response5 = secretClient.RestoreSecretBackup(response4.Value.Secret);
|
||||
|
||||
auto response = secretClient.PurgeDeletedSecret("someSecret3");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user