Commit 7de4930
Apply redactions to snapshot metadata (#813)
## Summary
This PR implements consistent redaction behavior for both snapshot
content and metadata, addressing a long-standing inconsistency where
`Settings.add_redaction()` worked for snapshot content but not for
metadata set via `Settings.set_info()`.
## Problem
Previously, redactions were only applied to snapshot content during
serialization, not to metadata. This created surprising behavior for
users of libraries like `insta-cmd` that capture sensitive data (API
keys, credentials, etc.) in snapshot metadata.
**Before this change:**
```yaml
---
info:
env:
API_KEY: sk_live_abc123def456 # 1 parent 90f6ad8 commit 7de4930
File tree
5 files changed
+93
-6
lines changed- insta
- src
- tests
- snapshots
5 files changed
+93
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
103 | 123 | | |
104 | 124 | | |
105 | 125 | | |
| |||
319 | 339 | | |
320 | 340 | | |
321 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
322 | 345 | | |
323 | 346 | | |
324 | 347 | | |
| |||
329 | 352 | | |
330 | 353 | | |
331 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
332 | 359 | | |
333 | 360 | | |
334 | 361 | | |
| |||
421 | 448 | | |
422 | 449 | | |
423 | 450 | | |
424 | | - | |
| 451 | + | |
425 | 452 | | |
426 | 453 | | |
427 | | - | |
428 | | - | |
| 454 | + | |
| 455 | + | |
429 | 456 | | |
430 | 457 | | |
431 | 458 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
0 commit comments