[docs] API: what errors may repeat, Idempotency-Key in progress and limits, where a minted URL is held
This commit is contained in:
+10
-4
@@ -16,8 +16,11 @@ Everything below was run end to end on loopback against `--dev` with a real edge
|
||||
- **Host header.** Only `127.0.0.1:<port>`, `localhost:<port>`, `[::1]:<port>` and the
|
||||
configured `allowed_hosts` are answered (DNS rebinding). A browser write (`Origin` or
|
||||
`Sec-Fetch-Site` present) also needs `X-Ianitor-UI: 1` (CSRF).
|
||||
- **Bodies** are JSON, at most 64 KiB, with no unknown fields. Error messages never repeat a
|
||||
value you sent.
|
||||
- **Bodies** are JSON, at most 64 KiB, with no unknown fields. Errors about the request
|
||||
itself (bad JSON, a wrong type, an odd field name, a path that is no hostname) never repeat
|
||||
what you sent. Errors about a host can repeat its values (hostname, upstream, header name)
|
||||
in `params` and `detail`, but never a URL's user name and password (shown as `…@`), a secret
|
||||
value or a token.
|
||||
- **Errors** have one shape; `code` is stable, `message` is plain English, `field` points at
|
||||
the form field, `params` holds the values in the message, `detail` is the technical text:
|
||||
|
||||
@@ -32,7 +35,9 @@ Everything below was run end to end on loopback against `--dev` with a real edge
|
||||
`202 {"apply": {...}}` at once; poll `GET /applies/{id}` (every second) until `state` is
|
||||
`kept`, `reverted`, `failed` or `needs_attention`. Applies run one at a time, in order;
|
||||
the others are `queued`.
|
||||
- **`Idempotency-Key`** on a write: a retry with the same key gets the same apply back.
|
||||
- **`Idempotency-Key`** on a write: a retry with the same key gets the same apply back. While
|
||||
the first request with a key is still being handled, a retry gets `409 request.in_progress`
|
||||
(retry after 1 s). Keys are held in memory for 24 h (at most 2,000; then `429`).
|
||||
- **`base_rev`** (from `GET /hosts/{h}` or the overview's `rev`): the change is refused with
|
||||
`409 change.conflict` only if the same host file changed since.
|
||||
|
||||
@@ -194,7 +199,8 @@ curl -s -H "$H" -H 'Content-Type: application/json' -X POST "$API/hosts/wiki.dev
|
||||
"has_password": false, "url": "https://wiki.dev.test:18443/?share=ish1.…", "warning": null }
|
||||
```
|
||||
|
||||
The URL is shown once (control keeps no token). The first visit trades the token for a
|
||||
The URL is shown once: control never stores the token on disk; only an `Idempotency-Key`
|
||||
retry of this request gets the same answer again, from memory, for 24 h. The first visit trades the token for a
|
||||
path-scoped `HttpOnly; Secure; SameSite=Lax` cookie and redirects to the same URL without it:
|
||||
|
||||
```sh
|
||||
|
||||
Reference in New Issue
Block a user