Expand description
HTTP routes for the local dashboard.
Structs§
- AppState
- Login
Throttle - How long a wrong token buys the next attempt. Nothing on this path had a delay, a counter or a
429: guessing was free, and
MIN_TOKEN_LENallows a 32-character token, which is not a number an attacker cannot reach given unlimited attempts.
Constants§
- CHAT_
BODY_ LIMIT - The most one chat message may weigh. A paste over this is refused by name rather than by axum’s own 413, which says nothing a person can act on.
- MAX_
CONCURRENT_ CHATS - Agent runs allowed in flight at once; further chat requests get HTTP 429. One semaphore for every route that can start a run: the dashboard and the gateway must not each believe they are the only caller.
Functions§
- guard_
local_ origin - Defends the local dashboard against DNS-rebinding and cross-site requests: the
Hostheader must name a loopback host, and a request that changes something must either come from this origin or carry the session’s CSRF token (arrival_refusalexplains the three ways through). All responses also get headers that stop framing, sniffing and external loads. - router
- The dashboard on its own: every route above with its state.
- routes
- The dashboard’s routes, without the state applied: the gateway merges its own routes on
before calling
.with_state, so the origin guard is the only layer either side adds.