using DodoSSH.Client.Domain;
using DodoSSH.Client.Storage;
namespace DodoSSH.Client.Sync;
///
/// The Spelunk keys in this vault, decrypted, with unpushed local changes laid over them.
///
///
/// Another facade over the same generic repository. A key is read when the vault is listed and again at
/// connect, from the list, like a credential's password.
///
public sealed class SpelunkKeyRepository(
ItemStore items,
OutboxStore outbox,
VaultKeyring keyring,
IActivityLogSink? activity = null)
{
private readonly VaultItemRepository keys =
new(SpelunkKeyKind.Instance, items, outbox, keyring, activity);
///
public Task> ListAsync(
Guid vaultId,
CancellationToken cancellationToken) =>
keys.ListAsync(vaultId, cancellationToken);
///
public Task CreateAsync(
Guid vaultId,
SpelunkKeySecret key,
CancellationToken cancellationToken) =>
keys.CreateAsync(vaultId, key, cancellationToken);
///
public Task UpdateAsync(
Guid vaultId,
Guid entityId,
SpelunkKeySecret key,
CancellationToken cancellationToken) =>
keys.UpdateAsync(vaultId, entityId, key, cancellationToken);
///
public Task DeleteAsync(Guid vaultId, Guid entityId, CancellationToken cancellationToken) =>
keys.DeleteAsync(vaultId, entityId, cancellationToken);
}