Page MenuHomePhabricator

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

Authored by bartek on Jun 7 2024, 3:59 AM.
Tags
None
Referenced Files
F2833681: D12350.id41097.diff
Sat, Sep 28, 8:26 AM
Unknown Object (File)
Thu, Sep 12, 6:23 AM
Unknown Object (File)
Tue, Sep 10, 4:39 PM
Unknown Object (File)
Tue, Sep 10, 4:39 PM
Unknown Object (File)
Tue, Sep 10, 4:39 PM
Unknown Object (File)
Tue, Sep 10, 4:39 PM
Unknown Object (File)
Tue, Sep 10, 4:37 PM
Unknown Object (File)
Tue, Sep 10, 4:37 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.Jun 9 2024, 11:52 PM
bartek added 1 blocking reviewer(s): varun.
This revision is now accepted and ready to land.Jun 12 2024, 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.Jun 12 2024, 9:05 AM
This revision now requires changes to proceed.Jun 12 2024, 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.Jun 17 2024, 10:26 AM

Add constant for Tonic status code