Page MenuHomePhabricator

[identity] update login_password_user_start and register_password_user_start
ClosedPublic

Authored by varun on Jun 1 2023, 2:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 3:44 PM
Unknown Object (File)
Tue, Nov 5, 9:10 AM
Unknown Object (File)
Mon, Nov 4, 10:48 AM
Unknown Object (File)
Mon, Nov 4, 10:48 AM
Unknown Object (File)
Fri, Nov 1, 5:48 AM
Unknown Object (File)
Fri, Nov 1, 5:48 AM
Unknown Object (File)
Fri, Nov 1, 5:48 AM
Unknown Object (File)
Fri, Nov 1, 5:48 AM
Subscribers

Details

Summary

in these two methods, we now need to check if the username already exists in the reserved usernames table (which would indicate that it's already been claimed on ashoat's keyserver).

if it already exists in the reserved usernames table when the register RPC is called, we should send back an "already exists" gRPC status.

if it is not found in the users table but already exists in the reserved usernames table when the login RPC is called, we should send back a "failed precondition" gRPC status with a message indicating that the caller should try the new reserved registration RPC introduced earlier in the stack.

Depends on D8062

Test Plan

called the two RPCs with a username from my test reserved usernames table and got back the correct gRPC statuses

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Jun 1 2023, 2:55 PM

Since this is just a migration code path, I'm okay with it.

Let bartek take a look

services/identity/src/client_service.rs
422 ↗(On Diff #27379)

I would add comment just mentioning that this is slated to be removed in the future once the reserved names have been populated.

bartek added inline comments.
services/identity/src/client_service.rs
422 ↗(On Diff #27379)

Yeah, it will make it more clear what's going on and why

This revision is now accepted and ready to land.Jun 5 2023, 12:05 AM
services/identity/src/client_service.rs
422 ↗(On Diff #27379)

I added a comment explaining this code path, but I'm not sure if we'll be able to remove it in the future. There's no guarantee that all users from Ashoat's keyserver will register with the Identity service. Though I suppose we could just delete accounts that haven't claimed their usernames after a certain period of time.

This revision was landed with ongoing or failed builds.Jun 6 2023, 12:07 PM
This revision was automatically updated to reflect the committed changes.