Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Make `HeaderValue::set_sensitive` available in const contexts

未关闭
#807 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
rust
领域
api

调研方向

从 HeaderValue::set_sensitive 和 HeaderValue::from_static 的定义开始,检查周围的文档和测试。使 set_sensitive 可用于 const 上下文,在适当的情况下添加关于嵌入机密信息的所需警告,并验证 HeaderValue 的现有行为仍有覆盖测试。

由索引模型根据 Issue 内容生成。

描述

A-headers E-easy S-feature

Hey, I'd like to use HeaderValue::set_sensitive when defining header value constants with HeaderValue::from_static.
In particular, I'd like to mark an OAuth client credential that's compiled into the application as sensitive.

I fully understand that a value that's compiled into the binary is trivial to dump and shouldn't be considered secure. Moreover, I fully understand that no amount of obfuscation will change this. However, many OAuth implementations (like GitHub or Forgejo) always issue client credentials, regardless of whether the client is public or confidential. This means clients are forced to use the credential, which effectively means the credential has to be embedded into the client.

I'd be willing to contribute a PR for this, but I wanted to open an issue to discuss first, as the idea of storing confidential header values as constants seems controversial. In addition to the const keyword, a note in the doc comment to discourage developers from embedding secrets might be warranted.


Thank you for creating Hyper and this crate!

主要语言
Rust
星标
1.4k
派生
378
平均合并
1 天 21 小时
30 天内合并 PR
5

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hyperium/http 的其他 Issue

查看 hyperium/http 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。