Public Access
Add the encrypted local cache and the sync client
Three new client projects, and the wire-contract fix they needed. DodoSSH.Client.Domain holds the decrypted item model and the three-way merge, with no I/O at all — so the suite that decides whether a credential can be lost runs in milliseconds with nothing to mock. Scalars defer to the server on a genuine clash so every replica resolves the same triple identically and two clients cannot ping-pong; directives merge per name so two people each adding one both keep theirs; the jump chain merges as a whole value because its order is the route. Whatever loses is returned rather than dropped. DodoSSH.Client.Storage is EF Core on SQLite, no SQLCipher: the rows are already ciphertext, so an encrypted file would protect protected bytes at the cost of a native dependency. It keeps the server's state and the outbox in separate tables, which is what preserves the common ancestor a merge needs. One pending operation per item, enforced by a unique index. DodoSSH.Client.Sync is the pull/apply/push loop. Pulling never decrypts — a change with no local work pending is plumbed as ciphertext — so a first sync of thousands of items does not run twice as many AEAD operations for nothing. Contracts: EncryptedPayload gains WrappedDataKey and DataKeyId. The specification has required a per-item data key since crypto.md §3, the columns have existed since the first migration and DshAad.ItemPayload binds the id, but this record had nowhere to put either — so a spec-compliant item could not be transmitted at all. Found by writing the client that has to produce one. Also closes a hole in AadResourceType, which had no value for the HostTag and HostCredential that SyncEntityType has always listed. Four bugs the tests found, not review: - SQLite refuses to order or compare its own DateTimeOffset mapping, and throws at execution rather than model build. Collecting tombstones and listing conflicts are both that shape, so this was a crash waiting for the first user with a deleted host. Timestamps are integers now, by convention so a later field cannot be the one left unconverted. - SQLitePCLRaw 2.1.11, which EF resolves, is covered by GHSA-2m69-gcr7-jv3q. Pinned forward as a family. - Resurrecting content from a remote deletion cleared the original before queueing the copy. Two transactions, so a crash between them lost the work; reversed, and the rescued id is derived from the tombstone so a replay coalesces instead of duplicating. - Several equality assertions went through Shouldly's ShouldBe, which compares IEnumerable element-wise and so tested nothing about the Equals these types exist to provide. Corrected; the falsification that caught it went from 2 failures to 6. The push response's cursor is deliberately ignored. It sits after this client's own writes, so adopting it skips anything another client committed at a lower sequence in the window between a pull and a push — permanently. Re-reading one's own writes is idempotent and costs a page. The Contracts doc that invited the shortcut now says so. 593 tests, up from 448. The delete-versus-edit rules, the ancestor retention, the fresh operation id on coalesce and the cursor safeguard were each verified by breaking them and watching the right test fail.
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
using DodoSSH.Contracts;
|
||||
using DodoSSH.Crypto;
|
||||
|
||||
namespace DodoSSH.Client.Storage.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// A migrated, unlocked cache for one test.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each harness gets its own in-memory database, so tests cannot interfere and can run in parallel.
|
||||
/// The Argon2id cost is deliberately far below the shipped profile — 8 MiB and one pass rather than
|
||||
/// 256 MiB and four. The stretching is what makes a stolen wrap expensive to attack, and none of these
|
||||
/// tests attack one; paying 320 ms per test to prove nothing would only encourage sharing state
|
||||
/// between them.
|
||||
/// </remarks>
|
||||
internal sealed class CacheHarness : IDisposable
|
||||
{
|
||||
private static readonly Argon2Profile CheapProfile =
|
||||
Argon2Profile.FromStoredParameters(memoryKibibytes: 8 * 1024, passes: 1, parallelism: 1);
|
||||
|
||||
private readonly MasterKey master;
|
||||
|
||||
private CacheHarness(ClientCacheFactory factory, MasterKey master, LocalCacheProtector protector)
|
||||
{
|
||||
Factory = factory;
|
||||
this.master = master;
|
||||
Protector = protector;
|
||||
|
||||
Items = new ItemStore(factory, protector);
|
||||
Outbox = new OutboxStore(factory, protector, TimeProvider.System);
|
||||
Vaults = new VaultStore(factory, TimeProvider.System);
|
||||
Unlock = new UnlockStore(factory, TimeProvider.System);
|
||||
SyncState = new SyncStateStore(factory);
|
||||
Conflicts = new ConflictStore(factory, protector, TimeProvider.System);
|
||||
}
|
||||
|
||||
internal static Guid VaultId { get; } = Guid.Parse("0192f0c8-aaaa-7c3d-8e4f-5a6b7c8d9e0f");
|
||||
|
||||
internal static Guid UserId { get; } = Guid.Parse("0192f0c8-bbbb-7c3d-8e4f-5a6b7c8d9e0f");
|
||||
|
||||
internal ClientCacheFactory Factory { get; }
|
||||
|
||||
internal LocalCacheProtector Protector { get; }
|
||||
|
||||
internal ItemStore Items { get; }
|
||||
|
||||
internal OutboxStore Outbox { get; }
|
||||
|
||||
internal VaultStore Vaults { get; }
|
||||
|
||||
internal UnlockStore Unlock { get; }
|
||||
|
||||
internal SyncStateStore SyncState { get; }
|
||||
|
||||
internal ConflictStore Conflicts { get; }
|
||||
|
||||
internal static async Task<CacheHarness> CreateAsync(
|
||||
string passphrase = "correct horse battery staple")
|
||||
{
|
||||
var factory = ClientCacheFactory.ForMemory($"cache-{Guid.CreateVersion7():N}");
|
||||
|
||||
try
|
||||
{
|
||||
await factory.MigrateAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
var salt = new byte[CryptoSpec.SaltSize];
|
||||
var derived = MasterKey.Derive(passphrase, salt, CheapProfile);
|
||||
|
||||
return new CacheHarness(factory, derived, LocalCacheProtector.From(derived));
|
||||
}
|
||||
catch
|
||||
{
|
||||
factory.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
Protector.Dispose();
|
||||
master.Dispose();
|
||||
Factory.Dispose();
|
||||
}
|
||||
|
||||
// ---- Builders ----
|
||||
|
||||
internal static EncryptedPayload Payload(byte seed = 1, uint keyGeneration = 1) =>
|
||||
new(
|
||||
Envelope: [seed, (byte)(seed + 1), (byte)(seed + 2)],
|
||||
WrappedDataKey: [(byte)(seed + 10), (byte)(seed + 11)],
|
||||
DataKeyId: Guid.Parse($"0192f0c8-cccc-7c3d-8e4f-5a6b7c8d9e{seed:x2}"),
|
||||
KeyGeneration: keyGeneration,
|
||||
AadVersion: CryptoSpec.CurrentAadVersion);
|
||||
|
||||
internal static StoredItem Item(
|
||||
Guid entityId,
|
||||
int version = 1,
|
||||
long changeSequence = 1,
|
||||
byte seed = 1,
|
||||
bool deleted = false,
|
||||
SyncPlaintextFields? fields = null) =>
|
||||
new(
|
||||
VaultId,
|
||||
SyncEntityType.Host,
|
||||
entityId,
|
||||
version,
|
||||
changeSequence,
|
||||
deleted ? null : Payload(seed),
|
||||
deleted ? null : fields ?? new SyncPlaintextFields(),
|
||||
deleted,
|
||||
DateTimeOffset.FromUnixTimeSeconds(1_750_000_000 + changeSequence));
|
||||
|
||||
internal static QueuedChange Change(
|
||||
Guid entityId,
|
||||
SyncOperation operation = SyncOperation.Upsert,
|
||||
int? expectedVersion = null,
|
||||
byte seed = 1,
|
||||
StoredAncestor? ancestor = null,
|
||||
SyncPlaintextFields? fields = null) =>
|
||||
new(
|
||||
VaultId,
|
||||
SyncEntityType.Host,
|
||||
entityId,
|
||||
operation,
|
||||
expectedVersion,
|
||||
operation == SyncOperation.Delete ? null : Payload(seed),
|
||||
operation == SyncOperation.Delete ? null : fields ?? new SyncPlaintextFields(),
|
||||
ancestor);
|
||||
}
|
||||
@@ -0,0 +1,401 @@
|
||||
using DodoSSH.Contracts;
|
||||
using DodoSSH.Crypto;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static DodoSSH.Client.Storage.Tests.CacheHarness;
|
||||
|
||||
namespace DodoSSH.Client.Storage.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The item mirror, the vault list, the sync cursor, and the conflict log.
|
||||
/// </summary>
|
||||
public sealed class CacheStoreTests : IAsyncLifetime
|
||||
{
|
||||
private CacheHarness harness = null!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask InitializeAsync() => harness = await CreateAsync();
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
harness.Dispose();
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
// ---- Items ----
|
||||
|
||||
[Fact]
|
||||
public async Task AnItem_RoundTripsItsCiphertextByteForByte()
|
||||
{
|
||||
// Not "equivalent" — identical. The AAD binds the row, so re-encrypting locally would work but
|
||||
// would throw away the ability to notice the server handing back bytes it should not have.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var item = Item(entityId, version: 4, changeSequence: 17, seed: 3);
|
||||
|
||||
await harness.Items.SaveAsync(item, Token);
|
||||
|
||||
var read = await harness.Items.FindAsync(VaultId, SyncEntityType.Host, entityId, Token);
|
||||
|
||||
read.ShouldNotBeNull();
|
||||
read.Version.ShouldBe(4);
|
||||
read.ChangeSequence.ShouldBe(17);
|
||||
read.Payload.ShouldNotBeNull();
|
||||
read.Payload.Envelope.ShouldBe(item.Payload!.Envelope);
|
||||
read.Payload.WrappedDataKey.ShouldBe(item.Payload.WrappedDataKey);
|
||||
read.Payload.DataKeyId.ShouldBe(item.Payload.DataKeyId);
|
||||
read.Payload.KeyGeneration.ShouldBe(item.Payload.KeyGeneration);
|
||||
read.Payload.AadVersion.ShouldBe(item.Payload.AadVersion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ThePlaintextFields_RoundTripAndAreNotReadableInTheDatabase()
|
||||
{
|
||||
// The server has to hold a relay-enabled host's address in the clear because it resolves it.
|
||||
// This machine already holds the key that opens the payload, so leaving the address readable in
|
||||
// a file that ends up in a backup buys nothing.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var fields = new SyncPlaintextFields(
|
||||
RelayEnabled: true, Hostname: "bastion.internal", Port: 2222);
|
||||
|
||||
await harness.Items.SaveAsync(Item(entityId, fields: fields), Token);
|
||||
|
||||
var read = await harness.Items.FindAsync(VaultId, SyncEntityType.Host, entityId, Token);
|
||||
read!.Fields.ShouldBe(fields);
|
||||
|
||||
var stored = await ReadRawFieldsAsync(entityId);
|
||||
stored.ShouldNotBeNull();
|
||||
|
||||
System.Text.Encoding.UTF8.GetString(stored)
|
||||
.Contains("bastion.internal", StringComparison.Ordinal)
|
||||
.ShouldBeFalse("the hostname is stored in the clear");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ACacheRecord_CannotBeMovedToAnotherRow()
|
||||
{
|
||||
// Why the record is bound to its own row rather than only to the user. Swapping two rows would
|
||||
// otherwise point one host's connection at another host's address.
|
||||
var mine = Guid.CreateVersion7();
|
||||
var other = Guid.CreateVersion7();
|
||||
|
||||
var sealedFields = harness.Protector.Protect(
|
||||
CryptoSpec.AadResourceType.Host,
|
||||
mine,
|
||||
PlaintextFieldsCodec.Encode(new SyncPlaintextFields(true, "mine.internal", 22)));
|
||||
|
||||
harness.Protector
|
||||
.TryUnprotect(CryptoSpec.AadResourceType.Host, other, sealedFields)
|
||||
.ShouldBeNull();
|
||||
|
||||
harness.Protector
|
||||
.TryUnprotect(CryptoSpec.AadResourceType.Credential, mine, sealedFields)
|
||||
.ShouldBeNull();
|
||||
|
||||
harness.Protector
|
||||
.TryUnprotect(CryptoSpec.AadResourceType.Host, mine, sealedFields)
|
||||
.ShouldNotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ARecordSealedUnderAnotherPassphrase_DoesNotOpen()
|
||||
{
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
using var stranger = await CreateAsync(passphrase: "a completely different passphrase");
|
||||
|
||||
var sealedFields = stranger.Protector.Protect(
|
||||
CryptoSpec.AadResourceType.Host, entityId, [1, 2, 3]);
|
||||
|
||||
harness.Protector
|
||||
.TryUnprotect(CryptoSpec.AadResourceType.Host, entityId, sealedFields)
|
||||
.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SavingTwice_ReplacesRatherThanDuplicates()
|
||||
{
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
await harness.Items.SaveAsync(Item(entityId, version: 1, seed: 1), Token);
|
||||
await harness.Items.SaveAsync(Item(entityId, version: 2, seed: 9), Token);
|
||||
|
||||
var items = await harness.Items.ListAsync(VaultId, SyncEntityType.Host, false, Token);
|
||||
|
||||
items.ShouldHaveSingleItem().Version.ShouldBe(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ATombstone_IsHiddenFromTheListButStillFindable()
|
||||
{
|
||||
// The interface must not show a deleted host. The sync engine must still be able to tell a
|
||||
// deleted item from one it has never seen — a row that simply vanished is indistinguishable
|
||||
// from the latter, and would silently reappear.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
await harness.Items.SaveAsync(Item(entityId, version: 1), Token);
|
||||
await harness.Items.SaveAsync(Item(entityId, version: 2, deleted: true), Token);
|
||||
|
||||
(await harness.Items.ListAsync(VaultId, SyncEntityType.Host, false, Token)).ShouldBeEmpty();
|
||||
|
||||
var withDeleted = await harness.Items.ListAsync(VaultId, SyncEntityType.Host, true, Token);
|
||||
withDeleted.ShouldHaveSingleItem().IsDeleted.ShouldBeTrue();
|
||||
|
||||
var found = await harness.Items.FindAsync(VaultId, SyncEntityType.Host, entityId, Token);
|
||||
found.ShouldNotBeNull();
|
||||
found.IsDeleted.ShouldBeTrue();
|
||||
found.Payload.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CollectingTombstones_LeavesLiveItemsAlone()
|
||||
{
|
||||
var live = Guid.CreateVersion7();
|
||||
var dead = Guid.CreateVersion7();
|
||||
|
||||
await harness.Items.SaveAsync(Item(live, changeSequence: 1), Token);
|
||||
await harness.Items.SaveAsync(Item(dead, changeSequence: 2, deleted: true), Token);
|
||||
|
||||
var cutoff = DateTimeOffset.FromUnixTimeSeconds(1_750_000_100);
|
||||
var collected = await harness.Items.CollectTombstonesAsync(VaultId, cutoff, Token);
|
||||
|
||||
collected.ShouldBe(1);
|
||||
|
||||
var remaining = await harness.Items.ListAsync(VaultId, SyncEntityType.Host, true, Token);
|
||||
remaining.ShouldHaveSingleItem().EntityId.ShouldBe(live);
|
||||
}
|
||||
|
||||
// ---- Vaults ----
|
||||
|
||||
[Fact]
|
||||
public async Task ReplacingTheVaultList_AddsUpdatesAndRemoves()
|
||||
{
|
||||
var keep = Guid.CreateVersion7();
|
||||
var drop = Guid.CreateVersion7();
|
||||
|
||||
await harness.Vaults.ReplaceAllAsync(
|
||||
[Vault(keep, "Personal", 1), Vault(drop, "Old team", 1)], Token);
|
||||
|
||||
await harness.Vaults.ReplaceAllAsync([Vault(keep, "Renamed", 2)], Token);
|
||||
|
||||
var vaults = await harness.Vaults.ListAsync(Token);
|
||||
var only = vaults.ShouldHaveSingleItem();
|
||||
|
||||
only.VaultId.ShouldBe(keep);
|
||||
only.Name.ShouldBe("Renamed");
|
||||
only.KeyGeneration.ShouldBe(2u);
|
||||
(await harness.Vaults.FindAsync(drop, Token)).ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AVaultsWrappedKey_IsCachedSoAnOfflineLaunchCanDecrypt()
|
||||
{
|
||||
// Without this, an offline start could unlock the identity bundle and still not open a single
|
||||
// item.
|
||||
var vaultId = Guid.CreateVersion7();
|
||||
byte[] wrapped = [9, 9, 9, 9];
|
||||
|
||||
await harness.Vaults.ReplaceAllAsync(
|
||||
[Vault(vaultId, "Personal", 1) with { WrappedVaultKey = wrapped }], Token);
|
||||
|
||||
var read = await harness.Vaults.FindAsync(vaultId, Token);
|
||||
read!.WrappedVaultKey.ShouldBe(wrapped);
|
||||
}
|
||||
|
||||
// ---- Unlock material ----
|
||||
|
||||
[Fact]
|
||||
public async Task TheUnlockMaterial_SurvivesTheContextThatWroteIt()
|
||||
{
|
||||
// The offline unlock story, asserted rather than assumed: a fresh store over the same database
|
||||
// reads back the salt and the wrapped bundle with no network involved.
|
||||
var material = Material();
|
||||
|
||||
await harness.Unlock.SaveAsync(material, Token);
|
||||
|
||||
var reader = new UnlockStore(harness.Factory, TimeProvider.System);
|
||||
var read = await reader.ReadAsync(Token);
|
||||
|
||||
read.ShouldNotBeNull();
|
||||
read.UserId.ShouldBe(material.UserId);
|
||||
read.WrappedPrivateKey.ShouldBe(material.WrappedPrivateKey);
|
||||
read.KdfParameters.Salt.ShouldBe(material.KdfParameters.Salt);
|
||||
read.KdfParameters.MemoryKibibytes.ShouldBe(material.KdfParameters.MemoryKibibytes);
|
||||
read.KdfParameters.Passes.ShouldBe(material.KdfParameters.Passes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SavingTheUnlockMaterialTwice_UpdatesTheSingleRow()
|
||||
{
|
||||
await harness.Unlock.SaveAsync(Material(), Token);
|
||||
await harness.Unlock.SaveAsync(Material() with { Email = "changed@example.com" }, Token);
|
||||
|
||||
var read = await harness.Unlock.ReadAsync(Token);
|
||||
read!.Email.ShouldBe("changed@example.com");
|
||||
|
||||
(await CountUnlockRowsAsync()).ShouldBe(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnotherUsersMaterial_IsRefusedRatherThanMixedIn()
|
||||
{
|
||||
// Adopting it would offer an unlock prompt whose passphrase can never work, and would mix one
|
||||
// user's items into another's vault list.
|
||||
await harness.Unlock.SaveAsync(Material(), Token);
|
||||
|
||||
var other = Material() with { UserId = Guid.CreateVersion7() };
|
||||
|
||||
await Should.ThrowAsync<CacheIdentityMismatchException>(
|
||||
async () => await harness.Unlock.SaveAsync(other, Token));
|
||||
}
|
||||
|
||||
// ---- Sync state ----
|
||||
|
||||
[Fact]
|
||||
public async Task AnUnknownVault_ReadsAsStartingFromTheBeginning()
|
||||
{
|
||||
// Not an error. A null cursor is exactly right for a vault this client has not synced, and is
|
||||
// also the recovery path for a cache that had to be discarded.
|
||||
var state = await harness.SyncState.ReadAsync(Guid.CreateVersion7(), Token);
|
||||
|
||||
state.Cursor.ShouldBeNull();
|
||||
state.KeyGeneration.ShouldBe(0u);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheCursor_IsStoredVerbatim()
|
||||
{
|
||||
// Opaque and integrity-tagged. A client that adjusted one could ask to resume from a position
|
||||
// the server never granted; storing it untouched is the only correct handling.
|
||||
const string Cursor = "v1.aGVsbG8gd29ybGQ.c2lnbmF0dXJl";
|
||||
|
||||
await harness.SyncState.SaveAsync(new StoredSyncState(VaultId, Cursor, 3), Token);
|
||||
|
||||
var read = await harness.SyncState.ReadAsync(VaultId, Token);
|
||||
read.Cursor.ShouldBe(Cursor);
|
||||
read.KeyGeneration.ShouldBe(3u);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ResettingAVault_DropsItsItemsButKeepsTheOutbox()
|
||||
{
|
||||
// Local unpushed changes are the only copy of the user's work. Clearing them along with the
|
||||
// cache would turn a recoverable cache problem into lost work.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
await harness.Items.SaveAsync(Item(entityId), Token);
|
||||
await harness.Outbox.QueueAsync(Change(Guid.CreateVersion7()), Token);
|
||||
await harness.SyncState.SaveAsync(new StoredSyncState(VaultId, "cursor", 1), Token);
|
||||
|
||||
await harness.SyncState.ResetAsync(VaultId, Token);
|
||||
|
||||
(await harness.Items.ListAsync(VaultId, SyncEntityType.Host, true, Token)).ShouldBeEmpty();
|
||||
(await harness.SyncState.ReadAsync(VaultId, Token)).Cursor.ShouldBeNull();
|
||||
(await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldHaveSingleItem();
|
||||
}
|
||||
|
||||
// ---- Conflicts ----
|
||||
|
||||
[Fact]
|
||||
public async Task AConflictDetail_RoundTripsAndIsSealedAtRest()
|
||||
{
|
||||
// This is the one place the cache holds decrypted vault content on purpose: the value a merge
|
||||
// displaced. It has to be readable to be useful, and it is as sensitive as the item it came
|
||||
// from.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var detail = System.Text.Encoding.UTF8.GetBytes("""{"field":"Notes","discarded":"my secret"}""");
|
||||
|
||||
var id = await harness.Conflicts.RecordAsync(
|
||||
VaultId, SyncEntityType.Host, entityId, ConflictKind.FieldOverridden, detail, Token);
|
||||
|
||||
var listed = (await harness.Conflicts.ListAsync(VaultId, false, Token)).ShouldHaveSingleItem();
|
||||
listed.Id.ShouldBe(id);
|
||||
listed.Kind.ShouldBe(ConflictKind.FieldOverridden);
|
||||
listed.Detail.ShouldBe(detail);
|
||||
|
||||
var raw = await ReadRawConflictDetailAsync(id);
|
||||
System.Text.Encoding.UTF8.GetString(raw!)
|
||||
.Contains("my secret", StringComparison.Ordinal)
|
||||
.ShouldBeFalse("the discarded value is stored in the clear");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnAcknowledgedConflict_LeavesTheListButKeepsTheValue()
|
||||
{
|
||||
// Someone who dismisses a warning and realises a minute later that they wanted the other value
|
||||
// should still be able to get it.
|
||||
var id = await harness.Conflicts.RecordAsync(
|
||||
VaultId, SyncEntityType.Host, Guid.CreateVersion7(), ConflictKind.FieldOverridden,
|
||||
new byte[] { 1, 2, 3 }, Token);
|
||||
|
||||
(await harness.Conflicts.AcknowledgeAsync(id, Token)).ShouldBeTrue();
|
||||
|
||||
(await harness.Conflicts.ListAsync(VaultId, false, Token)).ShouldBeEmpty();
|
||||
|
||||
var all = (await harness.Conflicts.ListAsync(VaultId, true, Token)).ShouldHaveSingleItem();
|
||||
all.Detail.ShouldBe(new byte[] { 1, 2, 3 });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnUnacknowledgedConflict_CannotBeDiscarded()
|
||||
{
|
||||
var id = await harness.Conflicts.RecordAsync(
|
||||
VaultId, SyncEntityType.Host, Guid.CreateVersion7(), ConflictKind.Undecryptable,
|
||||
new byte[] { 1 }, Token);
|
||||
|
||||
(await harness.Conflicts.DiscardAsync(id, Token)).ShouldBeFalse();
|
||||
|
||||
await harness.Conflicts.AcknowledgeAsync(id, Token);
|
||||
(await harness.Conflicts.DiscardAsync(id, Token)).ShouldBeTrue();
|
||||
}
|
||||
|
||||
// ---- Helpers ----
|
||||
|
||||
private static CancellationToken Token => TestContext.Current.CancellationToken;
|
||||
|
||||
private static StoredVault Vault(Guid vaultId, string name, uint keyGeneration) =>
|
||||
new(vaultId, name, IsPersonal: true, TeamId: null, keyGeneration, Permissions: 31,
|
||||
WrappedVaultKey: [1, 2, 3], RekeyRequired: false);
|
||||
|
||||
private static StoredUnlockMaterial Material() =>
|
||||
new(
|
||||
"https://dodossh.example",
|
||||
UserId,
|
||||
"https://idp.example",
|
||||
"alice",
|
||||
"alice@example.com",
|
||||
"Alice",
|
||||
KeyGeneration: 1,
|
||||
WrappedPrivateKey: [4, 5, 6, 7],
|
||||
new KdfParameters("argon2id", [8, 9, 10, 11], 262144, 4, 1),
|
||||
DateTimeOffset.FromUnixTimeSeconds(1_750_000_000));
|
||||
|
||||
private async Task<byte[]?> ReadRawFieldsAsync(Guid entityId)
|
||||
{
|
||||
var context = harness.Factory.CreateDbContext();
|
||||
await using var scope = context.ConfigureAwait(false);
|
||||
|
||||
return await context.Set<CachedItemRow>()
|
||||
.Where(row => row.EntityId == entityId)
|
||||
.Select(row => row.ProtectedFields)
|
||||
.SingleAsync(Token);
|
||||
}
|
||||
|
||||
private async Task<byte[]?> ReadRawConflictDetailAsync(Guid id)
|
||||
{
|
||||
var context = harness.Factory.CreateDbContext();
|
||||
await using var scope = context.ConfigureAwait(false);
|
||||
|
||||
return await context.Set<ConflictRow>()
|
||||
.Where(row => row.Id == id)
|
||||
.Select(row => row.Detail)
|
||||
.SingleAsync(Token);
|
||||
}
|
||||
|
||||
private async Task<int> CountUnlockRowsAsync()
|
||||
{
|
||||
var context = harness.Factory.CreateDbContext();
|
||||
await using var scope = context.ConfigureAwait(false);
|
||||
|
||||
return await context.Set<UnlockMaterialRow>().CountAsync(Token);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!--
|
||||
Against real SQLite, in memory. Not an in-memory *provider*: the point of these tests is that the
|
||||
schema, the composite keys and the unique index behave as configured, none of which the in-memory
|
||||
provider enforces. An in-memory SQLite file exercises the actual query pipeline and still runs in
|
||||
milliseconds.
|
||||
-->
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../src/DodoSSH.Client.Storage/DodoSSH.Client.Storage.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,286 @@
|
||||
using DodoSSH.Contracts;
|
||||
using static DodoSSH.Client.Storage.Tests.CacheHarness;
|
||||
|
||||
namespace DodoSSH.Client.Storage.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The outbox, whose coalescing rules are where offline work is kept or lost.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Two properties carry the weight. The ancestor must survive every coalesce, or a conflict can only
|
||||
/// be arbitrated rather than merged. And a coalesced row must get a fresh operation id, or the server
|
||||
/// can answer <c>Duplicate</c> for an operation whose contents have since changed and silently discard
|
||||
/// the newer edit.
|
||||
/// </remarks>
|
||||
public sealed class OutboxStoreTests : IAsyncLifetime
|
||||
{
|
||||
private CacheHarness harness = null!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask InitializeAsync() => harness = await CreateAsync();
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
harness.Dispose();
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AQueuedChange_ComesBackWithEverythingItNeedsToBePushed()
|
||||
{
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var ancestor = new StoredAncestor(3, Payload(seed: 40), new SyncPlaintextFields());
|
||||
|
||||
var queued = await harness.Outbox.QueueAsync(
|
||||
Change(entityId, expectedVersion: 3, seed: 7, ancestor: ancestor), Token);
|
||||
|
||||
queued.OperationId.ShouldNotBe(Guid.Empty);
|
||||
queued.ExpectedVersion.ShouldBe(3);
|
||||
queued.Operation.ShouldBe(SyncOperation.Upsert);
|
||||
queued.Payload.ShouldNotBeNull();
|
||||
queued.Payload.Envelope.ShouldBe(Payload(seed: 7).Envelope);
|
||||
queued.Payload.WrappedDataKey.ShouldBe(Payload(seed: 7).WrappedDataKey);
|
||||
queued.Payload.DataKeyId.ShouldBe(Payload(seed: 7).DataKeyId);
|
||||
queued.Ancestor.ShouldNotBeNull();
|
||||
queued.Ancestor.Version.ShouldBe(3);
|
||||
queued.Ancestor.Payload.Envelope.ShouldBe(Payload(seed: 40).Envelope);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASecondEditToTheSameItem_CoalescesIntoOneRow()
|
||||
{
|
||||
// Two rows would have to be pushed in order, and the second's expectedVersion is the version
|
||||
// the first will produce — which is not known when it is queued.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
await harness.Outbox.QueueAsync(Change(entityId, seed: 1), Token);
|
||||
await harness.Outbox.QueueAsync(Change(entityId, seed: 2), Token);
|
||||
|
||||
var pending = await harness.Outbox.TakeAsync(VaultId, 10, Token);
|
||||
|
||||
pending.ShouldHaveSingleItem().Payload!.Envelope.ShouldBe(Payload(seed: 2).Envelope);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ACoalescedEdit_KeepsTheOriginalAncestorAndExpectedVersion()
|
||||
{
|
||||
// The load-bearing rule. The newest state is still a descendant of the base the first edit
|
||||
// branched from; adopting the caller's values here would discard the common ancestor after the
|
||||
// first edit and leave nothing to merge against.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var ancestor = new StoredAncestor(5, Payload(seed: 90), new SyncPlaintextFields());
|
||||
|
||||
await harness.Outbox.QueueAsync(
|
||||
Change(entityId, expectedVersion: 5, seed: 1, ancestor: ancestor), Token);
|
||||
|
||||
// A second edit arrives knowing nothing about the base.
|
||||
await harness.Outbox.QueueAsync(
|
||||
Change(entityId, expectedVersion: null, seed: 2, ancestor: null), Token);
|
||||
|
||||
var pending = (await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldHaveSingleItem();
|
||||
|
||||
pending.ExpectedVersion.ShouldBe(5);
|
||||
pending.Ancestor.ShouldNotBeNull();
|
||||
pending.Ancestor.Version.ShouldBe(5);
|
||||
pending.Ancestor.Payload.Envelope.ShouldBe(Payload(seed: 90).Envelope);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ACoalescedEdit_GetsAFreshOperationId()
|
||||
{
|
||||
// Reusing the id would let the server report Duplicate — meaning "already applied" — for an
|
||||
// operation whose payload has since changed, and the newer edit would vanish with the push
|
||||
// reported as a success.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
var first = await harness.Outbox.QueueAsync(Change(entityId, seed: 1), Token);
|
||||
await harness.Outbox.MarkDispatchedAsync(first.Sequence, Token);
|
||||
|
||||
var second = await harness.Outbox.QueueAsync(Change(entityId, seed: 2), Token);
|
||||
|
||||
second.OperationId.ShouldNotBe(first.OperationId);
|
||||
second.Sequence.ShouldBe(first.Sequence);
|
||||
|
||||
// And the retry counter resets, because this is a new operation rather than a further attempt
|
||||
// at the old one.
|
||||
second.Attempts.ShouldBe(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnUpsertFollowedByADelete_BecomesADelete()
|
||||
{
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
await harness.Outbox.QueueAsync(Change(entityId, expectedVersion: 2, seed: 1), Token);
|
||||
await harness.Outbox.QueueAsync(
|
||||
Change(entityId, SyncOperation.Delete, expectedVersion: 2), Token);
|
||||
|
||||
var pending = (await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldHaveSingleItem();
|
||||
|
||||
pending.Operation.ShouldBe(SyncOperation.Delete);
|
||||
pending.Payload.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ChangesToDifferentItems_DrainInTheOrderTheyWereMade()
|
||||
{
|
||||
// Order matters for creates that reference each other — a host naming a jump host — so the
|
||||
// outbox is a queue, not a set.
|
||||
var first = Guid.CreateVersion7();
|
||||
var second = Guid.CreateVersion7();
|
||||
var third = Guid.CreateVersion7();
|
||||
|
||||
foreach (var id in new[] { first, second, third })
|
||||
{
|
||||
await harness.Outbox.QueueAsync(Change(id), Token);
|
||||
}
|
||||
|
||||
var pending = await harness.Outbox.TakeAsync(VaultId, 10, Token);
|
||||
|
||||
pending.Select(p => p.EntityId).ShouldBe([first, second, third]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CoalescingDoesNotJumpTheQueue()
|
||||
{
|
||||
// The row keeps its original position. Re-editing the first item should not push it behind
|
||||
// items queued after it, because the later ones may depend on it existing.
|
||||
var first = Guid.CreateVersion7();
|
||||
var second = Guid.CreateVersion7();
|
||||
|
||||
await harness.Outbox.QueueAsync(Change(first), Token);
|
||||
await harness.Outbox.QueueAsync(Change(second), Token);
|
||||
await harness.Outbox.QueueAsync(Change(first, seed: 9), Token);
|
||||
|
||||
var pending = await harness.Outbox.TakeAsync(VaultId, 10, Token);
|
||||
|
||||
pending.Select(p => p.EntityId).ShouldBe([first, second]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Revise_MovesTheAncestorForwardUnlikeQueue()
|
||||
{
|
||||
// The opposite intent from a coalesce: a merge has just been performed against a newer server
|
||||
// version, so that version becomes the base. Leaving the old ancestor would make the re-push
|
||||
// conflict against the same point for ever.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
var original = new StoredAncestor(1, Payload(seed: 10), new SyncPlaintextFields());
|
||||
|
||||
var queued = await harness.Outbox.QueueAsync(
|
||||
Change(entityId, expectedVersion: 1, ancestor: original), Token);
|
||||
|
||||
var merged = new StoredAncestor(4, Payload(seed: 20), new SyncPlaintextFields());
|
||||
|
||||
var revised = await harness.Outbox.ReviseAsync(
|
||||
queued.Sequence,
|
||||
SyncOperation.Upsert,
|
||||
expectedVersion: 4,
|
||||
Payload(seed: 30),
|
||||
new SyncPlaintextFields(),
|
||||
merged,
|
||||
Token);
|
||||
|
||||
revised.ShouldNotBeNull();
|
||||
revised.ExpectedVersion.ShouldBe(4);
|
||||
revised.Ancestor!.Version.ShouldBe(4);
|
||||
revised.Ancestor.Payload.Envelope.ShouldBe(Payload(seed: 20).Envelope);
|
||||
revised.OperationId.ShouldNotBe(queued.OperationId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AParkedOperation_IsNotHandedOutForPushing()
|
||||
{
|
||||
// An operation the server called Invalid will never succeed. Retrying it would spin and, worse,
|
||||
// would block every change queued behind it in a vault the user can still write to.
|
||||
var parked = Guid.CreateVersion7();
|
||||
var healthy = Guid.CreateVersion7();
|
||||
|
||||
var queued = await harness.Outbox.QueueAsync(Change(parked), Token);
|
||||
await harness.Outbox.QueueAsync(Change(healthy), Token);
|
||||
|
||||
await harness.Outbox.ParkAsync(queued.Sequence, "Entity type not supported.", Token);
|
||||
|
||||
var pending = await harness.Outbox.TakeAsync(VaultId, 10, Token);
|
||||
pending.ShouldHaveSingleItem().EntityId.ShouldBe(healthy);
|
||||
|
||||
var listed = (await harness.Outbox.ListParkedAsync(VaultId, Token)).ShouldHaveSingleItem();
|
||||
listed.EntityId.ShouldBe(parked);
|
||||
listed.LastError.ShouldBe("Entity type not supported.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReEditingAParkedOperation_Unparks()
|
||||
{
|
||||
// The user's remedy for a rejected change is to change it. That has to actually re-arm it.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
|
||||
var queued = await harness.Outbox.QueueAsync(Change(entityId), Token);
|
||||
await harness.Outbox.ParkAsync(queued.Sequence, "nope", Token);
|
||||
|
||||
var requeued = await harness.Outbox.QueueAsync(Change(entityId, seed: 5), Token);
|
||||
|
||||
requeued.IsParked.ShouldBeFalse();
|
||||
requeued.LastError.ShouldBeNull();
|
||||
(await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldHaveSingleItem();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Complete_RemovesTheOperation()
|
||||
{
|
||||
var queued = await harness.Outbox.QueueAsync(Change(Guid.CreateVersion7()), Token);
|
||||
|
||||
(await harness.Outbox.CompleteAsync(queued.Sequence, Token)).ShouldBeTrue();
|
||||
(await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldBeEmpty();
|
||||
|
||||
// Idempotent: a drain that retries after a crash must not fail on an already-cleared row.
|
||||
(await harness.Outbox.CompleteAsync(queued.Sequence, Token)).ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MarkDispatched_CountsAttempts()
|
||||
{
|
||||
var queued = await harness.Outbox.QueueAsync(Change(Guid.CreateVersion7()), Token);
|
||||
|
||||
await harness.Outbox.MarkDispatchedAsync(queued.Sequence, Token);
|
||||
await harness.Outbox.MarkDispatchedAsync(queued.Sequence, Token);
|
||||
|
||||
var pending = (await harness.Outbox.TakeAsync(VaultId, 10, Token)).ShouldHaveSingleItem();
|
||||
pending.Attempts.ShouldBe(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AnUpsertWithoutAPayload_IsRefused()
|
||||
{
|
||||
// Caught here rather than at the server, where it would come back as one opaque Invalid among
|
||||
// a batch of otherwise good operations.
|
||||
var change = new QueuedChange(
|
||||
VaultId,
|
||||
SyncEntityType.Host,
|
||||
Guid.CreateVersion7(),
|
||||
SyncOperation.Upsert,
|
||||
ExpectedVersion: null,
|
||||
Payload: null,
|
||||
Fields: null,
|
||||
Ancestor: null);
|
||||
|
||||
await Should.ThrowAsync<ArgumentException>(
|
||||
async () => await harness.Outbox.QueueAsync(change, Token));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ThePendingOperationForAnItem_CanBeLookedUpDirectly()
|
||||
{
|
||||
// How a pull discovers that an incoming change collides with local work.
|
||||
var entityId = Guid.CreateVersion7();
|
||||
await harness.Outbox.QueueAsync(Change(entityId), Token);
|
||||
|
||||
(await harness.Outbox.FindAsync(VaultId, SyncEntityType.Host, entityId, Token))
|
||||
.ShouldNotBeNull();
|
||||
|
||||
(await harness.Outbox.FindAsync(VaultId, SyncEntityType.Host, Guid.CreateVersion7(), Token))
|
||||
.ShouldBeNull();
|
||||
}
|
||||
|
||||
private static CancellationToken Token => TestContext.Current.CancellationToken;
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dependencies": {
|
||||
"net10.0": {
|
||||
"Meziantou.Analyzer": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.0.134, )",
|
||||
"resolved": "3.0.134",
|
||||
"contentHash": "tTYCcYKyOko3TMNxmxmA9nakbcHVUgglENmCMIhzIjl9y9FBZO/0tWSxTGC74Sp198FmWih5S5KkjQRBg5ePkQ=="
|
||||
},
|
||||
"Microsoft.CodeAnalysis.BannedApiAnalyzers": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.6.0, )",
|
||||
"resolved": "5.6.0",
|
||||
"contentHash": "Kcobt3pnOdO0A+6CKiMHZdTEluJpsfxiV20axtZdmfBQnDmiWTKPJADlgAfdTuKNAnVarrkJa0UEGwuOo91muw=="
|
||||
},
|
||||
"NSubstitute": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.0.0, )",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "0gvKMbiJ+/WrfbcfBfqRZZrvfLJcd3rqkqVMjjlY5dtmLRVzMY+o/K/rJUStofQ2haSr9Vd04YDfvZtVVGS3/A==",
|
||||
"dependencies": {
|
||||
"Castle.Core": "5.1.1"
|
||||
}
|
||||
},
|
||||
"Shouldly": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.3.0, )",
|
||||
"resolved": "4.3.0",
|
||||
"contentHash": "sDetrWXrl6YXZ4HeLsdBoNk3uIa7K+V4uvIJ+cqdRa5DrFxeTED7VkjoxCuU1kJWpUuBDZz2QXFzSxBtVXLwRQ==",
|
||||
"dependencies": {
|
||||
"DiffEngine": "11.3.0",
|
||||
"EmptyFiles": "4.4.0"
|
||||
}
|
||||
},
|
||||
"xunit.v3": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.2.2, )",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "L+4/4y0Uqcg8/d6hfnxhnwh4j9FaeULvefTwrk30rr1o4n/vdPfyUQ8k0yzH8VJx7bmFEkDdcRfbtbjEHlaYcA==",
|
||||
"dependencies": {
|
||||
"xunit.v3.mtp-v1": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"Castle.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.1.1",
|
||||
"contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==",
|
||||
"dependencies": {
|
||||
"System.Diagnostics.EventLog": "6.0.0"
|
||||
}
|
||||
},
|
||||
"DiffEngine": {
|
||||
"type": "Transitive",
|
||||
"resolved": "11.3.0",
|
||||
"contentHash": "k0ZgZqd09jLZQjR8FyQbSQE86Q7QZnjEzq1LPHtj1R2AoWO8sjV5x+jlSisL7NZAbUOI4y+7Bog8gkr9WIRBGw==",
|
||||
"dependencies": {
|
||||
"EmptyFiles": "4.4.0",
|
||||
"System.Management": "6.0.1"
|
||||
}
|
||||
},
|
||||
"EmptyFiles": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.4.0",
|
||||
"contentHash": "gwJEfIGS7FhykvtZoscwXj/XwW+mJY6UbAZk+qtLKFUGWC95kfKXnj8VkxsZQnWBxJemM/q664rGLN5nf+OHZw=="
|
||||
},
|
||||
"Microsoft.ApplicationInsights": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.23.0",
|
||||
"contentHash": "nWArUZTdU7iqZLycLKWe0TDms48KKGE6pONH2terYNa8REXiqixrMOkf1sk5DHGMaUTqONU2YkS4SAXBhLStgw=="
|
||||
},
|
||||
"Microsoft.Bcl.AsyncInterfaces": {
|
||||
"type": "Transitive",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
|
||||
},
|
||||
"Microsoft.Data.Sqlite.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "TPCs0ldm7AWqcKmp6f/Xr+14sat7hx4rHfRlS4RgCURBH2thEWbAKEyX7cCWr63zVJVOJIJZTg2cBiUXa8ys6g==",
|
||||
"dependencies": {
|
||||
"SQLitePCLRaw.core": "2.1.11"
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "bOzrFCl6uZCjaSh2bG1ToRQRdx+iXvxosCg9hFyG9OWeAzOFI4xev9OqKeWfKf/kAHyox2JnbcvLVf2ceA7sqA=="
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Analyzers": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "2gLDordUCGf3aNOOuqtTbP5mxhiP9nk6TnvGiE3RnqT891O+Zf/qKu1PIREubs1M16A0SImr4vULBfU5BTDs1Q=="
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Sqlite.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "YbVWMIouzwTKBiLms8boa7xeRT88wI14R1msv3XExFk9n0/sa8nU7MwDa1CKtfLGMJs7O7QWuS9/xhcQ72AD2A==",
|
||||
"dependencies": {
|
||||
"Microsoft.Data.Sqlite.Core": "10.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "10.0.10",
|
||||
"Microsoft.Extensions.Caching.Memory": "10.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.DependencyModel": "10.0.10",
|
||||
"Microsoft.Extensions.Logging": "10.0.10",
|
||||
"SQLitePCLRaw.core": "2.1.11"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "4ZFBNE+jzR+CrWWlhOesnmywCW7pYKT0dxyAQRdL11yJwxe4jvcAu31eorFtEkoFeCDcUTeNssgPv2yaRRptaQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Memory": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "N1w5H7uK6gCTnCBZAWzE0/EQYSPysij/uYwDqntqBVvBa6bjMmBKitsnEFd6yh/SX3wLm67nO6+OnZ84K+gZWg==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Caching.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.Options": "10.0.10",
|
||||
"Microsoft.Extensions.Primitives": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "5Vnd2I75DmZCVEjSynIdJ/0EGafgnLQwgR3t2C2/fkjx/nRG+cLwxLLdInoHeCEpkD5K4Ov/g9ZCRYrl4TRsaA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "ANyvsgkNBRvcJh2XLgn8veGmajf+8m0AbKK+HPWdRL1yraSNVVSmQhFntLtdz/C795jxqqup+k05cs/3jZQPOA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "z/2xXlFw2aLGjHyEm6E0tQ+In6VfzQzTrtArbQ2c0TQE16ZbyDCMGPvaUT9I0s8rgy9sRWlU2P9waW37qV04qA=="
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "rfZA1RjR021RPqSmIPovfz2aOd79TGqJ9BengbjnzIISOVwjLmuSDnhCMmiY/1c6iYvGolQ1iNGzkav0u11XEA=="
|
||||
},
|
||||
"Microsoft.Extensions.Logging": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "Tf6z5HsL0VDYRTfvsoNrTGHGheCwkTsZBA2FFh5ATJUbkAwug+FFNISJK2gjpUNemlAOoWllAK52HOWCjto3EQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "10.0.10",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.Options": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "zkFxGYUvdxAvIKTyXHrmW+Sux53D4SezD9dMyZ6hrwwzPQJNuwCRy1f5W7AvYTqacEGhWF2XderRQG1OvbV8og==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "srnhnk7nE8krBiIXp71LvBmKBtraBONWSRzdjJgRv1Ko9Mp8IVNqv4vIS9hGeVteBig8aQkva9ZG+sC+o5sVcA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.Primitives": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "5wu/GrYVd8mG2DVUw3vFJzF+O336TyTGg/Kmcgw9bfwYhCoFiV5lR5QeEmKecJyrW4W54nMfD3p3589E8a7czQ=="
|
||||
},
|
||||
"Microsoft.Testing.Extensions.Telemetry": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.9.1",
|
||||
"contentHash": "No5AudZMmSb+uNXjlgL2y3/stHD2IT4uxqc5yHwkE+/nNux9jbKcaJMvcp9SwgP4DVD8L9/P3OUz8mmmcvEIdQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.ApplicationInsights": "2.23.0",
|
||||
"Microsoft.Testing.Platform": "1.9.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Testing.Extensions.TrxReport.Abstractions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.9.1",
|
||||
"contentHash": "AL46Xe1WBi85Ntd4mNPvat5ZSsZ2uejiVqoKCypr8J3wK0elA5xJ3AN4G/Q4GIwzUFnggZoH/DBjnr9J18IO/g==",
|
||||
"dependencies": {
|
||||
"Microsoft.Testing.Platform": "1.9.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Testing.Platform": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.9.1",
|
||||
"contentHash": "QafNtNSmEI0zazdebnsIkDKmFtTSpmx/5PLOjURWwozcPb3tvRxzosQSL8xwYNM1iPhhKiBksXZyRSE2COisrA=="
|
||||
},
|
||||
"Microsoft.Testing.Platform.MSBuild": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.9.1",
|
||||
"contentHash": "oTUtyR4X/s9ytuiNA29FGsNCCH0rNmY5Wdm14NCKLjTM1cT9edVSlA+rGS/mVmusPqcP0l/x9qOnMXg16v87RQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.Testing.Platform": "1.9.1"
|
||||
}
|
||||
},
|
||||
"Microsoft.Win32.Registry": {
|
||||
"type": "Transitive",
|
||||
"resolved": "5.0.0",
|
||||
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg=="
|
||||
},
|
||||
"System.CodeDom": {
|
||||
"type": "Transitive",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "CPc6tWO1LAer3IzfZufDBRL+UZQcj5uS207NHALQzP84Vp/z6wF0Aa0YZImOQY8iStY0A2zI/e3ihKNPfUm8XA=="
|
||||
},
|
||||
"System.Diagnostics.EventLog": {
|
||||
"type": "Transitive",
|
||||
"resolved": "6.0.0",
|
||||
"contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw=="
|
||||
},
|
||||
"System.Management": {
|
||||
"type": "Transitive",
|
||||
"resolved": "6.0.1",
|
||||
"contentHash": "10J1D0h/lioojphfJ4Fuh5ZUThT/xOVHdV9roGBittKKNP2PMjrvibEdbVTGZcPra1399Ja3tqIJLyQrc5Wmhg==",
|
||||
"dependencies": {
|
||||
"System.CodeDom": "6.0.0"
|
||||
}
|
||||
},
|
||||
"xunit.analyzers": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.27.0",
|
||||
"contentHash": "y/pxIQaLvk/kxAoDkZW9GnHLCEqzwl5TW0vtX3pweyQpjizB9y3DXhb9pkw2dGeUqhLjsxvvJM1k89JowU6z3g=="
|
||||
},
|
||||
"xunit.v3.assert": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "BPciBghgEEaJN/JG00QfCYDfEfnLgQhfnYEy+j1izoeHVNYd5+3Wm8GJ6JgYysOhpBPYGE+sbf75JtrRc7jrdA=="
|
||||
},
|
||||
"xunit.v3.common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "Hj775PEH6GTbbg0wfKRvG2hNspDCvTH9irXhH4qIWgdrOSV1sQlqPie+DOvFeigsFg2fxSM3ZAaaCDQs+KreFA==",
|
||||
"dependencies": {
|
||||
"Microsoft.Bcl.AsyncInterfaces": "6.0.0"
|
||||
}
|
||||
},
|
||||
"xunit.v3.core.mtp-v1": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "Ga5aA2Ca9ktz+5k3g5ukzwfexwoqwDUpV6z7atSEUvqtd6JuybU1XopHqg1oFd78QdTfZgZE9h5sHpO4qYIi5w==",
|
||||
"dependencies": {
|
||||
"Microsoft.Testing.Extensions.Telemetry": "1.9.1",
|
||||
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.9.1",
|
||||
"Microsoft.Testing.Platform": "1.9.1",
|
||||
"Microsoft.Testing.Platform.MSBuild": "1.9.1",
|
||||
"xunit.v3.extensibility.core": "[3.2.2]",
|
||||
"xunit.v3.runner.inproc.console": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"xunit.v3.extensibility.core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "srY8z/oMPvh/t8axtO2DwrHajhFMH7tnqKildvYrVQIfICi8fOn3yIBWkVPAcrKmHMwvXRJ/XsQM3VMR6DOYfQ==",
|
||||
"dependencies": {
|
||||
"xunit.v3.common": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"xunit.v3.mtp-v1": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "O41aAzYKBT5PWqATa1oEWVNCyEUypFQ4va6K0kz37dduV3EKzXNMaV2UnEhufzU4Cce1I33gg0oldS8tGL5I0A==",
|
||||
"dependencies": {
|
||||
"xunit.analyzers": "1.27.0",
|
||||
"xunit.v3.assert": "[3.2.2]",
|
||||
"xunit.v3.core.mtp-v1": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"xunit.v3.runner.common": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "/hkHkQCzGrugelOAehprm7RIWdsUFVmIVaD6jDH/8DNGCymTlKKPTbGokD5czbAfqfex47mBP0sb0zbHYwrO/g==",
|
||||
"dependencies": {
|
||||
"Microsoft.Win32.Registry": "[5.0.0]",
|
||||
"xunit.v3.common": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"xunit.v3.runner.inproc.console": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.2.2",
|
||||
"contentHash": "ulWOdSvCk+bPXijJZ73bth9NyoOHsAs1ZOvamYbCkD4DNLX/Bd29Ve2ZNUwBbK0MqfIYWXHZViy/HKrdEC/izw==",
|
||||
"dependencies": {
|
||||
"xunit.v3.extensibility.core": "[3.2.2]",
|
||||
"xunit.v3.runner.common": "[3.2.2]"
|
||||
}
|
||||
},
|
||||
"dodossh.client.storage": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"DodoSSH.Contracts": "[1.0.0, )",
|
||||
"DodoSSH.Crypto": "[1.0.0, )",
|
||||
"EFCore.NamingConventions": "[10.0.1, )",
|
||||
"Microsoft.EntityFrameworkCore.Sqlite": "[10.0.10, )"
|
||||
}
|
||||
},
|
||||
"dodossh.contracts": {
|
||||
"type": "Project"
|
||||
},
|
||||
"dodossh.crypto": {
|
||||
"type": "Project",
|
||||
"dependencies": {
|
||||
"NSec.Cryptography": "[26.4.0, )"
|
||||
}
|
||||
},
|
||||
"EFCore.NamingConventions": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.1, )",
|
||||
"resolved": "10.0.1",
|
||||
"contentHash": "Xs5k8XfNKPkkQSkGmZkmDI1je0prLTdxse+s8PgTFZxyBrlrTLzTBUTVJtQKSsbvu4y+luAv8DdtO5SALJE++A==",
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "[10.0.1, 11.0.0)",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "[10.0.1, 11.0.0)",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.1"
|
||||
}
|
||||
},
|
||||
"libsodium": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[1.0.22, )",
|
||||
"resolved": "1.0.22",
|
||||
"contentHash": "KPD9SloJFclrsjnhABu7dzWrcyYkwPbvx5l1gRSPAX/0n+OBtSiVCKtGFv4n+ecWUHU0tCG9LSSwoZZx673zBQ=="
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.10, )",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "a0V7zj/VbYP6dTdWpUgE/r2PuLKtUGe2aJ0lVKkn/wP9ZhaxUz2kQydVfvOjCv2SKxlrqdBfHhPD4Cvlf+4ffA==",
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": "10.0.10",
|
||||
"Microsoft.EntityFrameworkCore.Analyzers": "10.0.10",
|
||||
"Microsoft.Extensions.Caching.Memory": "10.0.10",
|
||||
"Microsoft.Extensions.Logging": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Relational": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.10, )",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "wNonj40aZxia+GtuBiiD6ZqVh4h6y5Nje1bGdmzZ8/ui0QRsAN+S0SIrLHFCEGbG9cDbeaE40sh+Lr7o9rRs6g==",
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "10.0.10",
|
||||
"Microsoft.Extensions.Caching.Memory": "10.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.Logging": "10.0.10"
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Sqlite": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[10.0.10, )",
|
||||
"resolved": "10.0.10",
|
||||
"contentHash": "kzg9MuQNJvZQxAU+piSkEzc7/1tpW6n1nVSGGMObu2GgxLK8Nf+6fvZundaznTZ+O2KhfPZ8HFNCzMH3PWDUmA==",
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore.Sqlite.Core": "10.0.10",
|
||||
"Microsoft.Extensions.Caching.Memory": "10.0.10",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "10.0.10",
|
||||
"Microsoft.Extensions.DependencyModel": "10.0.10",
|
||||
"Microsoft.Extensions.Logging": "10.0.10",
|
||||
"SQLitePCLRaw.bundle_e_sqlite3": "2.1.11",
|
||||
"SQLitePCLRaw.core": "2.1.11"
|
||||
}
|
||||
},
|
||||
"NSec.Cryptography": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[26.4.0, )",
|
||||
"resolved": "26.4.0",
|
||||
"contentHash": "0vsCtY5f+YgQROiWNqzgWp+l2pddfk9FkWoGV/bEo0MuEYPKlJWuoA8aOfO6qp3f+EnObKE3zSJhn1PspJeJVg==",
|
||||
"dependencies": {
|
||||
"libsodium": "[1.0.22, 1.0.23)"
|
||||
}
|
||||
},
|
||||
"SQLitePCLRaw.bundle_e_sqlite3": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[2.1.12, )",
|
||||
"resolved": "2.1.12",
|
||||
"contentHash": "mAgscpQMLw5/nfA1Q5oJVAT29yROUo1ifZGbbTpx/lwZpSxMUGoYbKfmvdm8oXER+RzxqBmmQzeBEVKfeHv2nw==",
|
||||
"dependencies": {
|
||||
"SQLitePCLRaw.lib.e_sqlite3": "2.1.12",
|
||||
"SQLitePCLRaw.provider.e_sqlite3": "2.1.12"
|
||||
}
|
||||
},
|
||||
"SQLitePCLRaw.core": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[2.1.12, )",
|
||||
"resolved": "2.1.12",
|
||||
"contentHash": "ETpNw9DY3ckWLgRRAeCHj+GKOuPi61aeczkXhgHexUvqoZBAYg8RYESE2J7O1M7+o6QbdSEZwrw9bfqztUVWXg=="
|
||||
},
|
||||
"SQLitePCLRaw.lib.e_sqlite3": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[2.1.12, )",
|
||||
"resolved": "2.1.12",
|
||||
"contentHash": "fWi8Dbknuhgg72fWinIdjXVaqO1hHL4YBBwVLnr7e1c9TAZwJ0QE38j9syW1hwx6HaqEVTwI+O07WPdZn8Rp0w=="
|
||||
},
|
||||
"SQLitePCLRaw.provider.e_sqlite3": {
|
||||
"type": "CentralTransitive",
|
||||
"requested": "[2.1.12, )",
|
||||
"resolved": "2.1.12",
|
||||
"contentHash": "W3oH4XIfCzFrgUSDKHhN6N+dgzA5YHOR2VxX8GB6Qy7CyrJJgxPEG8NirgYWlPQC5P2jz2knSsexWu4tDUL33g==",
|
||||
"dependencies": {
|
||||
"SQLitePCLRaw.core": "2.1.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user