Page MenuHomePhabricator

[SIWE] Differentiate content for social proof and backup message.
ClosedPublic

Authored by marcin on Wed, Apr 24, 5:10 AM.
Tags
None
Referenced Files
F1697340: D11757.id39634.diff
Fri, May 3, 5:17 PM
F1695363: D11757.id39544.diff
Fri, May 3, 5:33 AM
Unknown Object (File)
Thu, May 2, 2:38 AM
Unknown Object (File)
Tue, Apr 30, 3:27 PM
Unknown Object (File)
Tue, Apr 30, 12:13 PM
Unknown Object (File)
Mon, Apr 29, 9:22 AM
Unknown Object (File)
Sun, Apr 28, 5:45 PM
Unknown Object (File)
Wed, Apr 24, 2:39 PM
Subscribers

Details

Summary

This differential introduces different SIWE message content for social proof and backup message.

Test Plan
  1. Ensure that siwe-utils.test.js pass during commit.
  2. I executed SIWE login flow and ensured that messages that appear in rainbow app match expected content.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Screen shot of rainbow app during social proof signature generation:

Screenshot_20240424-135140.png (2×1 px, 150 KB)

Screen shot of rainbow app during backup message signature generation:

Screenshot_20240424-135219.png (2×1 px, 151 KB)

ashoat added inline comments.
lib/utils/siwe-utils.js
83 ↗(On Diff #39434)

Can we use a more specific type here?

96–99 ↗(On Diff #39434)

If we can't use a more specific type easily, then maybe instead you can add an invariant here to make sure that the messageType is either one or the other option

This revision is now accepted and ready to land.Wed, Apr 24, 6:29 PM
lib/utils/siwe-utils.js
83 ↗(On Diff #39434)

Invariant can be avoided here and more specific type can be used. However this value is extracted from WebView headers in landing-handler. Therefore in order to avoid invariant here we will need to cast from string to SIWEMEssageType in landing-handler. This casting will have to use any. In my opinion it should be safe since in landing-handler we will use validator anyway before casting.

96–99 ↗(On Diff #39434)

I think the invariant you are requesting is already added at line 89.