Follow an API Request from Client to Data
Trace a dispatch update across gateway, middleware, handler, and database while keeping user and service authority separate.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
Start with one ordinary request
An API is an agreement about operations and data exchanged between programs. In a REST-style interface, a URL identifies a resource and an HTTP method expresses an operation on it. JSON is a representation of data; it is neither a permission system nor proof that a request came from your application. A mobile app, browser, command-line client, and another service can all send the same HTTP request.
Our example is DispatchDesk. Mira belongs to the North workspace and may rename its deliveries. Delivery 41 belongs to North; delivery 82 belongs to South. The ordinary request changes delivery 41's label. The review begins with the intended rule, not a search for suspicious punctuation.
PATCH /v1/deliveries/41 HTTP/1.1
Host: dispatch.example.test
Authorization: Bearer <Mira's access token>
Content-Type: application/json
{"label":"Reception desk"}
There are two different questions: “Who sent this?” and “May this person change this delivery?” Add a third when a service calls another service: “Which workload is making the call, and on whose behalf?” A valid gateway certificate answers the workload question. It cannot make South's delivery belong to Mira.