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
Unknown Object (File)
Tue, May 7, 4:43 PM
Unknown Object (File)
Mon, May 6, 8:18 PM
Unknown Object (File)
Mon, May 6, 3:19 PM
Unknown Object (File)
Sat, May 4, 9:29 AM
Unknown Object (File)
Fri, May 3, 5:17 PM
Unknown Object (File)
Fri, May 3, 5:33 AM
Unknown Object (File)
Thu, May 2, 2:38 AM
Unknown Object (File)
Tue, Apr 30, 3:27 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
Branch
marcin/eng-7930
Lint
No Lint Coverage
Unit
No Test Coverage

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.