From 044e31dd553ba2b83e1adb26073029531a2437a8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Prud'homme <42589969+jmarc101@users.noreply.github.com> Date: Mon, 12 May 2025 14:31:33 -0400 Subject: [PATCH 1/2] read new key last --- lib/core/storage-keys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/storage-keys.ts b/lib/core/storage-keys.ts index d84a767..3a7b577 100644 --- a/lib/core/storage-keys.ts +++ b/lib/core/storage-keys.ts @@ -53,7 +53,6 @@ function generatePassportKeys(config: ResolvedConfig): StorageKeys { const writeKey = `OPTABLE_PASSPORT_${getWriteKeyBase64FromConfig(config)}`; write.push(writeKey); - read.push(writeKey); // We keep `OPTABLE_PASS` keys for backward compatibility // Once all clients are updated, we can remove them on next tag @@ -64,6 +63,7 @@ function generatePassportKeys(config: ResolvedConfig): StorageKeys { read.push(`OPTABLE_PASS_${encodeBase64(`${config.host}/${config.site}`)}`); } + read.push(writeKey); return { write, read }; } From 06d8646ee2ffc29270846bf53c368e0b54589299 Mon Sep 17 00:00:00 2001 From: Jean-Marc Prud'homme <42589969+jmarc101@users.noreply.github.com> Date: Mon, 12 May 2025 14:32:56 -0400 Subject: [PATCH 2/2] tst --- lib/core/storage-keys.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/storage-keys.test.js b/lib/core/storage-keys.test.js index d10298e..e091ade 100644 --- a/lib/core/storage-keys.test.js +++ b/lib/core/storage-keys.test.js @@ -50,9 +50,9 @@ describe("Storage Key Generation", () => { expect(keys).toEqual({ write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com/node1")], read: [ - "OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"), "OPTABLE_PASSPORT_" + encodeBase64("legacy.example.com"), "OPTABLE_PASS_" + encodeBase64("legacy.example.com/site1"), + "OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"), ], }); }); @@ -63,9 +63,9 @@ describe("Storage Key Generation", () => { expect(keys).toEqual({ write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com")], read: [ - "OPTABLE_PASSPORT_" + encodeBase64("example.com"), "OPTABLE_PASSPORT_" + encodeBase64("legacy.example.com"), "OPTABLE_PASS_" + encodeBase64("legacy.example.com/site1"), + "OPTABLE_PASSPORT_" + encodeBase64("example.com"), ], }); }); @@ -76,8 +76,8 @@ describe("Storage Key Generation", () => { expect(keys).toEqual({ write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com/node1")], read: [ - "OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"), "OPTABLE_PASS_" + encodeBase64("example.com/site1"), + "OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"), ], }); });