Security
Short-lived tokens, no key files, exact audiences.
- No service-account key files. Impersonate or use Workload Identity. A downloaded JSON key is a security incident, not a convenience.
- Exact audience. Token
audmust match the environment host URL with no trailing slash and norun.appalias. Authorizationonly.X-Serverless-Authorizationis rejected so a platform identity cannot silently replace application identity.- Registered principals only. A valid Google token is insufficient until the subject is in the principal registry and enabled.
- Docs password ≠ API auth. Rotate the docs password operationally outside this repository. It never authorizes a data request.
- No production in the API client. Production keeps Cloud Run invoker IAM. Do not add production as a server in these docs.
- Redact secrets in logs. Never log the bearer token, identity-token CLI output, or financial response bodies.
- CORS is UAT-only and exact-origin:
https://docs.modulate-api.es.flute.comandhttp://localhost:3000. Production disables CORS.