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"), ], }); }); 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 }; }