Page MenuHomePhabricator

D7050.diff
No OneTemporary

D7050.diff

diff --git a/keyserver/src/session/cookies.js b/keyserver/src/session/cookies.js
--- a/keyserver/src/session/cookies.js
+++ b/keyserver/src/session/cookies.js
@@ -807,6 +807,22 @@
await dbQuery(query);
}
+// Returns `true` if row with `id = cookieID` exists AND
+// `signed_identity_keys` is `NULL`. Otherwise, returns `false`.
+async function isCookieMissingSignedIdentityKeysBlob(
+ cookieID: string,
+): Promise<boolean> {
+ const query = SQL`
+ SELECT signed_identity_keys
+ FROM cookies
+ WHERE id = ${cookieID}
+ `;
+ const [queryResult] = await dbQuery(query);
+ return (
+ queryResult.length === 1 && queryResult[0].signed_identity_keys === null
+ );
+}
+
async function setCookiePlatform(
viewer: Viewer,
platform: Platform,
@@ -855,6 +871,7 @@
addCookieToJSONResponse,
addCookieToHomeResponse,
setCookieSignedIdentityKeysBlob,
+ isCookieMissingSignedIdentityKeysBlob,
setCookiePlatform,
setCookiePlatformDetails,
};

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 10:22 PM (21 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581142
Default Alt Text
D7050.diff (976 B)

Event Timeline