Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/core/storage-keys.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
],
});
});
Expand All @@ -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"),
],
});
});
Expand All @@ -76,8 +76,8 @@ describe("Storage Key Generation", () => {
expect(keys).toEqual({
write: ["OPTABLE_PASSPORT_" + encodeBase64("example.com/node1")],
read: [
"OPTABLE_PASS_" + encodeBase64("example.com/site1"),
"OPTABLE_PASSPORT_" + encodeBase64("example.com/node1"),
"OPTABLE_PASS_" + encodeBase64("example.com/site1"),
],
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/core/storage-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ 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
Expand All @@ -63,7 +64,6 @@ function generatePassportKeys(config: ResolvedConfig): StorageKeys {
read.push(`OPTABLE_PASS_${encodeBase64(`${config.host}/${config.site}`)}`);
}

read.push(writeKey);
return { write, read };
}

Expand Down