Skip to content

Release v0.7.4: Drivers sign in with the platform token - #438

Open
roncodes wants to merge 19 commits into
mainfrom
release/v0.7.4
Open

roncodes wants to merge 19 commits into
mainfrom
release/v0.7.4

Conversation

@roncodes

@roncodes roncodes commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What changed

Navigator is built for an instance, not one organization, so an organization's API key had to be built into the app only to reach the driver sign-in routes. These routes now also accept the instance's platform token, through core-api 2.0.6's fleetbase.api-or-platform group:

  • POST v1/drivers/login
  • POST v1/drivers/login-with-sms
  • POST v1/drivers/verify-code
  • POST v1/drivers/forgot-password
  • POST v1/drivers/reset-password

The driver's organization already came from their account, not from the key, so the handlers are unchanged for sign-in. API keys and driver tokens work on these routes as before, and every other route still refuses the platform token.

  • Driver sign-up: verify-code with for=create_driver answers 403 to a platform token. The token ships inside apps and belongs to no organization, so it can't create a driver in one.
  • App Review sign-in: the review code belongs to an organization, which the API key used to identify. A platform-token request names it with organization; an API key's organization is still its own and the field is ignored.

Requires fleetbase/core-api 2.0.6 (fleetbase/core-api#346). Until it is tagged, composer also accepts dev-release/v2.0.6 and the contract run links that branch. No migration.

Testing

  • RouteRegistrationExecutionTest, ApiDriverControllerContractsTest and ApiDriverPasswordContractsTest pass locally, with new tests that pin the list of routes open to the platform token and the sign-up refusal. The rest of the suite was not run locally.
  • Checked against a local instance with a real platform token: login reaches the handler, forgot-password answers 200, sign-up is refused with 403, and v1/drivers and v1/orders answer 401.
  • Not checked: App Review sign-in with organization against a live instance.

Requires core-api 2.0.6. Until it is tagged, composer also accepts
dev-release/v2.0.6 and the contract run links core-api's release branch.
The driver sign-in routes (login, login-with-sms, verify-code,
forgot-password, reset-password) also accept the platform token, so an app
built for an instance needs no organization's API key. API keys and driver
tokens work on them as before.

Driver sign-up through verify-code is refused to a platform token, and App
Review sign-in reads the organization from the request when there is no
API key to identify it.
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.99%. Comparing base (3cd31a2) to head (01b7270).

Files with missing lines Patch % Lines
...r/src/Http/Controllers/Api/v1/DriverController.php 75.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##                main     #438      +/-   ##
=============================================
- Coverage     100.00%   99.99%   -0.01%     
- Complexity     14795    14801       +6     
=============================================
  Files            680      680              
  Lines          51526    51541      +15     
=============================================
+ Hits           51526    51538      +12     
- Misses             0        3       +3     
Flag Coverage Δ
backend 99.99% <84.21%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ding settings

- The Navigator link carries the instance's platform token when core can return it, instead of an organization's API key; the old key remains the fallback until the token is rotated once
- get-link-app also returns the app link, its QR code and the server details; organization staff who can view Navigator settings may read it once it carries the platform token
- New share-link endpoint emails or texts drivers a signed link that works for 7 days
- Console: a 'Link the Navigator app' panel with the QR code (download, print), the link, the app link and sending to chosen or all drivers, on the Navigator App settings page and in the admin panel
- Driver onboarding settings: the documents flag is saved under its real name, the driver-facing read endpoint accepts the platform token and returns the settings in the form the app reads
- Each organization that allows sign-up by button gets a join code; the QR code carries it together with the server link
- New endpoints, open to the platform token: look a join code up, text a verification code, create the driver once the code checks out
- Console: the onboarding settings show the join code and its QR code, with download and replace
A 'What drivers see' panel on the Navigator App settings page, with one switch so far: show the service rate on orders (on by default). Drivers' apps read it from GET v1/navigator/settings.
…er carry time windows

- A manifest stop returns its role (pickup, waypoint, dropoff, return), its position among the order's points, the waypoint it stands for, the time window and service time that apply, per-waypoint notes and proof requirements, and its meta
- Orders return their time window
- Tracker stops return their time window, and the tracker reports a real delay: the live arrival estimate against the end of the active stop's window
…sue fields

- GET v1/manifests/{id}/route returns the road route through a manifest's stops from the organization's routing engine, with per-leg geometry where the engine allows, cached, and an empty line rather than an error when routing is unavailable
- Going on and off duty is recorded: drivers.online_since and one driver_duty_periods row per stretch; the driver resource returns online_since
- GET v1/drivers/{id}/day-summary returns the day's waypoints, completed orders, planned and driven distance, time on duty, cash on delivery due and first and last activity
- Fuel reports accept and return a station, fuel type, note and receipt files
- Issues keep the order they are about, return it with their files, and expose their timeline to the driver
…nsole approves or sends back

The documents named in the onboarding settings can now be sent from the
Navigator app (GET and POST v1/drivers/{id}/documents), stored as files
against the driver, and reviewed from the driver's panel in the console.
A driver who signed themselves up stays pending, and cannot go online,
until every document is approved; approving the last one releases them.
The driver is told by push when a document is approved or sent back.
…ds; a driver found online with no start on record begins one

Every read of driver_duty_periods asked for deleted_at, which the table
did not have, so GET drivers/{id}/day-summary failed on every call.
…coped to their own driver

GET and PUT v1/drivers/{id}/notification-preferences let a driver switch
off pushes for new work, order changes, messages and offers. POST
v1/orders/{id}/cash-collected records the cash a driver took, and the day
summary reports it. A driver's own token now reaches only that driver's
manifests and waypoints.
…d a notification sent by hand

The app's device registration now records the phone's name, model, system,
app version and whether it is a development build; signing out marks the
device. The driver's panel in the console lists the devices and can send a
notification to one or all of them.
…eates the order's channel between its driver and dispatch
…ey name; offers last 90 seconds and can be sent again; one push per action

A new Navigator setting, off by default, decides whether a driver may
dispatch an order. capture-qr finds which item of the order a code
names. The sequential ad-hoc offer lasts 90 seconds by default and its
expiry travels with the ping. Offer Again re-runs ad-hoc dispatch for an
order that found no driver. Creating and dispatching an order together
tells the driver once.
…date-activity needs a submitted inspection filed for the order, an unsafe one refuses the step and tells dispatch; console toggle and form picker
… stop: the console sends the stop's address when it has no id yet, so match it to the order's stop by address and drop it if none matches instead of failing the insert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant