Make HeaderValue::set_sensitive available in const contexts#808
Make HeaderValue::set_sensitive available in const contexts#808archer-321 wants to merge 1 commit into
HeaderValue::set_sensitive available in const contexts#808Conversation
|
The MSRV doesn't like the |
Some applications like OAuth clients for GitHub or Forgejo are forced to embed a client password into the application, even if the client is considered public. Make `HeaderValue::set_sensitive` available in const contexts to allow applications to mark embedded headers as sensitive. Warn developers in `set_sensitive`'s documentation that embedded secrets are trivial to dump and should not be considered secure. Closes: hyperium#807
d22829c to
c837995
Compare
Oops, I didn't remember inline- |
Oh that's interesting... was that relaxed in newer versions? |
|
It seems like this was added in Rust 1.83: https://blog.rust-lang.org/2024/11/28/Rust-1.83.0/#new-const-capabilities In this case, this PR would have to be put on hold until the MSRV is increased in the future. Personally, I wouldn't consider this change important enough to warrant an MSRV bump on its own. |
Make
HeaderValue::set_sensitiveconstto allow applications to embed sensitive header values statically.Considering embedded client secrets are generally a red flag, add a comment to the method's documentation to urge developers not to consider embedded sensitive values secure.
constuse ofset_sensitiveshould be limited to use cases where the developer is aware that the embedded secret will be world-readable.This PR implements #807