Page MenuHomePhabricator

[grpc clients] Update Rust lib to use authenticated RPCs
ClosedPublic

Authored by bartek on Nov 27 2023, 4:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 8:20 AM
Unknown Object (File)
Fri, Nov 1, 4:30 PM
Unknown Object (File)
Wed, Oct 23, 3:29 AM
Unknown Object (File)
Mon, Oct 21, 2:20 AM
Unknown Object (File)
Mon, Oct 21, 2:03 AM
Unknown Object (File)
Mon, Oct 21, 1:46 AM
Unknown Object (File)
Sun, Oct 20, 7:12 PM
Unknown Object (File)
Sat, Oct 19, 5:08 PM
Subscribers

Details

Summary

Updated the client method to use the auth proto RPCs for GetOutboundKeys and GetInboundKeys.
Needed to add more params, cuz we need two distinct userID/deviceID pairs: for current user (auth) and for the user we want the keys for.

Depends on D10048.

Test Plan

Native and keyserver compiles. These functions aren't called anywhere at the moment in the JS code

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek retitled this revision from [native] Update Rust lib to use authenticated GetOutboundKeys to [grpc clients] Update Rust lib to use authenticated RPCs.Nov 27 2023, 5:12 AM
bartek edited the summary of this revision. (Show Details)
bartek edited the test plan for this revision. (Show Details)
bartek published this revision for review.Nov 28 2023, 8:04 AM
This revision is now accepted and ready to land.Nov 29 2023, 6:16 AM

can we improve the test plan here? just want to make sure these calls work as expected

can we improve the test plan here? just want to make sure these calls work as expected

Sure, tested this once again:

  • Started Identity Service
  • Registered a signle-device user manually (user A).

Keyserver part:

  • Started Keyserver, (filed the credentials file in secrets), made sure it registered in Identity (user B)
  • Called getInboundKeys of userA while given auth credentialsfor user B (the keyserver user) - console.log'ged the result (did this at the end of registerOrLogin() for simplicity)

Native part:

  • Did kind of opposite - used loginPasswordUser to log in as user A
  • Called getOutboundKeys for user B, given userA's auth, then printed the results (stringified JSON with prekeys appeared)

Forgot to attach screenshots:

Screenshot 2023-12-06 at 12.11.21.png (359×897 px, 132 KB)
Screenshot 2023-12-06 at 12.11.39.png (403×583 px, 86 KB)

Some values deliberately hardcoded to make sure they come from the place I'm expecting. Got it using

awslocal dynamodb scan --table-name identity-users

Those screenshots need to be "attached" on Phabricator still (see here)