HomePhabricator
Diffusion Comm af3bd6da97b5

[keyserver] Login or register before tables are created

Description

[keyserver] Login or register before tables are created

Summary:
issue: ENG-7267
We want to login / register before db starts being set up, so that if the credential are incorrect, and an error is thrown, the db is not left in an inconsistent state
unpickleAndUseCallback is modeled on fetchCallUpdateOlmAccount, but was rid of code that is used for fetching from and saving to the db. I also skipped retries, which only make sense if we operate on the db - they imitate transactions. Instead of fetching and saving account in the db, I remember them in the memory, and return them from verifyUserLoggedInWithoutDB to be saved once the tables get created

Test Plan:
Ran my nix script that created a new ks, checked that the admin got correctly registered with identity.
Ran my nix script and provided incorrect credentials - checked that there are no tables in the db
Checked that the accounts saved to the db are the accounts after transformations (logged the accounts at the end of verifyUserLoggedInWithoutDB and checked that the same ones are in the db)

Reviewers: will, marcin, kamil

Reviewed By: marcin

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11542

Details

Provenance
inkaAuthored on Apr 3 2024, 6:42 AM
Reviewer
marcin
Differential Revision
D11542: [keyserver] Login or register before tables are created
Parents
rCOMMd7b2b0417a8e: [keyserver] Refactor registerOrLogIn to take callbacks
Branches
Unknown
Tags
Unknown