Skip to content

feat(fleetbase-api): driver manifests and driver password endpoints - #53

Open
roncodes wants to merge 1 commit into
mainfrom
feat/driver-manifests-and-password-endpoints
Open

feat(fleetbase-api): driver manifests and driver password endpoints#53
roncodes wants to merge 1 commit into
mainfrom
feat/driver-manifests-and-password-endpoints

Conversation

@roncodes

Copy link
Copy Markdown
Member

Documents the consumable endpoints added in
fleetops#304 and
fleetops#305.

Drivers — password management

Request Endpoint
Change Driver Password POST /drivers/:id/change-password
Request Driver Password Reset POST /drivers/forgot-password
Reset Driver Password POST /drivers/reset-password

A password change is an authorisation decision rather than an attribute update,
which is why it is not part of PUT /drivers/:idthat endpoint no longer
accepts a password at all
, which is the security fix in fleetops#304.

The descriptions carry the two properties a caller needs to know and cannot
discover by trying:

  • the reset request answers identically whether or not the identity exists,
    so it cannot be used to enumerate an organization's drivers
  • a wrong code, an expired code and an unknown identity all return the same
    error
    , so reset is not an oracle either

Manifests — a new folder

Request Endpoint
List Driver Manifests GET /drivers/:id/manifests
Retrieve a Manifest GET /manifests/:id
Update a Manifest Stop PATCH /manifest-stops/:id
Optimize a Manifest POST /manifests/:id/optimize

A manifest is a driver's route: an order-agnostic sequence of stops which may
span several orders, or none the driver has seen as an order. Retrieve returns
the stops in sequence with their places inline, so a route of twenty stops is
one request rather than twenty-one.

The optimize description says plainly what it is — a nearest-neighbour walk
over road distances
, usually a large improvement on an arbitrary order and not
guaranteed optimal. It reorders the stops of one assigned manifest rather than
allocating work across a fleet, which is what the orchestrator does. Completed
and skipped stops keep their place.

Creating, cancelling and deleting a manifest are dispatch operations and are
deliberately absent — they are not part of the consumable API.

Listing a driver's manifests sits with the other driver-scoped requests rather
than in the new folder, next to List Driver Organizations.

Validation

npm run postman:lint
Linting Fleetbase API...  No issues found.
Scanned: 196 | Errors: 0 | Warnings: 0

Not included: response examples

The endpoints are still in review on the fleetops release branch. An example
recorded against an unmerged branch would be a guess rather than verified
behaviour, and this repo's own rules ask for spec updates backed by verified
API behaviour. Happy to add them in a follow-up once fleetops#304 and #305 merge
— say the word and I will capture real responses against dev-v0.6.61.

Documents the consumable endpoints added in fleetops#304 and fleetops#305.

Drivers gains three password requests. A password change is an authorisation
decision rather than an attribute update, which is why it is not part of
PUT /drivers/:id — that endpoint no longer accepts a password at all. The
descriptions carry the two properties a caller needs to know about and cannot
discover by trying: the reset request answers identically whether or not the
identity exists, so it cannot be used to enumerate an organization's drivers,
and a wrong code, an expired code and an unknown identity all return the same
error.

A new Manifests folder covers the route a driver actually drives — a manifest is
an order-agnostic sequence of stops which may span several orders, or none the
driver has seen as an order. Retrieve returns the stops in sequence with their
places inline, so a route of twenty stops is one request rather than twenty-one.

The optimize description says plainly what it is: a nearest-neighbour walk over
road distances, usually a large improvement on an arbitrary order and not
guaranteed optimal, which reorders the stops of one assigned manifest rather
than allocating work across a fleet the way the orchestrator does. Completed and
skipped stops keep their place.

Listing a driver's manifests sits with the other driver-scoped requests rather
than in the new folder, next to List Driver Organizations.

No response examples yet: the endpoints are still in review on the fleetops
release branch, and an example recorded against an unmerged branch would be a
guess rather than verified behaviour. Happy to add them once merged.

npm run postman:lint — 196 requests scanned in Fleetbase API, 0 errors,
0 warnings.
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