From b065ffa93e60b4603ed1426f217e1fc86412b0f0 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 3 Dec 2026 10:38:00 -0500 Subject: [PATCH] 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. --- .../DeployNotifyFetchTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DeployNotifyFetchTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DeployNotifyFetchTests.cs index ccab5568..ccee9532 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DeployNotifyFetchTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DeployNotifyFetchTests.cs @@ -60,10 +60,15 @@ public sealed class DeployNotifyFetchTests /// Creates the SQLite-adapted context from the supplied options. /// The EF Core options for the context. public SqliteFetchDbContext(DbContextOptions 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(); + /// protected override void OnModelCreating(ModelBuilder modelBuilder) {