Page MenuHomePhabricator

[lib] Introduce `getSIWEStatementForPublicKey(...)`
ClosedPublic

Authored by atul on Dec 31 2022, 2:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 3:51 AM
Unknown Object (File)
Fri, Jun 21, 3:51 AM
Unknown Object (File)
Fri, Jun 21, 3:50 AM
Unknown Object (File)
Fri, Jun 21, 3:50 AM
Unknown Object (File)
Fri, Jun 14, 5:27 AM
Unknown Object (File)
Thu, Jun 13, 9:48 PM
Unknown Object (File)
Tue, Jun 11, 10:18 AM
Unknown Object (File)
Wed, May 29, 4:27 AM
Subscribers
None

Details

Summary

Given a public key, getSIWEStatementForPublicKey(...) generates a statement for SIWE message that conforms to what is described in the whitepaper:

https://blob.sh/a3d138.png


Depends on D6128

Test Plan

included a unit test

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Dec 31 2022, 2:38 AM
ashoat added inline comments.
lib/utils/siwe-utils.js
48 ↗(On Diff #20478)

Can we add a newline here?

This revision is now accepted and ready to land.Jan 1 2023, 7:21 PM
lib/utils/siwe-utils.js
49 ↗(On Diff #20478)

Should we just use siweStatement here to avoid copy-paste?

lib/utils/siwe-utils.js
48 ↗(On Diff #20478)

No, newline characters are prohibited in the statement field of the SIWE Message:

0b38f4.png (338×1 px, 97 KB)

49 ↗(On Diff #20478)

I'll make that change before landing.

I initially decided against that to avoid too much redirection, but not a big deal.

rebase before addressing feedback

rebase after addressing feedback and before landing

This revision was landed with ongoing or failed builds.Jan 3 2023, 1:41 PM
This revision was automatically updated to reflect the committed changes.