@@ -51,6 +51,12 @@ The API is currently versioned under `/api/v1`.
5151- Health, liveness, and readiness endpoints with structured RFC-style responses.
5252- Prometheus metrics at ` /metrics ` .
5353- OpenTelemetry distributed tracing (FastAPI, SQLAlchemy, Redis instrumentations).
54+ - API key management for machine-to-machine authentication.
55+ - CSRF protection middleware (double-submit cookie pattern).
56+ - Extensible ` AuthenticationProvider ` abstraction (JWT + API key).
57+ - Secret scanning with Gitleaks in CI.
58+ - CycloneDX SBOM generation.
59+ - Container image signing with Cosign in CI.
5460- API route grouping under ` /api/v1 ` .
5561- Async SQLAlchemy persistence.
5662- Alembic database migrations.
@@ -240,6 +246,9 @@ GET /api/v1/permissions/?cursor=<cursor>&limit=10
240246GET /api/v1/permissions/{permission_id}
241247PATCH /api/v1/permissions/{permission_id}
242248DELETE /api/v1/permissions/{permission_id}
249+ POST /api/v1/admin/api-keys/
250+ GET /api/v1/admin/api-keys/?skip=0&limit=100
251+ DELETE /api/v1/admin/api-keys/{api_key_id}
243252GET /health
244253GET /live
245254GET /ready
@@ -301,7 +310,7 @@ DATABASE_POOL_TIMEOUT=30
301310DATABASE_POOL_RECYCLE=3600
302311REDIS_URL=
303312SECRET_KEY=
304- MAX_REQUEST_SIZE_MB =5242880
313+ MAX_REQUEST_SIZE_BYTES =5242880
305314ALGORITHM=HS256
306315JWT_ISSUER=todo-modulith-api
307316JWT_AUDIENCE=todo-modulith-client
@@ -341,7 +350,7 @@ SEED_ADMIN_FULLNAME=System Administrator
341350SEED_DEVELOPMENT_USERS_PASSWORD=
342351```
343352
344- ` MAX_REQUEST_SIZE_MB ` is currently interpreted as a byte count despite its name. Keep it at ` 5242880 ` for a 5 MiB limit .
353+ ` MAX_REQUEST_SIZE_BYTES ` controls the maximum request body size. Default is ` 5242880 ` ( 5 MiB) .
345354
346355For local development without Docker, use development mode and point the service URLs at local PostgreSQL and Redis instances, for example:
347356
@@ -706,8 +715,11 @@ Legend: `Implemented` means code exists in the repository. `Partial` means code
706715| Database Migrations | Required | Implemented | Alembic is configured with migration commands in the README and Makefile. |
707716| Dependency Injection | Required | Implemented | FastAPI dependencies wire repositories, handlers, auth, authorization, and database sessions. |
708717| Configuration via Environment Variables | Required | Implemented | Pydantic settings read ` .env ` and reject the default secret key in production. |
709-
710- ### Next Implementation Checklist
718+ | CSRF Protection | Recommended | Implemented | Double-submit cookie pattern with ` DoubleSubmitCSRFService ` . Configurable via ` CSRF_PROTECTION_ENABLED ` . |
719+ | API Key Management (M2M) | Recommended | Implemented | Service account keys with SHA256 hashing. ` ApiKeyRepository ` ABC, ` ApiKeyService ` with generate/validate. Admin CRUD at ` /api/v1/admin/api-keys/ ` . |
720+ | Secret Scanning in CI | Recommended | Implemented | Gitleaks action runs on every PR and push in the ` verify ` job. |
721+ | SBOM Generation | Recommended | Implemented | CycloneDX SBOM generated after Docker build using Trivy, uploaded as CI artifact. |
722+ | Container Image Signing | Recommended | Implemented | Cosign keyless signing of Docker images on push to GHCR. |
711723
712724- [x] Fix and verify rate limit configuration wiring.
713725- [x] Add security headers middleware.
@@ -722,6 +734,11 @@ Legend: `Implemented` means code exists in the repository. `Partial` means code
722734- [x] Review exception responses to avoid leaking token parsing details or internal exception messages.
723735- [ ] Add automated tests for request size limits, rate limiting, auth failures, authorization failures, CORS, security headers, and request IDs.
724736- [x] Add dependency vulnerability scanning to local or CI checks, for example ` pip-audit ` or an equivalent Poetry-compatible scanner.
737+ - [x] Add CSRF protection middleware.
738+ - [x] Add API key management for machine-to-machine auth.
739+ - [x] Add secret scanning (Gitleaks) to CI.
740+ - [x] Add SBOM generation (CycloneDX) to CI.
741+ - [x] Add container image signing (Cosign) to CI.
725742
726743## Known Notes
727744
0 commit comments