Commit 0133703
test(router): stop a 3-char needle finding itself in ciphertext
`set() writes an encrypted envelope` proves the secret does not survive
encryption by searching the serialized envelope for it. The secret was `'shh'`,
and the envelope is base64, so the assertion fails whenever those three
characters turn up in the ciphertext by chance. CI found one:
Expected to not contain: "shh"
Received: "{\"_enc\":true,...\"data\":\"...BeQ2BD2anBrrdtGevHshhdI...\"}"
`vHshhdI`. The envelope was encrypted correctly and the test that proves it
encrypted failed anyway.
Roughly 1 run in 1300 for a three-character needle across ~200 base64
characters, which is frequent enough to keep costing someone an afternoon and
rare enough to be dismissed as "just re-run it" every time.
The secret is now long and distinctive, which makes a chance collision
impossible rather than unlikely. The assertion is otherwise unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 18d0716 commit 0133703
1 file changed
Lines changed: 11 additions & 3 deletions
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
63 | | - | |
| 71 | + | |
64 | 72 | | |
65 | | - | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
| |||
0 commit comments