Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3362345
D7050.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
976 B
Referenced Files
None
Subscribers
None
D7050.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7050: [keyserver] Introduce `isCookieMissingSignedIdentityKeysBlob`
Attached
Detach File
Event Timeline
Log In to Comment