Repository navigation
Release v0.7.3: App Review sign-in for customer apps - #437
Merged
Merged
Conversation
Apps that customers sign in to through the customer API send a texted code, which Apple's and Google's reviewers can't receive. Fleet-Ops registers the organization's customer apps with core's App Review access as its own type, fleetops-customer, with the review number +1 202 555 0145. - request-code, login-with-sms and request-creation-code (SMS) answer for the number as sent and send nothing; with access off they answer 422 and say where to turn it on - verify-code and create sign in with the organization's code as its review customer (App Reviewer, created on first use), never new_customer; the organization is the API key's - orders the review customer places get meta.app_review = true - Settings > Customer Apps turns it on and off, shows the number, and shows and regenerates the code - customer-app-settings permissions, a CustomerAppSettingsManager policy and a Customer App Manager role - every call passes the type, since Navigator is also registered on Company
Requires core-api 2.0.5. Until it is tagged, composer also accepts dev-release/v2.0.5 and the contract run links core-api's release branch.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #437 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 14754 14795 +41
===========================================
Files 679 680 +1
Lines 51439 51526 +87
===========================================
+ Hits 51439 51526 +87
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…and a review customer without an account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
App Review sign-in for any app customers sign in to through Fleet-Ops' customer API (
/v1/customers). Apple's and Google's reviewers can't receive a texted code, so the organization's owner turns this on in the Console and gives the app store a fixed number and a generated code. Navigator'sNavigatorReviewis the model. Nothing here is specific to rides or passengers.+1 202 555 0145(from the 555-0100–0199 range reserved for fiction, never texted). Navigator's stays +1 202 555 0144; customers and drivers are different accounts, and users are found by phone.settings.customer-apps). It turns review sign-in on and off, shows the number, and shows the code once and regenerates it. It is also in the settings hub and the AI console commands.server/src/Support/CustomerAppReview.php: typefleetops-customer, subjectCompany, registered next toNavigatorReview::register(). Every call passes the type explicitly, because Navigator is also registered onCompany.customer(Company)creates the organization's review customer (an "App Reviewer" user and customer contact in that company) the first time.Api/v1/CustomerController, with the company taken from the API key session:request-code,login-with-sms, andrequest-creation-codein SMS mode: for the review number with access on, they answer as a normal send and send nothing. With access off, they return 422 with a message saying to turn it on under Fleet-Ops → Settings → Customer Apps. A self-hosted review account listed infleetops.customers.review_accountskeeps its own flow.verify-codeandPOST customers(create): with the organization's code, they sign in as the review customer and return the same response as a normal sign-in. They never returnnew_customer, and they ignore the name the app sent.meta.app_review = true.fleet-ops view/update customer-app-settings(schema resourcecustomer-app-settings), aCustomerAppSettingsManagerpolicy and aCustomer App Managerrole.translations/en-us.yaml(en-us only).Release
package.json,composer.jsonandextension.jsonare bumped to 0.7.3, and RELEASE.md is written.fleetbase/core-api^2.0.5, which doesn't exist yet: it comes from Release v2.0.5: App Review types that share a model core-api#345. Until 2.0.5 is tagged,composer.jsonalso acceptsdev-release/v2.0.5, and the Postman contract job links core-api'srelease/v2.0.5. v0.7.2 handled 2.0.3 the same way. After 2.0.5 is tagged, drop both and require^2.0.5alone.Merge order
Tests
Run locally with core-api
release/v2.0.5path-linked:server/tests/Feature/Http/Api/CustomerControllerAppReviewTest.php(7 tests) covers:meta.app_review;ProfileAccountManagerTestadds a test thatCustomerAppReview::customer()creates one review customer per organization.composer test:unitdoes): 526 files, 2145 passed, none failing.ApiCustomerControllerContractsTestfailed mid-run because the review-customer check queried users for every order; that is fixed in this branch and the file passes (41 passed).customer-app-review-settings, copied from Navigator's, that I haven't run here (no Ember build).phpstan.neon.distdoesn't load with the PHPStan version a fresh install pulls (checkMissingIterableValueTypeis no longer accepted).Not in this PR
Reviewers' orders are real orders. They are marked
meta.app_review, but dispatch still treats them like any other order. If the customer app's order config dispatches ad hoc, nearby drivers would be offered a reviewer's order. Navigator's review driver is kept out of dispatch, but nothing yet keeps review-customer orders away from drivers.