mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-27 22:34:51 -06:00
b086390558
* fix: TLS deferred work — wiring, security, tests, Docker overlay
Security fixes:
- PostgreSQL SSL: validate sslmode against known values, urlencode
all params to prevent URL injection
- ConfigStore env seeding: removed redundant type coercion, delegate
to validate_value() which handles all coercion correctly
Functional wiring:
- Database SSL: init_storage() passes SSL params to PostgreSQL URL
- Server: env var fallbacks for DB SSL (TURNSTONE_DB_SSLMODE etc.)
- Proxy mTLS: re-create proxy clients after TLS cert issuance
- Channel gateway: --ssl-certfile/keyfile/ca-certs CLI args, HTTPS
advertise URL when SSL configured
- ConfigStore env seeding: TURNSTONE_{SECTION}_{KEY} seeds on first boot
- Console deregistration on shutdown (with debug logging)
Specs, tests, Docker:
- OpenAPI: 5 TLS admin endpoints in console_spec.py
- Auth enforcement test (401 without auth)
- SDK ValueError test (mismatched cert/key)
- Docker overlay: TURNSTONE_TLS_ENABLED, bridge --redis-tls, Redis
healthcheck with client cert
- Removed stale type:ignore comments (lacme 1.0.2 type stubs)
* review: address copilot feedback on TLS deferred work
- ConfigStore env seeding: use config_store.set() instead of
storage.set_system_setting() (correct API, updates cache)
- Remove unused defn variable (iterate SETTINGS keys only)
- Fix structlog call-arg error (positional args, not kwargs)
- Channel gateway: validate cert+key provided together
- Restore type:ignore[no-any-return] for CI mypy (lacme 1.0.2
type stubs not in CI's mypy overrides yet)
* fix: rename _VALID_SSLMODES to lowercase (N806)