A run's job surfaces authorise first, and never share one caller's answer
A caller is authorised before anything is read, a cached answer for one caller is never served to another, and a surface admits exactly whom the authority it checks admits, no more and no fewer.
The rule
- On a run's job surfaces, the caller MUST be authorised before anything about the run or its jobs is read.
- A response served to one caller MUST NOT be served from a cache to another caller.
- Each surface MUST admit exactly the callers that the authority over the run, or over the job, admits wherever else it is checked: a surface MUST NOT admit fewer callers, or more, by applying a narrower check of its own.
- Authority over a job is not authority over a run.
- A run the caller is not allowed to view MUST be refused before anything about it (its jobs, its summary, its label) is assembled.
- A request naming a run that does not exist MUST be answered
404with the codeNOT_FOUNDonly to a caller holding blanket authority over runs, and one naming a job that does not exist only to a caller holding blanket authority over jobs (conventions); every other identified caller MUST get the same403with the codeACCESS_DENIEDthat a run or job it may not view gets, so these surfaces cannot be used to learn which runs or jobs exist (PIPE-1).
What it means
A missing run or job is answered the way a run or job the caller may not view is
answered: 403 ACCESS_DENIED. Only a caller with blanket authority over runs
learns that a run identifier names nothing, and only one with blanket authority
over jobs learns that a job identifier does (404 NOT_FOUND), because for that
caller existence is no secret. Anyone else cannot tell "does not exist" from
"not yours", so the job surfaces cannot be used to find out which runs or jobs
exist. The run reads (PIPE-1), snapshots (SNAP-2) and signals (INT-16) answer
the same way.
Authorisation comes first, and it is the same answer the authority gives anywhere else: a surface that checked a narrower condition of its own would turn away callers the authority admits, or let in callers it does not. And because two callers can be told different things, an answer cached for one is never served to the other.
Authority over a job and authority over the run it belongs to are separate questions: holding one is not evidence for the other, so a run the caller may not view is refused before anything about it, its jobs included, is assembled.
Example
A job identifier that does not exist, asked for by a caller without blanket authority over jobs, gets the same answer as a job it may not view.
GET /api/flowdrop/job/{job_id}
{"success": false, "error": "Access denied", "error_code": "ACCESS_DENIED"}The path is an example of the route API-9 names job.