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)
Thu, Sep 12, 10:50 AM
Unknown Object (File)
Thu, Sep 12, 10:50 AM
Unknown Object (File)
Thu, Sep 12, 10:50 AM
Unknown Object (File)
Thu, Sep 12, 10:50 AM
Unknown Object (File)
Aug 20 2024, 1:18 AM
Unknown Object (File)
Aug 19 2024, 8:24 AM
Unknown Object (File)
Aug 13 2024, 10:47 AM
Unknown Object (File)
Aug 13 2024, 10:47 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #41626)

I prefer builder pattern but up to you

360 ↗(On Diff #41626)

I guess this might be useful

1143–1146 ↗(On Diff #41626)

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 ↗(On Diff #41626)

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 ↗(On Diff #41626)

omitted the type annotation because it seemed fairly obvious