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
Unknown Object (File)
Thu, Nov 7, 11:59 AM
Unknown Object (File)
Wed, Nov 6, 6:24 AM
Unknown Object (File)
Tue, Nov 5, 7:28 AM
Unknown Object (File)
Tue, Nov 5, 7:28 AM
Unknown Object (File)
Tue, Nov 5, 7:28 AM
Unknown Object (File)
Tue, Oct 29, 1:13 PM
Unknown Object (File)
Tue, Oct 22, 11:22 PM
Unknown Object (File)
Tue, Oct 22, 5:15 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
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

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

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.