Page MenuHomePhabricator

[keyserver] Add function to clear identity metadata
ClosedPublic

Authored by bartek on Nov 18 2024, 6:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 9, 5:27 PM
Unknown Object (File)
Sat, Dec 28, 11:02 PM
Unknown Object (File)
Fri, Dec 27, 6:07 AM
Unknown Object (File)
Thu, Dec 26, 5:51 AM
Unknown Object (File)
Thu, Dec 26, 5:50 AM
Unknown Object (File)
Thu, Dec 26, 5:44 AM
Unknown Object (File)
Tue, Dec 24, 10:01 AM
Unknown Object (File)
Mon, Dec 16, 2:31 AM
Subscribers

Details

Summary

Partially addresses ENG-6545.
Added a function to clear user ID and access token from metadata table. It's going to be called when service authentication fails.

Test Plan

Called this function manually and verified in TablePlus that these rows were removed. Calling verifyUserLoggedIn() creates them again.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Nov 21 2024, 9:13 AM
This revision is now accepted and ready to land.Nov 21 2024, 11:09 AM
ashoat added inline comments.
keyserver/src/user/identity.js
131 ↗(On Diff #45864)

Nit: this query will crash if passed an empty array. We don't do that currently, but I've seen this accidentally happen enough times that I usually try to cover it

136 ↗(On Diff #45864)

I think it would be better to return Promise<void>. The QueryResult type has some anys and you never seem to use it from any of the callsites of clearMetadata currently in this stack

Add zero-length check, return Promise<void>