Page MenuHomePhabricator

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

Authored by atul on Dec 31 2022, 2:37 AM.
Tags
None
Referenced Files
F3234847: D6129.id20537.diff
Tue, Nov 12, 10:50 PM
Unknown Object (File)
Sun, Nov 10, 12:32 PM
Unknown Object (File)
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
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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Dec 31 2022, 2:38 AM
ashoat added inline comments.
lib/utils/siwe-utils.js
48

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

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

lib/utils/siwe-utils.js
48

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

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

49

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.