HomePhabricator
Diffusion Comm 7daa8a0cb31a

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

Description

[keyserver] Introduce createSIWENonceEntry to persist nonce in DB

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:

Reviewers: tomek, ashoat

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D5887

Details

Provenance
atulAuthored on Dec 17 2022, 3:10 PM
Reviewer
ashoat
Differential Revision
D5887: [keyserver] Introduce `createSIWENonceEntry` to persist nonce in DB
Parents
rCOMM32e3d236ca9a: [keyserver] Return generated `nonce` in `siweNonceResponder`
Branches
Unknown
Tags
Unknown