// Copyright (C) 2023 Vaughn Nugent // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . using System.Threading.Tasks; using VNLib.Utils.Memory; namespace NVault.VaultExtensions { /// /// Represents a vault key-value store that can be used to store secrets /// public interface IKvVaultStore { /// /// Deletes a secret from the vault /// /// The user scope of the secret /// The path to the secret /// A task that returns when the operation has completed Task DeleteSecretAsync(VaultUserScope user, string path); /// /// Sets a secret in the vault at the specified path and user scope /// /// The user scope to store the value at /// The path to the secret /// The secret value to set /// A task that resolves when the secret has been updated Task SetSecretAsync(VaultUserScope user, string path, PrivateString secret); /// /// Gets a secret from the vault at the specified path and user scope /// /// The user scope to get the value from /// The secret path /// A task that resolves the secret if found, null otherwise Task GetSecretAsync(VaultUserScope user, string path); } }