davidmarkclements / fast-redact

very fast object redaction
MIT License
284 stars 30 forks source link

fix: restore using latest secret state #69

Closed MSala closed 7 months ago

MSala commented 8 months ago

These changes are fixing the problem with original object being left mutated after restore execution. It was happening after more than one usage of redact function. Compiled restore function now always pointing to the latest "secret" state. Fixed test "does not increment secret size". Previously it was always testing the origin "secret" object, not the restored one, so in general generating false positive. Extended test: "restores multi nested wildcard values" to cover multiple redact-restore executions.