Skip to content

Commit 081419e

Browse files
authored
Revert "read new key last (#200)" (#201)
1 parent a1c1f0b commit 081419e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/core/storage-keys.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ describe("Storage Key Generation", () => {
5050
expect(keys).toEqual({
5151
write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com/node1")],
5252
read: [
53+
"OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"),
5354
"OPTABLE_PASSPORT_" + encodeBase64("legacy.example.com"),
5455
"OPTABLE_PASS_" + encodeBase64("legacy.example.com/site1"),
55-
"OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"),
5656
],
5757
});
5858
});
@@ -63,9 +63,9 @@ describe("Storage Key Generation", () => {
6363
expect(keys).toEqual({
6464
write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com")],
6565
read: [
66+
"OPTABLE_PASSPORT_" + encodeBase64("example.com"),
6667
"OPTABLE_PASSPORT_" + encodeBase64("legacy.example.com"),
6768
"OPTABLE_PASS_" + encodeBase64("legacy.example.com/site1"),
68-
"OPTABLE_PASSPORT_" + encodeBase64("example.com"),
6969
],
7070
});
7171
});
@@ -76,8 +76,8 @@ describe("Storage Key Generation", () => {
7676
expect(keys).toEqual({
7777
write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com/node1")],
7878
read: [
79-
"OPTABLE_PASS_" + encodeBase64("example.com/site1"),
8079
"OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"),
80+
"OPTABLE_PASS_" + encodeBase64("example.com/site1"),
8181
],
8282
});
8383
});

lib/core/storage-keys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function generatePassportKeys(config: ResolvedConfig): StorageKeys {
5353
const writeKey = `OPTABLE_PASSPORT_${getWriteKeyBase64FromConfig(config)}`;
5454

5555
write.push(writeKey);
56+
read.push(writeKey);
5657

5758
// We keep `OPTABLE_PASS` keys for backward compatibility
5859
// Once all clients are updated, we can remove them on next tag
@@ -63,7 +64,6 @@ function generatePassportKeys(config: ResolvedConfig): StorageKeys {
6364
read.push(`OPTABLE_PASS_${encodeBase64(`${config.host}/${config.site}`)}`);
6465
}
6566

66-
read.push(writeKey);
6767
return { write, read };
6868
}
6969

0 commit comments

Comments
 (0)