You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): enforce declared auth:true on /meta + /ai route families
The /data routes gate anonymous callers via RestServer.enforceAuth
(requireAuth), but the /meta routes (rest-server) and /ai routes
(dispatcher) never applied that gate. Three handlers each assumed the
auth check ran "upstream"/"separately", yet no dispatch stage enforces
RouteDefinition.auth: enforceAuthGate only covers ADR-0069 password/MFA
gates and enforceProjectMembership bails on anonymous/unscoped requests.
On a requireAuth deployment an anonymous caller could read object/field
schemas and AI adapter/model status; on a tenant-less runtime host those
are SYSTEM-object schemas and the host is publicly reachable.
- rest-server: wrap registerMetadataEndpoints so every /meta route
inherits the enforceAuth gate (present and future routes) instead of
per-handler checks the next route would forget.
- http-dispatcher: add a requireAuth option; gate handleAI (honouring
the declared route.auth) and the metadata catch-all. Authenticated or
internal system contexts pass; anonymous -> 401.
- dispatcher-plugin: add requireAuth config (read top-level, or from the
stack `api` block the cloud apps pass as `scoping`); thread it to the
HttpDispatcher and to mountRouteOnServer so explicit AI routes enforce
it too.
- serve: pass requireAuth through to the dispatcher plugin.
No-op when requireAuth is off (demo / single-tenant), so the previously
public surface there is unchanged; an authenticated user passes exactly
as on /data. Adds regression tests for the dispatcher and REST gates.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCMvtvZuEQznmJr3dccV9K
0 commit comments