/// <summary> /// Deletes the version of the secret requested - or the most recent version if version parameter is zero. /// <para> Set secretVersion parameter as follows:</para> /// <para> (Default) set to 0 to delete the most recent version.</para> /// <para> Set to -1 to use the version number specified in the secret object as the version to delete.</para> /// <para> Set to any positive number to delete that specific version from the Vault Instance Store.</para> /// </summary> /// <param name="secretObj">The KV2Secret object to be deleted from the Vault</param> /// <param name="secretVersion">The version of the secret to delete.</param> /// <returns>True if successful. False otherwise.</returns> public async Task <bool> DeleteSecretVersion(IKV2Secret secretObj, int secretVersion = 0) { if (secretVersion == -1) { secretVersion = secretObj.Version; } return(await DeleteSecretVersion(secretObj.FullPath, secretVersion)); }
/// <summary> /// Lists all the children secrets of the provided Secret Object /// </summary> /// <param name="secretObj">The secret object that you wish to get a list of children of</param> /// <returns></returns> public async Task <List <string> > ListSecretsAtPath(IKV2Secret secretObj) { return(await ListSecretsAtPath(secretObj.FullPath)); }
/// <summary> /// Returns the Secret MetaData Object Information for the provided Secret Object /// </summary> /// <param name="secretObj"></param> /// <returns></returns> public async Task <KV2SecretMetaDataInfo> GetSecretMetaData(IKV2Secret secretObj) { return(await GetSecretMetaData(secretObj.FullPath)); }
/// <summary> /// Permanently deletes the given secret. /// </summary> /// <param name="secretObj">The secret object to be deleted</param> /// <param name="version">The specific version of the secret to be deleted.</param> /// <returns></returns> public async Task <bool> DestroySecretVersion(IKV2Secret secretObj, int version) { return(await DestroySecretVersion(secretObj.FullPath, version)); }
/// <summary> /// Completely destroys a secret, removing all evidence of it from the Vault /// </summary> /// <param name="secretObj">The Secret Object to be permanently removed</param> /// <returns></returns> public async Task <bool> DestroySecretCompletely(IKV2Secret secretObj) { return(await DestroySecretCompletely(secretObj.FullPath)); }