flagd provider: allow custom gRPC metadata on the in-process SyncFlags stream
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo luồng SyncFlags trong tiến trình và _create_metadata qua config.py, provider.py và grpc_watcher.py. Thêm đường dẫn cấu hình sync_metadata và xác minh rằng selector cùng các cặp khóa-giá trị tùy chỉnh được gửi cùng nhau, trong khi việc không có selector hoặc metadata tùy chỉnh vẫn không tạo ra metadata nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The in-process resolver of the flagd provider opens a long-lived gRPC stream. It calls the SyncFlags method. The provider builds the gRPC metadata for this call. The function _create_metadata adds only one header. It adds the flagd-selector header. It adds this header only when the user sets a selector.
The provider gives the user no way to add other metadata headers. The Config object has no field for custom metadata. The user cannot add a header to the sync stream.
Effect
A user cannot send an infrastructure-specific header on the sync stream. One example is a proxy timeout header. A proxy can close a stream after a default request timeout. To keep the stream open, the client must send a header such as x-envoy-upstream-rq-timeout-ms: 0. The current provider cannot send this header. Because of this, a proxy can close the long-lived sync stream.
Proposed change
- Add a
sync_metadataoption toFlagdProviderand toConfig. The value is a sequence of key-value pairs (header name and header value). - In
_create_metadata, add these pairs to the metadata. Keep theflagd-selectorheader. Send both the selector header and the user headers together. - Keep the current behavior when the user does not set
sync_metadata. If the user sets no selector and no custom metadata, the function returns no metadata, as before.
Compatibility
The change is backward compatible. The custom metadata is added only when the user sets sync_metadata. The default behavior does not change.
Scope
The change is small. It touches config.py, provider.py, and grpc_watcher.py. It affects only the in-process resolver, because only that resolver uses the SyncFlags metadata function.
- Ngôn ngữ chính
- Python
- Star
- 27
- Fork
- 33
- Merge trung bình
- 5 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-feature/python-sdk-contrib
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
open-feature/python-sdk-contrib#417 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của open-feature/python-sdk-contrib
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·