batch-v07e: request limits by default (#870), language guide + Deutsch (Schweiz) (#869), follow-ups (#867), v0.6.326 #871

Merged
Cordy merged 24 commits from batch-v07e into main 2026-10-10 15:45:50 +00:00
Owner

Closes #869, closes #870. Follow-ups from #867.

#870 Request limits by default

  • New internal/httpx registry. Every route registers with a policy:
    • PreAuthSmall: 64 KiB, 15 s read deadline.
    • AuthAPI: 1 MiB plus a stall deadline.
    • Upload: progress deadline, 60 s stall.
    • NoBody / Exempt: for gRPC.
  • DecodeJSON answers 413, 408 or 400 with codes.
  • HTTP/1 sends Connection: close on refusals.
  • cairnd --routes lists every route; an inventory test enforces that each one has a policy, and no raw ServeMux is allowed.
  • An h2c Upgrade with a body is served as HTTP/1.1, so the body limits apply. Before this, x/net buffered the whole body uncapped before any handler ran.
  • On HTTP/2 a slow Authenticate no longer kills upload bodies.

#869 Language guide rollout

  • docs/i18n-style-guide.md is now binding.
  • Deutsch (Schweiz) is a fifth language, derived from de (ß→ss plus an override hook). It formats with de-CH and sets <html lang="de-CH"> on all 4 pages.
  • German: Sie register, ß in de, „…“ quotes.
  • French: vous register, ’ apostrophes, U+202F, « » quotes. Terms: Importer, Peering, conservation / blocage légal.
  • Italian: rewritten in impersonal form, voi where needed (388 strings), «…» quotes. Terms: registro di audit, password per app.
  • web/test/i18n-style.test.js guards these rules.
  • A stored language value is validated.
  • Request-limit error codes are translated.

#867 follow-ups

  • A second timed AD "must change" is now audited.
  • Search re-renders on a language change, with the pending timer cancelled.

Review

Every task was reviewed. The final whole-branch review (opus) found 2 Important issues, which were fixed. The scoped re-review found the pre-existing h2c Important, which was fixed.

  • go vet, go test ./..., -race on httpx/api/auth/cmd/cairnd, and gofmt are clean.
  • Web tests: 510 of 510 pass.

The CHANGELOG ## v0.6.326 includes upgrade notes.

Closes #869, closes #870. Follow-ups from #867. ## #870 Request limits by default - New `internal/httpx` registry. Every route registers with a policy: - **PreAuthSmall:** 64 KiB, 15 s read deadline. - **AuthAPI:** 1 MiB plus a stall deadline. - **Upload:** progress deadline, 60 s stall. - **NoBody / Exempt:** for gRPC. - `DecodeJSON` answers 413, 408 or 400 with codes. - HTTP/1 sends `Connection: close` on refusals. - `cairnd --routes` lists every route; an inventory test enforces that each one has a policy, and no raw ServeMux is allowed. - An h2c Upgrade with a body is served as HTTP/1.1, so the body limits apply. Before this, x/net buffered the whole body uncapped before any handler ran. - On HTTP/2 a slow Authenticate no longer kills upload bodies. ## #869 Language guide rollout - `docs/i18n-style-guide.md` is now binding. - Deutsch (Schweiz) is a fifth language, derived from `de` (ß→ss plus an override hook). It formats with `de-CH` and sets `<html lang="de-CH">` on all 4 pages. - **German:** Sie register, ß in `de`, „…“ quotes. - **French:** vous register, ’ apostrophes, U+202F, « » quotes. Terms: Importer, Peering, conservation / blocage légal. - **Italian:** rewritten in impersonal form, voi where needed (388 strings), «…» quotes. Terms: registro di audit, password per app. - `web/test/i18n-style.test.js` guards these rules. - A stored language value is validated. - Request-limit error codes are translated. ## #867 follow-ups - A second timed AD "must change" is now audited. - Search re-renders on a language change, with the pending timer cancelled. ## Review Every task was reviewed. The final whole-branch review (opus) found 2 Important issues, which were fixed. The scoped re-review found the pre-existing h2c Important, which was fixed. - `go vet`, `go test ./...`, `-race` on httpx/api/auth/cmd/cairnd, and `gofmt` are clean. - Web tests: 510 of 510 pass. The CHANGELOG `## v0.6.326` includes upgrade notes.
New internal/httpx: a Registry with ServeMux's method set that records
every route with its body policy (PreAuthSmall 64 KiB + 15 s deadline,
AuthAPI 1 MiB, Upload with a progress-extended deadline, NoBody,
Delegate), Check for the inventory, and DecodeJSON with the 1-byte
probe and drain so an over-cap body is always 413. obs.statusWriter
gains Unwrap so ResponseController reaches the connection.
Every route now registers through an httpx.Registry: the top-level
(session-less) side defaults to PreAuthSmall (64 KiB, 15 s body
deadline), the authenticated side to AuthAPI (1 MiB), GET/HEAD-only
routes to NoBody. One upload table per side in cmd/cairnd/bodypolicy.go
lists the large-body routes with their reasons (WebDAV PUT, TUS PATCH,
share drop, OCM grant PUT, peering blob, WOPI PutFile, web upload,
avatar, space image, audit trace); they get a progress-extended
deadline instead of a cap. The storage-setup server and the crypto role
use the same registry. Packages take httpx.Mux instead of *ServeMux.

All JSON request handlers decode through httpx.DecodeJSON (413 over
cap, 400 malformed). The pre-auth guard no longer accepts LimitReader;
ocm dirBook uses MaxBytesReader. cairnd --routes prints the inventory;
the inventory test runs the real main() and checks it.
Also gives the two share-drop upload entries one reason, so the
--routes inventory prints it once.
Every Italian prose string in index.html and the three first-run pages
(including the shared ERR block and the login throttle text) is now
impersonal, with voi where a pronoun is unavoidable; no tu or Lei forms.
Buttons keep the 2nd person singular imperative. Curly apostrophes,
«…» quotes, «registro di audit», «password per app», «blocco legale»,
«provider di identità», «pannello». The you badge is «Voi».

Guard: IT_PENDING and the pending mechanism are gone, the IT rule is a
plain assertion, and a new rule requires «…» quotes in Italian. Web test
pins that asserted the old Italian text are updated.
http: an h2c upgrade with a body is served as HTTP/1.1 so body limits apply (#870)
Some checks failed
ci / test-and-build (pull_request) Failing after 2m1s
57bef8b365
test: de-CH literal formats only where Node has full ICU (#869)
All checks were successful
ci / test-and-build (pull_request) Successful in 2m44s
1dac8290c5
Cordy merged commit 9bc9b167c7 into main 2026-10-10 15:45:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#871
No description provided.