CrisisGrid authenticates with the official Meta Model API (https://api.meta.ai/v1) using a single environment variable: MODEL_API_KEY.
To protect credentials across local development, CI, and hackathon judging:
- Never Commit Secrets:
.env,backend/.env, andfrontend/.env.localare strictly ignored by.gitignore. Only template files (.env.example,backend/.env.example,frontend/.env.local.example) with empty placeholders are tracked in Git. - Backend-Only Isolation:
MODEL_API_KEYis read exclusively bybackend/config.py. It is never prefixed withNEXT_PUBLIC_and never sent to the browser. - Zero Leakage in Responses or Logs:
GET /healthandGET /api/config/statusreturn only a boolean"model_api_key_configured": true | false.- Upstream exceptions from
https://api.meta.ai/v1are mapped through_meta_error()inbackend/main.pyto sanitized HTTP502/503responses that never echo authorization headers or raw client objects.
Before pushing commits, run:
git status --ignored
python backend/test_meta_api.pyIf you discover a potential credential leak or security issue in this repository, please open a GitHub issue or contact the repository maintainers directly.