Repository navigation
API development and tests
The backend is Django 6.1/DRF, PostgreSQL and Python 3.14 (>=3.14,<3.15); the frontend requires Node 24.x. Use isolated dependencies and disposable development credentials, not copied production environment files.
cd apps/user-api
python3.14 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
python manage.py check
python manage.py test portal --settings=config.test_settingsTo exercise migrations and full API behavior, configure local PostgreSQL in a private .env, review config/settings.py, and migrate only this disposable DB. A test runner passing mocks is not proof of the live Quantum Platform/ACP network, migration or Slurm gateway.
portal/api_urls.py registers the available route suffixes; config/urls.py owns the root API prefixes. identity_api.py owns person, PI and programme operations; access_keys_api.py SSH/WireGuard public keys; workbench_api.py Jupyter launch; execution_api.py scheduler jobs; agent_api.py signed ACP proxy. Do not present proposed ACP terminal-pairing routes as implemented.
- Identify the authoritative owner/repository and model.
- Add or change typed request/response validation and authorization; don't trust an email/UID/tenant field in a client body as identity.
- Define method, HTTP codes, session/CSRF rules, scope, idempotency, concurrency and effects.
- Cover happy path and negative cases: anonymous user, suspended account, foreign ownership UUID, wrong programme membership, replay, expired token, duplicate requests, unavailable backend.
- Add migrations only when changing persisted schema; never edit existing released migration contents.
- Update UI states for pending/denied/success, record audit and regression evidence.
- Verify GitOps image promotion and live response separately from code CI.
Root frontend uses npm ci, npm run check, npm run build; Python tests use python manage.py test portal --settings=config.test_settings. Before reporting success check installed Python version, source branch, test database state and pipeline logs.
References: API routes, Python dependencies, root Node scripts, workspace proxy authorization tests.
Quantum Platform
- Home
- Getting started
- Account and access
- Researcher guide
- Workbench and runs
- Agent and Guide
- Administrator guide
- Developer guide
- API and integration
- Troubleshooting
- Security
- Contributing
- Guide integration and support Detailed topics
- Programme approval and resource entitlements
- Authentication MFA and key management
- JupyterHub and SSH identity
- API development and tests
- Research programme administration Guide integration
- Guide knowledge and source ingestion
- Guide support and ticket workflows