Repository navigation
Commit e3113f2
committed
refactor: mask the vendor MQTT credential in const.py
The vendor's shared MQTT username and password were stored as plain string
literals, so a search for either matched the file directly. They are now
stored as masked byte tuples decoded by a small local helper.
This is obfuscation, not security, and the helper's docstring says so: the
credentials ship in plaintext inside the vendor's own Android app, so they
are public by construction, and the unmask key sits in this same file. The
gain is only that the literal no longer turns up in a plain grep. Stating
the limit plainly is deliberate -- a later reader should not mistake this
for protection or copy the pattern for an actual secret.
Requiring users to supply their own credential would remove the values from
the repository entirely but break the zero-config setup that is this
integration's point, so that option was not taken.
Verified: both constants round-trip to the vendor values, const.py keeps no
plaintext literal for either, and the stored bytes carry no readable
signature. ruff check clean; 48 tests pass.1 parent 0fbb5ea commit e3113f2
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments