Reject unknown config keys at startup

Đang mở Phù hợp với người mới
#330 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@pseudomuto đang làm issue này rồi.

Từ ngày 2/12/2026.

  • #333 của @pseudomuto — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại internal/config/config.go, ở YAML loader được liên kết trong issue, sau đó kiểm tra các bài kiểm thử trong internal/config và các tệp cấu hình được nêu trong nội dung. Xác nhận rằng các khóa không xác định bị từ chối bằng lỗi chỉ rõ dòng, trong khi dev/config.yaml và các cấu hình ví dụ vẫn được giải mã; issue cũng yêu cầu ghi chú phát hành vì thay đổi này làm thay đổi hành vi khởi động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
32
Fork
14
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
62

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của temporalio/temporal-proxy

Tất cả issue của temporalio/temporal-proxy

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.