Page MenuHomePhabricator

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

Authored by atul on Dec 31 2022, 2:37 AM.
Tags
None
Referenced Files
F3213758: D6129.id20536.diff
Sun, Nov 10, 12:32 PM
F3213753: D6129.id20535.diff
Sun, Nov 10, 12:30 PM
Unknown Object (File)
Fri, Nov 8, 7:36 AM
Unknown Object (File)
Tue, Nov 5, 1:44 AM
Unknown Object (File)
Wed, Oct 23, 5:25 PM
Unknown Object (File)
Tue, Oct 22, 5:15 PM
Unknown Object (File)
Tue, Oct 22, 12:21 PM
Unknown Object (File)
Tue, Oct 22, 12:21 PM
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.