fix: stop the driver password requests breaking driver auth, and give the manifest requests a manifest - #57
Merged
Conversation
manifest requests a manifest Three faults, all found in the FleetOps contract run rather than locally. Create a Driver was writing driver_identity, driver_password and driver_phone. Those name the driver a contract run seeds and injects, and Login Driver, Request Driver Login SMS and Verify Driver Login Code authenticate as it — so the throwaway driver created here, deleted a few requests later, was signing all three in as an account that no longer existed. It now writes created_driver_* and leaves the seeded names alone. pm.execution.skipRequest() is not a skip. The Postman CLI reports it as "Request could not be completed", which is a run error and fails the contract. Every guard using it is gone. The manifest requests had nothing to address because they ran before the thing that creates a manifest. POST /orchestrator/commit returns the manifests it created, so the folder is ordered after Orchestrator and takes its id from there; Retrieve a Manifest passes a stop on to Update a Manifest Stop. My earlier note claiming the API cannot create a manifest was simply wrong. Reset Driver Password now asks for a code issued for a password reset rather than a login code, and sets the password back to the one already in force so the run stays repeatable. Seeding it needs the matching change in fleetbase/fleetbase.
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.
Follow-up to #53. That PR is merged; this fixes what it broke in the FleetOps contract run
(failing run —
4 assertion failures and 3 run errors, all attributable to #53).
1. Create a Driver was overwriting the seeded driver's identity
driver_identity,driver_passwordanddriver_phonename the driver a contract run seeds andinjects with
--env-var. Login Driver, Request Driver Login SMS and Verify Driver LoginCode authenticate as that driver. #53 had Create a Driver write its own throwaway driver into those
three variables, so all three signed in as an account that gets deleted later in the run:
It now writes
created_driver_email/created_driver_phone/created_driver_passwordand leavesthe injected names alone. Change Driver Password proves the created driver's own password.
2.
pm.execution.skipRequest()is not a skip#53 guarded the requests that need a fixture with it. The Postman CLI reports that as
"Request could not be completed" — a run error, which fails the contract exactly as a bad
response would. That was the three
Errorentries. Every guard is gone; each request now hassomething real to address.
3. The manifest requests had no manifest
POST /orchestrator/commitis what creates a manifest — it returns the ids it created. The Manifestsfolder is now ordered after Orchestrator and takes its id from there, and Retrieve a Manifest passes a
stop id to Update a Manifest Stop. The note in #53 claiming the API cannot create a manifest was
wrong.
4. Reset Driver Password needed a code meant for a reset
resetPasswordmatches a verification code on subject, value and purpose, and its purpose isdriver_password_reset. Adriver_logincode does not satisfy it. It now asks for{{driver_password_reset_code}}, seeded by fleetbase/fleetbase#636, and sets the password back tothe one already in force so the run stays repeatable and the login requests still authenticate.
Merge order
fleetbase/fleetbase#636 first, then this. Without it
Reset Driver Passwordhas no code to send.Verified
Run against a live instance under the contract run's own request ordering
(
scripts/ci/order-collection-requests.py, which defers every DELETE to the tail — the reason aplain local run is not a faithful simulation):
The manifest chain resolves real ids end to end (
commit→manifest_7sedsluegw→ stopmstop_wsdnxmfafv→ 200), where before the URLs still contained a literal:id.Lint is clean: 196 requests, 0 errors, 0 warnings.