HomePhabricator
Diffusion Comm 0203023d1b40

[identity] GenerateNonce RPC

Description

[identity] GenerateNonce RPC

Summary:
This RPC generates an alphanumeric nonce, persists it with the creation time, and then returns the nonce to the caller.

I chose 17 for the length of the nonce to stay consistent with the TypeScript SIWE library util. There is a siwe-rs implementation, but it returns a string of length 11... I created an issue in the siwe-rs repo so hopefully they'll make this consistent in the future: https://github.com/spruceid/siwe-rs/issues/46

Depends on D6836

Test Plan: created a test table in dynamodb and a new client method in the rust-node-addon, called generate_nonce, successfully received a nonce string. checked the ddb table to make sure it was persisted with creation timestamp.

Reviewers: jon, bartek, tomek

Reviewed By: jon

Subscribers: ashoat, atul

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

Details

Provenance
varunAuthored on Feb 22 2023, 11:35 AM
Reviewer
jon
Differential Revision
D6837: [identity] GenerateNonce RPC
Parents
rCOMMd7d7503542bc: [identity] add nonces table to dynamoDB
Branches
Unknown
Tags
Unknown