Reject unknown config keys at startup

オープン 初心者向け
#330 コメント 0 件 リアクション 0 件 担当者 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時間
マージ済み PR(30日)
62

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temporalio/temporal-proxy のほかの issue

temporalio/temporal-proxy の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。