Page MenuHomePhabricator

[keyserver] Introduce `createSIWENonceEntry` to persist nonce in DB
ClosedPublic

Authored by atul on Dec 16 2022, 12:02 PM.
Tags
None
Referenced Files
F2188028: D5887.id19688.diff
Thu, Jul 4, 7:55 AM
Unknown Object (File)
Thu, Jul 4, 12:46 AM
Unknown Object (File)
Wed, Jul 3, 9:24 PM
Unknown Object (File)
Tue, Jul 2, 2:51 PM
Unknown Object (File)
Sun, Jun 30, 10:32 PM
Unknown Object (File)
Sun, Jun 30, 9:04 AM
Unknown Object (File)
Fri, Jun 21, 8:46 PM
Unknown Object (File)
Fri, Jun 21, 8:45 PM
Subscribers
None

Details

Summary

Introduce createSIWENonceEntry in siwe-nonce-creator and consume in siweNonceResponder to persist nonce entry in DB.

If there is already an existing entry for a given ethereum_address, createSIWENonceEntry will update the current entry in place. However, this may prevent a user from signing in with ethereum on two devices with the same wallet at the same time. We can add a deviceID column to the siwe_nonces column to handle that scenario and create a (deviceID, ethereum_address) composite key or something.


Depends on D5885

Test Plan

nonces generated in response to client hitting siwe_nonce endpoint are persisted in the serverDB:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Dec 16 2022, 12:03 PM
atul edited the test plan for this revision. (Show Details)

Don't land until you connect the nonce to a specific session please

This revision is now accepted and ready to land.Dec 16 2022, 1:15 PM
ashoat requested changes to this revision.Dec 19 2022, 9:23 AM
ashoat added inline comments.
keyserver/src/responders/siwe-nonce-responders.js
12 ↗(On Diff #19448)

I think you forgot to update this

This revision now requires changes to proceed.Dec 19 2022, 9:23 AM
keyserver/src/responders/siwe-nonce-responders.js
12 ↗(On Diff #19448)

Ah yeah, looks like I missed that when resolving merge conflicts, thanks for catching that

fix issue from incorrectly resolving merge conflict

This revision is now accepted and ready to land.Dec 19 2022, 11:05 AM
This revision was landed with ongoing or failed builds.Dec 19 2022, 11:21 AM
This revision was automatically updated to reflect the committed changes.