0fd6930b41f47a31e1c0b78bdbadda316935b43a
- Create backend/services/ai_config.py with:
- _derive_ai_settings_key(master_key, provider_id): fresh HKDF per call, salt=provider_id.encode("utf-8"), info=b"ai-provider-settings" (domain-separated from b"cloud-credentials")
- encrypt_api_key / decrypt_api_key: Fernet round-trip without JSON wrapping
- load_provider_config(session): reads is_active=True row from system_settings, decrypts api_key_enc; returns stub ProviderConfig (real class lands in Plan 02)
- seed_system_settings_from_env(session): idempotent insert of default provider on first boot
- _ProviderConfigStub: minimal Pydantic model stub until ai/provider_config.py exists (Plan 02)
- Update backend/main.py: import seed_system_settings_from_env, call in lifespan with try/except so missing table (pre-migration fresh boot) doesn't crash startup
- Round-trip smoke test: encrypt_api_key → decrypt_api_key == original plaintext
feat(06-04): multi-stage Dockerfile with appuser + docker-compose runtime hardening (D-07/D-08/D-09)
Description
No description provided
8.1 MiB
Languages
Python
57.2%
JavaScript
16.5%
HTML
14.2%
Vue
12%