Page MenuHomePhabricator

[identity] fix reserved username workflow for wallet users
ClosedPublic

Authored by varun on Jun 21 2024, 4:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 6:17 AM
Unknown Object (File)
Wed, Dec 18, 6:17 AM
Unknown Object (File)
Wed, Dec 18, 6:17 AM
Unknown Object (File)
Wed, Dec 18, 6:17 AM
Unknown Object (File)
Wed, Dec 11, 11:35 PM
Unknown Object (File)
Nov 16 2024, 4:16 AM
Unknown Object (File)
Nov 3 2024, 4:56 AM
Unknown Object (File)
Oct 19 2024, 12:24 AM
Subscribers

Details

Summary

wallet users prove their identity with SIWE so there's no need for them to get a message from ashoat's keyserver.

one thing to note here is that users don't send OTKs when calling log_in_wallet_user, so the user won't have any OTKs initially. I think we made OTKs optional, though, so not sure how much this matters.

another thing to note is that if the user is registered here, their device list will be created by the identity service

Depends on D12515

Test Plan

tested later in stack by registering a password and wallet user directly with my keyserver, which in turn called identity and added the address and username to the reserved usernames table

then, i flipped usingCSAT to true and tried logging in from web, which failed and displayed a message saying to log in from a mobile device

then, i tried logging in from native, which succeeded

then, i tried loggin in from web again, which succeeded

verified that username and wallet address were no longer in reserved usernames table

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun requested review of this revision.Jun 21 2024, 4:53 PM

Looks good. Left some nits

services/identity/src/database.rs
354–357

I prefer builder pattern but up to you

360

I guess this might be useful

1143–1146

Nit, more readable

This revision is now accepted and ready to land.Jun 21 2024, 10:51 PM
services/identity/src/database.rs
354–357

we only use set_transact_items in the codebase today so created a follow up task for this: https://linear.app/comm/issue/ENG-8523/consider-using-transact-items-instead-of-set-transact-items

1143–1146

omitted the type annotation because it seemed fairly obvious