using DodoSSH.Client.Domain; using DodoSSH.Client.Storage; namespace DodoSSH.Client.Sync; /// /// The connections this vault has recorded, decrypted, with unpushed local entries laid over them. /// /// /// /// The seventh facade over the same generic repository, and the first whose UpdateAsync is missing on /// purpose. A connection log entry is written once, at close, and never edited — see /// VaultConnectionLogEntry for why that is what makes a synced log tractable at all — so an update /// method here would be an invitation to break the property the whole design rests on. /// /// /// stays, because retention needs it. It is the only thing that deletes an entry. /// /// public sealed class ConnectionLogRepository(ItemStore items, OutboxStore outbox, VaultKeyring keyring) { private readonly VaultItemRepository entries = new(ConnectionLogEntryKind.Instance, items, outbox, keyring); /// public Task> ListAsync( Guid vaultId, CancellationToken cancellationToken) => entries.ListAsync(vaultId, cancellationToken); /// public Task CreateAsync( Guid vaultId, ConnectionLogSecret entry, CancellationToken cancellationToken) => entries.CreateAsync(vaultId, entry, cancellationToken); /// public Task DeleteAsync(Guid vaultId, Guid entityId, CancellationToken cancellationToken) => entries.DeleteAsync(vaultId, entityId, cancellationToken); } /// /// The keychain changes this vault has recorded, decrypted, with unpushed local entries laid over them. /// /// public sealed class ActivityLogRepository(ItemStore items, OutboxStore outbox, VaultKeyring keyring) { private readonly VaultItemRepository entries = new(ActivityLogEntryKind.Instance, items, outbox, keyring); /// public Task> ListAsync( Guid vaultId, CancellationToken cancellationToken) => entries.ListAsync(vaultId, cancellationToken); /// public Task CreateAsync( Guid vaultId, ActivityLogSecret entry, CancellationToken cancellationToken) => entries.CreateAsync(vaultId, entry, cancellationToken); /// public Task DeleteAsync(Guid vaultId, Guid entityId, CancellationToken cancellationToken) => entries.DeleteAsync(vaultId, entityId, cancellationToken); }