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
F3499624: D5887.diff
Thu, Dec 19, 11:37 PM
Unknown Object (File)
Tue, Dec 10, 1:48 AM
Unknown Object (File)
Thu, Nov 28, 11:55 PM
Unknown Object (File)
Thu, Nov 28, 11:55 PM
Unknown Object (File)
Fri, Nov 22, 5:54 AM
Unknown Object (File)
Fri, Nov 22, 5:54 AM
Unknown Object (File)
Fri, Nov 22, 5:54 AM
Unknown Object (File)
Fri, Nov 22, 5:54 AM
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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

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.