Commit Graph

8460 Commits

Author SHA1 Message Date
Harry
cb6e99dd1d
Mark registration complete in RegistrationCoordinator 2023-02-24 11:12:22 -08:00
Evan Hahn
e2caeaa41f
Use consistent User-Agent for content proxy and captcha view 2023-02-24 08:28:37 -06:00
Max Radermacher
218663e430
Fix when ExitShareExtension gets called 2023-02-24 00:55:42 -08:00
Chris Eager
f14c0e7495 Add reportSpamToken to REST message fields 2023-02-23 18:07:52 -06:00
Max Radermacher
7225625be0
Swiftify some code that uses SignalRecipients 2023-02-23 11:47:47 -08:00
Harry
38cba70b85
Hook up new registration PIN entry screen 2023-02-23 09:50:17 -08:00
Max Radermacher
6dede44db6
Remove unused CDSv1 code
It’s been replaced by CDSv2.
2023-02-22 14:43:09 -08:00
Max Radermacher
0598c3f9b9
Clean up JobRecordFinder 2023-02-22 13:54:56 -08:00
Max Radermacher
b9a345bd36 Remove contactDiscoveryV2 feature flag
It’s enabled for all users, so we don’t need the flag.
2023-02-22 13:46:13 -08:00
Harry
55ce333d64
Don't set primary device id for linked devices that finish registration 2023-02-22 13:21:51 -08:00
Max Radermacher
e1bb2be0d8
Remove redundant error handling check
All HTTP errors are processed by the prior block in this case.
2023-02-22 12:04:30 -08:00
Max Radermacher
42bfe615ff
Check PNI before E164 in CDS lookups 2023-02-22 10:37:39 -08:00
Max Radermacher
59593c3c97
Add ServiceId & E164 types
* Use the new E164 type in a few places
* Use the new ServiceId type in a few places
2023-02-21 23:13:46 -08:00
Max Radermacher
7ac03076e6
Consolidate link preview fetching code 2023-02-21 12:49:25 -08:00
Evan Hahn
96cc668158
Move isWeakPin function, add tests
This change moves `PinSetupViewController`'s `isWeakPin` method to
`OWS2FAManager`, adds tests, and adds an additional length check.

This change should have no user impact and is useful for an upcoming
task.
2023-02-21 09:00:57 -08:00
Harry
f5bdd6bafa
Hook up RegistrationVerificationViewController
* Hook up RegistrationVerificationViewController

* Fix existing tests

* add new test cases

* pr comments
2023-02-21 08:37:08 -08:00
Evan Hahn
d3ce4fa45f Move autoreleasepool "up" a level for clarity
**I recommend reviewing this with whitespace changes disabled.**

We have some code that looks like this:

    func processAll() {
      while processNext() {}
    }

    func processNext() {
      autoreleasepool {
        process()
      }
    }

I think it's clearer to move the `autoreleasepool` "up" a level, like
this:

    func processAll() {
      while autoreleasepool(invoking: { processNext() }) {}
    }

    func processNext() {
      process()
    }

This change should have no user impact.
2023-02-21 05:51:42 -08:00
Ehren Kret
c0d77ee5c3
use consistent sign on last interaction row id 2023-02-18 00:33:44 -06: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
a6b2326ef3
Update registation API responses to match updated server spec
* Interpret nil nextVerificationAttempt as a code not having been sent yet, not as no code able to be submitted

* Update request and submit verification code handlers to latest server spec

* Update CreateAccountResponse codes to match server spec

* Update ChangeNumberResponse codes to match server spec

* Rename some cases for clarity, propagate up network errors vs generic errors

* pr comments
2023-02-17 14:11:43 -08:00
Evan Hahn
bef26c8c5d Save spam reporting tokens more reliably 2023-02-17 13:28:51 -08:00
Sasha Weiss
a6a17dcb6c
"Create a username" megaphone 2023-02-17 11:21:54 -08:00
Harry
39ec3d8d56
Hook together RegistrationNavigationController and RegistrationCoordinator
* Move RegistrationNavigationController

* Create the most basic version of RegistrationNavController conceivable

* Hook up RegistrationCoordinator

* Add new scheme for testing registration bravo
2023-02-17 08:00:48 -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
Max Radermacher
ad5bf7c597 Fix main queue scheduler 2023-02-16 12:18:15 -08:00
Sasha Weiss
5e0586ba7f
Add a flag for showing username education 2023-02-16 12:11:48 -08:00
Evan Hahn
3586894501
Consolidate E164 -> PhoneNumber code 2023-02-16 09:57:15 -08:00
Evan Hahn
34939106f1
New (dormant) registration UI: confirm before sending codes 2023-02-16 08:03:31 -08:00
Max Radermacher
77977fb597 Add background tasks for orphan data cleaner 2023-02-15 09:49:17 -08:00
Max Radermacher
c923ebd0dc
Fix Promise chain when sending typing indicators 2023-02-15 07:45:12 -08:00
Sasha Weiss
44a6fa24ab
Add contacts' usernames to ContactRecord, if nothing better available 2023-02-14 13:42:53 -08:00
Sasha Weiss
bb7013ec71
Store the local username on AccountRecord 2023-02-14 11:25:48 -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
Max Radermacher
272093e5f2
Fix device limit exceeded error handling 2023-02-13 13:45:26 -08:00
Max Radermacher
56154557dd
Add isStructurallyValidE164
This merges & replaces `resemblesE164:` and `isValidE164`.

Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2023-02-13 13:45:00 -08:00
Ehren Kret
cde10a000a fix lint warnings 2023-02-13 15:24:52 -06:00
Ehren Kret
87b8c36e69 eliminate variable shadowing in some nested transaction write blocks 2023-02-13 15:24:52 -06:00
Ehren Kret
f9a9484874 remove causes of variable shadowing 2023-02-13 15:24:52 -06:00
Ehren Kret
482973fafd do not use same variable for inner for loop as outer 2023-02-13 15:24:52 -06:00
Ehren Kret
8d592857dd rename variables to eliminate shadowing 2023-02-13 15:24:52 -06:00
Ehren Kret
7418f04308 rename variable to eliminate shadowing 2023-02-13 15:24:52 -06:00
Ehren Kret
8a04a8339e clarify variable name to eliminate shadowing 2023-02-13 15:24:52 -06:00
Ehren Kret
ace91b94fc remove unneeded variable that was shadowing another 2023-02-13 15:24:52 -06:00
Ehren Kret
ad0dc54271 rename variable causing shadowing 2023-02-13 15:24:52 -06:00
Max Radermacher
90769ea381
Swiftify OWSDeviceProvisioner 2023-02-13 12:12:16 -08:00
Max Radermacher
a47425f008
Use AES-GCM & AES-CTR from LibSignalClient 2023-02-13 11:29:41 -08:00
Max Radermacher
db2678e86b
Filter storage service contacts more consistently 2023-02-13 10:48:54 -08:00
Max Radermacher
c0850c5a26 Check for corruption in SDSRecord update/insert 2023-02-13 10:45:32 -08:00