Reject unknown config keys at startup

未关闭 适合新手
#330 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@pseudomuto 已经在做这个了。

开始于 2026年12月2日。

  • #333 来自 @pseudomuto —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
backend

调研方向

从 internal/config/config.go 中 issue 链接到的 YAML 加载器开始,然后检查 internal/config 中的测试以及正文提到的配置文件。确认未知键会被拒绝,并显示具体行号的错误,同时 dev/config.yaml 和示例配置仍能正常解码;issue 还要求添加发布说明,因为这会改变启动行为。

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

描述

The config loader ignores keys it doesn't recognize. A misspelled key loads without error, and the setting it was meant to change keeps its default.

https://github.com/temporalio/temporal-proxy/blob/d34391cc5982b23f8989acb5bacef2fe1aed3f51/internal/config/config.go#L51-L53

#329 shows why this matters. An operator who follows the RFC's KEK rotation steps writes decryptOnlyURIs where the proxy reads decryptURIs. The proxy starts normally, the old KEK is never registered, and every payload sealed under it fails to open. The mistake only surfaces later, at the first old payload.

Proposal

Pass yaml.DisallowUnknownField() to the loader so an unknown key fails at startup. With it on, the config from #329 is rejected with a pointer to the exact line:

[5:5] unknown field "decryptOnlyURIs"
   2 | encryption:
   3 |   default:
   4 |     uri: testing://...
>  5 |     decryptOnlyURIs:
           ^

Impact

This is a breaking change for any deployment whose config carries a key the proxy doesn't read. Such a deployment would stop starting after the upgrade, so the change needs a release note.

Nothing in this repository is affected. With the option on, dev/config.yaml and every examples/*/config.yaml decode with no unknown keys, and the internal/config and internal/codecserver tests pass.

主要语言
Go
星标
32
派生
14
平均合并
1 天 10 小时
30 天内合并 PR
62

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

temporalio/temporal-proxy 的其他 Issue

查看 temporalio/temporal-proxy 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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