Record authenticated API perimeter release
This commit is contained in:
parent
f905376a22
commit
b6776d8169
3 changed files with 22 additions and 0 deletions
|
|
@ -835,6 +835,16 @@ peers receive `403`, and the browser hides the operator panel away from
|
|||
loopback. Do not replace this with trusted forwarded headers unless a named
|
||||
reverse proxy becomes the actual connection owner.
|
||||
|
||||
The subsequent perimeter audit found that protected handler JSON extractors
|
||||
ran before their handler-local session checks. All `/api` routes now share one
|
||||
authentication middleware which rejects invalid sessions before reading or
|
||||
deserializing the body. Handler checks remain as the session-identity and
|
||||
revocation guard, not the perimeter owner. Release
|
||||
`f905376a2278c48bf474ab3b665fe12a241d69de` proves malformed and three-megabyte
|
||||
anonymous command bodies receive `401`; authenticated malformed JSON still
|
||||
reaches the normal `400` extractor path. The full workspace passed 137 core
|
||||
tests and 13 daemon tests. Invitations were neither rotated nor consumed.
|
||||
|
||||
## Warnings
|
||||
|
||||
- Keep persistent state small. Git history and artifacts own chronology.
|
||||
|
|
|
|||
|
|
@ -318,6 +318,17 @@ approval has its own route. Strategic ticks, region commits, gestalt presence,
|
|||
reaction waves, NPC initiative, and campaign creation are internal mailbox
|
||||
commands and cannot be invoked through `/api/command`.
|
||||
|
||||
Authentication owns entry to the complete `/api` router before request-body
|
||||
extraction. Axum's protected-route middleware reads only headers and durable
|
||||
session authority; an invalid session receives `401` before JSON parsing,
|
||||
schema rejection, campaign lookup, inference, or mutation. Handlers repeat the
|
||||
session lookup where they need the session identity, so revocation between the
|
||||
perimeter check and a handler cannot leave stale authority alive. Public
|
||||
`/health`, single-use `/invite/{token}`, and static browser assets remain
|
||||
outside this middleware. Regressions prove malformed anonymous JSON is refused
|
||||
at the perimeter while the same malformed body under a valid session reaches
|
||||
the ordinary `400` extractor response.
|
||||
|
||||
That boundary also projects less state outward than the kernel returns inward.
|
||||
Player HTTP responses contain only assessment, public commit/roll receipts, and
|
||||
narration. Canonical campaign state and spoiler-bearing actor or institution
|
||||
|
|
|
|||
Loading…
Reference in a new issue