Page MenuHomePhabricator

[identity] Implement RPC for secondary device registration
ClosedPublic

Authored by bartek on Jan 29 2024, 4:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 2:11 AM
Unknown Object (File)
Thu, Jun 13, 6:46 PM
Unknown Object (File)
Wed, Jun 12, 9:39 PM
Unknown Object (File)
Wed, Jun 12, 2:39 PM
Unknown Object (File)
Wed, Jun 12, 9:51 AM
Unknown Object (File)
Sun, Jun 9, 4:55 PM
Unknown Object (File)
Thu, Jun 6, 11:09 PM
Unknown Object (File)
Thu, Jun 6, 11:06 PM
Subscribers

Details

Summary

Implementation of RPC from D10861.

  • Created function to put device data into device list (device key upload)
  • Called this function along with access token creation from the RPC handler
  • Performed basic device list checks - the RPC fails if the device is not on the device list.

Depends on D10861, D11072, D11073

Test Plan

Tested both scenarios: device on device list and device not on device list.

  • If the device is not on the list, fails with permission denied status
  • When the device is on the list, the RPC succeeds and returns the access token. Used awslocal dynamodb scan to make sure device keys are put in the devices table under userID|device-{deviceID} primary key.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 29 2024, 5:28 AM
bartek added inline comments.
services/identity/src/client_service.rs
599–602 ↗(On Diff #36258)

This is related to "device list rotation" and we'll be able to simplify this check when "final version of device list" is implemented.
In fact, even at this point, this scenario should never happen because device list is generated during login.
If the client somehow gets this error, it should log out and log in again

bartek retitled this revision from [identity] Implement RPC for secondary device login to [identity] Implement RPC for secondary device registration.Feb 14 2024, 4:44 AM
bartek edited the summary of this revision. (Show Details)

Update on parent feedback, introduce nonce challenge

varun added inline comments.
services/identity/src/client_service.rs
603 ↗(On Diff #37068)

i don't think this comment is very useful

623 ↗(On Diff #37068)

same here

This revision is now accepted and ready to land.Feb 15 2024, 9:15 PM

Rebase. Remove unnecessary comments