feat(v1): add secure configuration baseline

This commit is contained in:
ila
2026-07-21 09:45:59 +08:00
parent 7b05efe56c
commit 0b01e1bf24
13 changed files with 281 additions and 19 deletions
+6 -6
View File
@@ -36,7 +36,7 @@
- Modify: `.gitignore`
- Modify: `init.ps1`, `docs/03-tech-stack.md`, `docs/current-state.md`
- [ ] **Step 1: Write the failing configuration test**
- [x] **Step 1: Write the failing configuration test**
```python
from v1.config import load_config
@@ -55,12 +55,12 @@ def test_load_config_resolves_rtsp_environment_variable(tmp_path, monkeypatch):
assert load_config(config_file).source_url == "rtsp://example"
```
- [ ] **Step 2: Run the test to verify it fails**
- [x] **Step 2: Run the test to verify it fails**
Run: `python -m pytest v1/tests/test_config.py -v`
Expected: FAIL because `v1.config` does not exist.
- [ ] **Step 3: Implement the smallest configuration interface**
- [x] **Step 3: Implement the smallest configuration interface**
```python
import json
@@ -114,12 +114,12 @@ def load_config(path: Path) -> AppConfig:
`config.local.json`, `artifacts/`, `testdata/private/`, `*.onnx` and camera credentials must be ignored; `config.example.json` contains only `rtsp_url_env`.
- [ ] **Step 4: Run baseline tests and update the standard command**
- [x] **Step 4: Run baseline tests and update the standard command**
Run: `python -m pytest v1/tests -v`
Expected: PASS. Update `init.ps1` so it installs `v1/requirements.txt` and runs this command.
Expected: PASS. Update `init.ps1` so it checks the required runtime imports and runs this command; keep `v1/requirements.txt` as an explicit installation command rather than mutating the environment during verification.
- [ ] **Step 5: Commit**
- [x] **Step 5: Commit**
```powershell
git add .gitignore init.ps1 v1 docs/03-tech-stack.md docs/current-state.md docs/06-tasks.md progress.md