Page MenuHomePhabricator

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

Authored by atul on Dec 31 2022, 2:37 AM.
Tags
None
Referenced Files
F3753347: D6129.diff
Fri, Jan 10, 1:51 AM
Unknown Object (File)
Thu, Jan 2, 3:19 AM
Unknown Object (File)
Thu, Dec 26, 8:16 AM
Unknown Object (File)
Thu, Dec 26, 8:16 AM
Unknown Object (File)
Thu, Dec 26, 8:16 AM
Unknown Object (File)
Thu, Dec 26, 8:16 AM
Unknown Object (File)
Thu, Dec 26, 8:15 AM
Unknown Object (File)
Thu, Dec 26, 8:05 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.