Commit bdd853f
Mask wandb API key in initial_config.yaml (#372)
## Summary
- Fixed security issue where wandb API key was being saved to
`initial_config.yaml` in plain text
- Added API key masking for `_initial_config` alongside existing masking
for `training_config.yaml`
- Added test to verify API key is properly masked in both config files
## Details
Previously, only `training_config.yaml` had the wandb API key masked
(set to empty string) before saving to disk. However,
`initial_config.yaml` retained the actual API key because:
- `_initial_config` is created at line 141 (before API key masking)
- API key masking happens at line 723 only for `self.config`
- `_initial_config` is saved at line 985-988 without masking
## Changes
- **model_trainer.py (line 725-726)**: Added API key masking for
`_initial_config`
- **test_model_trainer.py (line 384-388)**: Added assertion to verify
API key is masked in `initial_config.yaml`
## Test plan
- [x] Test passes: `test_model_trainer_centered_instance` now verifies
both config files have masked API keys
- [x] Linting passes
- [ ] CI/CD pipeline passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent dacd184 commit bdd853f
File tree
2 files changed
+9
-0
lines changed- sleap_nn/training
- tests/training
2 files changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| 723 | + | |
723 | 724 | | |
| 725 | + | |
| 726 | + | |
724 | 727 | | |
725 | 728 | | |
726 | 729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
384 | 390 | | |
385 | 391 | | |
386 | 392 | | |
| |||
0 commit comments