| It is difficult in some situations to use Sensitive values:
- A Sensitive may be nested somewhere in a hash/array
- When logic accepts Variant[Sensitive[T], Sensitive] user has to check and jump through hoops to do the right thing.
A function rewrap(Any $v) would do the following. If called with a Sensitive (anywhere recursively) it would unwrap all in the structure and call a given lambda with the now clear text value/structure. The result from the lambda is then wrapped in a Sensitive if there was a Sensitive value in the input. If the function is given something that does not contain a Sensitive, the the value is passed through, and the result is not Sensitive. This is similar to PUP-10092 where this would be built into interpolation, and PUP-8969 for the same in EPP. Having the rewrap function makes a lot of sense since interpolation is not the only processing needed involving Sensitive values. |