Page MenuHomePhabricator

[identity] Forbid registering multiple devices with the same ID
ClosedPublic

Authored by bartek on Fri, Jun 7, 3:59 AM.
Tags
None
Referenced Files
F2131332: D12350.diff
Thu, Jun 27, 6:16 PM
F2130198: D12350.id41432.diff
Thu, Jun 27, 3:38 PM
Unknown Object (File)
Wed, Jun 26, 12:52 PM
Unknown Object (File)
Wed, Jun 26, 10:36 AM
Unknown Object (File)
Wed, Jun 26, 5:11 AM
Unknown Object (File)
Mon, Jun 24, 12:35 AM
Unknown Object (File)
Sat, Jun 22, 10:10 PM
Unknown Object (File)
Sat, Jun 22, 7:44 PM
Subscribers

Details

Summary

Addresses ENG-8383.
We don't want to allow registering multiple users with the same device ID.
However, if given device ID belongs to the same user, we can allow that (details in Linear task).

Depends on D12349

Test Plan

Commtest: called register_user_device() twice with the same device keys. Second call failed due to Status::AlreadyExists

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Sun, Jun 9, 11:52 PM
bartek added 1 blocking reviewer(s): varun.
This revision is now accepted and ready to land.Wed, Jun 12, 8:56 AM

in the login RPCs, don't we need to check that the device ID doesn't belong to a different user if it already exists?

varun requested changes to this revision.Wed, Jun 12, 9:05 AM
This revision now requires changes to proceed.Wed, Jun 12, 9:05 AM

Verify if device ID belongs to the same user

services/identity/src/client_service.rs
1107 ↗(On Diff #41366)

I'm going to rebase on @varun's stack (when it's landed) before landing this and add a constant for this message

services/identity/src/client_service.rs
1107 ↗(On Diff #41366)

thanks, will land my stack ASAP

This revision is now accepted and ready to land.Mon, Jun 17, 10:26 AM

Add constant for Tonic status code