test(integration): share one key ring across the fetch harness contexts (CDB-1, WP1 task 1.8)

PendingDeployments.ConfigurationJson is now encrypted at rest; the
harness built a fresh EphemeralDataProtectionProvider per context, so
the endpoint could not decrypt what the staging context wrote. Central
nodes share one key ring; the fixture now does too.
This commit is contained in:
Joseph Doherty
2026-12-03 10:38:00 -05:00
parent d4e13d3aa4
commit b065ffa93e
@@ -60,10 +60,15 @@ public sealed class DeployNotifyFetchTests
/// <summary>Creates the SQLite-adapted context from the supplied options.</summary> /// <summary>Creates the SQLite-adapted context from the supplied options.</summary>
/// <param name="options">The EF Core options for the context.</param> /// <param name="options">The EF Core options for the context.</param>
public SqliteFetchDbContext(DbContextOptions<ScadaBridgeDbContext> options) public SqliteFetchDbContext(DbContextOptions<ScadaBridgeDbContext> options)
: base(options, new EphemeralDataProtectionProvider()) : base(options, KeyRing)
{ {
} }
// One key ring shared by every context, as the central nodes share theirs:
// PendingDeployments.ConfigurationJson is encrypted at rest (code review 2026-12-02
// CDB-1), so the staging context's write must decrypt in the endpoint's context.
private static readonly IDataProtectionProvider KeyRing = new EphemeralDataProtectionProvider();
/// <inheritdoc /> /// <inheritdoc />
protected override void OnModelCreating(ModelBuilder modelBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder)
{ {