Commit Graph

17 Commits

Author SHA1 Message Date
Harry
5ad17c4f2d
Support change number in registration coordinator
* Factor out RegistrationCoordinatorLoader

* Add PNI change number state to regcoordinatorloader

* Don't exit change number flow once we start a pni operation

* Add ChangePhoneNumberPniManager to reg coordinator dependencies

* add params required for pni to change number registration mode

* change number from regcoordinator

* rename ChangePhoneNumber -> LegacyChangePhoneNumber

* remove pni change number support from LegacyChangePhoneNumber

* remove codable conformance from pni change number manager's pending state

* Update ts account manager state when finalizing change number

* Add message processor deps to reg coordinator

* addAsyncCompletion on dbv2 write transactions

* Suspend message processing while doing a reg coordinator change number

* hook up change number

* Add handler-free message processing suspension method

* odds and ends

* minor cleanup

* slight refactor to finalize change phone number in the export function

* Put wait for message processing + suspend onto messageProcessor

* kick of prekey refresh after pni change number finalize transaction ends

* nit
2023-03-17 17:55:06 -07:00
Harry
a31fb00368
Change all e164 references in reg coordinator to E164 type 2023-03-16 11:32:13 -07:00
Sasha Weiss
367fdd769c
Rename KeyBackupServiceProtocol 2023-03-14 16:29:21 -07:00
Sasha Weiss
81b6201a03
Rename KeyValueStoreProtocol -> KeyValueStore 2023-03-14 13:26:06 -07:00
Harry
ac9a68688c
Set registration recovery password in AccountAttributes
* Move AccountAttributes into shared file

* Add AccountAttributesRequestFactory

* Add new AccountAttributes generators

* Migrate verifyPrimaryDeviceRequest

* Migrate verifySecondaryDeviceRequest

* clarify the role of secondary device account attributes

* Remove AuthKey from AccountAttributes; it was unused on the server and therefore totally vestigial

* remove old updatePrimaryDeviceAttributes request and associated code

* Add registration recovery password to AccountAttributes

* Unconditionally set account attributes when changing or setting the PIN

* fix tests

* easy pr comments

* dont set v1 2fa pin unless no kbs backups exist
2023-03-14 13:11:09 -07:00
Pete Walters
3e3e0e5acf
Add manager to periodically validate usernames 2023-03-14 09:56:08 -05:00
Harry
feeabc2ba8
Catch re-entrant MockDBv2 transactions in tests
* Catch re-entrant MockDBv2 transactions in tests

* Fix some promise + transaction issues in RegCoordinator

* undo dumdum changes; dont handle errors on a guarantee
2023-03-10 15:03:27 -08:00
Harry
a146e18aaf
Set up account state and exit registration
* Go to chat list view after registration

* sync system contacts during registration

* Use explicit local credentials for storage service operations during registration

* fix tests

* Quick hack to get through double pin confirmation

* Finishing touches

* lint

* fix build

* reload phone number discoverability after storage service sync

* fix tests again

* Take chat auth on account and contact record initializers

* Change around branches for clarity in OWSUserProfile

* pr comments

* Split ChatServiceAuth into the same and AuthedAccount

* fix tests

* merge woes
2023-03-09 21:54:51 -08:00
Evan Hahn
2d48da8a6d
Handle new registration push challenges 2023-03-09 15:54:47 -06:00
Evan Hahn
7deb93ee98 Test scheduler: handle advancement to current time or earlier
This change should have no user impact.

Two changes:

1. Calling `advance(to: timeInThePast)` is now a fatal error.
2. Calling `advance(to: currentTime)` is now tested.
2023-03-06 12:23:13 -06:00
Harry
8c42d66489
Wipe related state on RegCoordinator when session id changes
* Wipe related state on RegCoordinator when session id changes

* Update Signal/Registration/RegistrationCoordinatorImpl.swift

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

* Update Signal/Registration/RegistrationCoordinatorImpl.swift

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>

---------

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2023-03-06 09:50:18 -08:00
Harry
798ad6dc67
Hook up RegistrationPermissionsViewController
* Hook up RegistrationPermissionsViewController

* Update tests accordingly

* rebase woes

* Simplify opening path testing in RegistrationCoordinatorTest
2023-02-17 16:31:13 -08:00
Harry
cd63f67b3e
Retry most network failures in RegistrationCoordinator
* Retry most network failures in RegistrationCoordinator

* Update the way we identify network errors to be more flexible

* Retry remaining requests

* Automatically retry registration requests if time intervals are short

* fix error types not compiling on kbs

* Add test for reg recovery password reg with retries

* fix extra t
2023-02-17 14:50:54 -08:00
Harry
a23d469aac
Finish registration in RegistrationCoordinator
* Finish registration in RegistrationCoordinator

* Get tests to compile again (but not pass)

* Tests passing again

* Test session happy path all the way through to completion

* Test KBS auth credential happy path all the way through to completion

* Test KBS reg recovery password happy path all the way through to completion

* PR comments
2023-02-16 17:21:21 -08:00
Harry
9501a5bbf5
Populate AccountAttributes in RegistrationCoordinator
* Populate AccountAttributes in RegistrationCoordinator

* pr comments and cleanup
2023-02-14 10:40:47 -08:00
Harry
3d6225060d
Add RegistrationCoordinator
* Add ability to compute registration recovery password

* Add RegistrationCoordinator

* remove repeat nav controller that evan added

* Scaffolding for RegistrationCoodinator test

* Add first round of RegistrationCoordinator tests, some stuff I needed to get them working, and some fixes to RegistrationCoordinator itself I discovered thanks to the tests

* switch to owsFailBeta

* Add auth credential candidate flow tests, related fixes and additions to coordinator and friends

* Add tests for session based registration path and associated fixes

* PR comment nits
2023-02-14 08:50:24 -08:00
Sasha Weiss
e5f1af6c2e
Support lookup-by-username 2023-02-08 10:16:57 -08:00