Andrey Tretyakov
Andrey Tretyakov
Maybe something like this ? ```elixir %Mint.SensitiveValue{ redacted: "...", raw: fn -> "..." end } ``` Looks like we could even have it as generic abstraction in Elixir for all...
@whatyouhide Usually when you deal with a secret you would want it to be wrapped as soon as it enters your app - when you load it from the database,...
In my case, I store security token in a custom encrypted Ecto field, and the field load callback wraps the value in a closure. I could probably call Mint.redact in...
@whatyouhide One more note, your suggested `Mint.redact/1` function implies Mint knows how to redact the value. In the original post I suggested that the caller provides both raw and redacted...
Perhaps as an optimization we could provide the option to store `redact/1` function next to the wrapped raw value. This way we wouldn't need to waste memory on the redacted...
I'm not sure about the protocol. If there's a struct for sensitive values, we already know that it must be redacted, and everything else should not be. With the struct...
Let's say you have a request header. The value of the header parameter will contain either a ready to use value, or the "sensitive value" struct. In Mint you know...
A special case is iolist/iodata, where we might want to redact piece by piece instead of the whole binary. And since redaction may require the context (you can't redact half...
>Personally, I don't think the solution belongs to Mint. It should rather belong to the data structure holding the headers. But Mint owns this data since it has to send...
>What you are actually asking is for Mint to wrap data it receives as argument, which feels backwards to me. Actually I didn't ask Mint to wrap it, I only...