Commit d428363
authored
Add IP address, label and location states to obfuscation (#2098)
## Summary
Extend the obfuscation utility to redact the values of additional
sensitive device states:
- `core:IPAddressState` (`CORE_IP_ADDRESS`)
- `core:LabelState` (`CORE_LABEL`)
- `core:LocationLatitudeState` (`CORE_LOCATION_LATITUDE`)
- `core:LocationLongitudeState` (`CORE_LOCATION_LONGITUDE`)
These states can expose a user's IP address, device label and geographic
location, so their values should be masked alongside the other sensitive
states already handled by `obfuscate_sensitive_data`.
## Test plan
- Added the four new state names to the
`test_obfuscate_sensitive_states` parametrization.
- `pytest tests/test_obfuscate.py` → 30 passed.
- Full suite (`test_obfuscate.py`, `test_models.py`, `test_client.py`) →
325 passed.
- `ruff` and `mypy` (source) clean.1 parent f285891 commit d428363
2 files changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
0 commit comments