Page MenuHomePhabricator

[keyserver] Return generated `nonce` in `siweNonceResponder`
ClosedPublic

Authored by atul on Dec 16 2022, 11:09 AM.
Tags
None
Referenced Files
F2191679: D5885.id19447.diff
Thu, Jul 4, 4:47 PM
F2187624: D5885.id19439.diff
Thu, Jul 4, 6:07 AM
Unknown Object (File)
Wed, Jul 3, 4:44 PM
Unknown Object (File)
Wed, Jul 3, 1:30 AM
Unknown Object (File)
Sun, Jun 30, 10:11 PM
Unknown Object (File)
Sat, Jun 29, 5:22 PM
Unknown Object (File)
Wed, Jun 19, 4:10 PM
Unknown Object (File)
Tue, Jun 18, 10:19 PM
Subscribers
None

Details

Summary
  • return nonce generated from siwe:generateNonce
  • input validation with tcomb
  • introduce SIWENonceRequest and SIWENonceResponse types (to appease flow)

Again nothing very interesting, just necessary scaffolding.


Depends on D5884

Test Plan

Send a malformed request and make sure the keyserver throws.
Send a correctly formed request and make sure the keyserver validates input:

bf55cd.png (1×1 px, 233 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Dec 16 2022, 11:09 AM
atul edited the test plan for this revision. (Show Details)
atul retitled this revision from [keyserver] Introduce `siweNonceRequestInputValidator` to [keyserver] Return generated `nonce` in `siweNonceResponder`.
atul edited the summary of 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

remove walletAddress from endpoint input

keyserver/src/responders/siwe-nonce-responders.js
7–9 ↗(On Diff #19447)

This looks weird for a responder given it doesn't take viewer or input, but I guess that's by design.

Worth noting that the validateInput function has the side effect of calling checkClientSupported, which makes sure that we don't respond to requests from clients with ancient codeVersions. Probably doesn't matter for this use case, but it worries me a little bit... what if we add some additional side effect to validateInput in the future, on the assumption that every responder calls it? Not sure

keyserver/src/responders/siwe-nonce-responders.js
7–9 ↗(On Diff #19447)

Probably doesn't matter for this use case, but it worries me a little bit... what if we add some additional side effect to validateInput in the future, on the assumption that every responder calls it? Not sure

Might make sense to change the name of validateInput to something like validateInputAndViewer or validateRequest to make clear that there's more to it than checking input with the tcomb stuff.

keyserver/src/responders/siwe-nonce-responders.js
7–9 ↗(On Diff #19447)

Can you create a task?

This revision was landed with ongoing or failed builds.Dec 19 2022, 10:40 AM
This revision was automatically updated to reflect the committed changes.