Page MenuHomePhabricator

[Identity] Register user on native client
AbandonedPublic

Authored by jon on Apr 7 2023, 1:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 28 2024, 7:41 PM
Unknown Object (File)
Mar 28 2024, 7:37 PM
Unknown Object (File)
Mar 7 2024, 4:09 AM
Unknown Object (File)
Mar 6 2024, 11:53 PM
Unknown Object (File)
Mar 6 2024, 10:55 PM
Unknown Object (File)
Mar 6 2024, 6:25 PM
Unknown Object (File)
Mar 6 2024, 6:25 PM
Unknown Object (File)
Mar 6 2024, 6:25 PM
Subscribers

Details

Reviewers
varun
Summary

WIP commit with most of the rust code written for
registering a user.

This is missing:

  • JS bindings
  • Pomotion from blocking to async rust
  • Modifying current register logic to receive access_token
  • Modifying keyserver logic to respect identity service access_token for session creation

Depends on D7299

Test Plan

Once the above bullet points are done:

nix develop

comm-dev services start
(cd services/identity && cargo run -- keygen)
(cd services/identity && cargo run -- server &)

# Run 'yarn dev' in keyserver/ and native/
# Attempt to create new user on native device

Diff Detail

Repository
rCOMM Comm
Branch
jonringer/split-key-rpcs (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/native_rust_library/src/lib.rs
160

Removed client as each RPC should be closing it's connections anyway. Also, having to directly communicate with identity should be infrequent, so I didn't think there was a meaningful use case for the connection to linger between actions.

services/identity/src/client_service.rs
145–155

This is a bit awkward, i agree. But we essentially need to look at the user information, then grab the devices, look at the first device, as a new user should only have one device then grab the key associated with it.

The alternative (and I think cleaner) solution would be to have the device/X3DH information sent as part of the "finish" proto rpc, and then just use the information from the message. In this model, we would be updating the user with the password file (pakeRegistrationData), and adding a device.

services/identity/src/database.rs
287

a lot of these functions in src/database.rs haven't been properly tested. Might need some addtional work

575

this should probably force consistent_read(true), to ensure there's no other pending writes at the time.

958

I created a testcase to ensure this is likely to never get triggered.

varun requested changes to this revision.Jun 16 2023, 12:57 AM

i think we can discard this now. i've taken what i needed from it. back to your queue to abandon

This revision now requires changes to proceed.Jun 16 2023, 12:57 AM

This work was later adapted by varun.