Expand description
Runtime route-scoped chaos rules API Token gate for control-plane writes on a hosted mock (#1085).
A hosted mock serves the customer’s API and MockForge’s own management
routes on the same public port. When MOCKFORGE_MANAGEMENT_TOKEN is set
(the registry sets it on every hosted machine), any request that can
change state on a control-plane route must carry that token. Reads stay
open because the cloud UI fetches the spec, route list, docs and live
stream straight from the browser. Self-hosted servers don’t set the
variable, so nothing changes for them.
Constants§
- MANAGEMENT_
TOKEN_ ENV - Environment variable holding the deployment’s management token
- MANAGEMENT_
TOKEN_ HEADER - Header that carries the token (
Authorization: Beareralso works)
Functions§
- gate_
control_ plane_ writes - Wrap
appin the token gate whenMOCKFORGE_MANAGEMENT_TOKENis set. Apply it last, after every router is merged, so no route escapes it. - is_
control_ plane - Whether
pathbelongs to a MockForge control-plane route