Security Architecture
Authentication & Authorization
- End‑user auth: optional Google OAuth (client ID/secret via GSM). Enabled automatically when
GOOGLE_CLIENT_IDis configured. - Internal OIDC:
/internal/*endpoints require an ID token audience that matchesINTERNAL_AUDIENCE. - RBAC:
src/security/enhanced_auth.pyandsrc/security/permissions.pydefine roles/permissions.- Routes gate access via dependencies in
src/api/dependencies, enforcing tenant isolation and role checks.
Secrets & Configuration
- Secrets in Secret Manager; backend reads via environment or GSM refs provisioned by Terraform.
- No secrets in VCS; see
infra/terraform/variables.tffor existing secret IDs.
Edge and Transport
- HTTPS LB terminates TLS and forwards to Cloud Run.
- Strict security headers set in middleware (HSTS, CSP, XFO, etc.).
Component View
Notes
- Internal requests use SA credentials; Pub/Sub push and Cloud Tasks impersonate the invoker SA.
SECRET_KEYandWEBHOOK_SECRETcontrol signing and auth for webhook flows.