Security / 2 / 3
Authorization
Knowing who the caller is does not tell you what they may do. An invoicing app shared by many companies learns this the hard way: changed ids in the URL, forgotten checks, and a service account that could do anything.
- 12 min
- Intermediate
- 10 steps
- Foreign records read
- 0 /day
- API p95
- 45 ms
- Job permissions
- —
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Web app → Invoice APIRequest
GET /invoices/inv_1042 HTTP/1.1
Host: api.example.com
Authorization1: hidden
Response
HTTP/1.1 200 OK
{
"id": "inv_1042",
"company_id": 2"c_7",
"amount": 1250000,
"status": "approved"
}
Authorization· hidden — Alice's access token. It proves who she is, nothing more. Hidden here.company_id— The invoice belongs to companyc_7. The API never compared this to Alice's company.
Course: 42 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes