flagd provider: allow custom gRPC metadata on the in-process SyncFlags stream
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先,跨越 config.py、provider.py 和 grpc_watcher.py 跟踪进程内的 SyncFlags 流和 _create_metadata。添加 sync_metadata 配置路径,并验证 selector 和自定义键值对会一起发送,同时没有 selector 或自定义 metadata 时仍不会产生 metadata。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 27
- 派生
- 33
- 平均合并
- 11 小时 10 分钟
- 30 天内合并 PR
- 14
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-feature/python-sdk-contrib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
open-feature/python-sdk-contrib#439 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
open-feature/python-sdk-contrib#433 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
open-feature/python-sdk-contrib#421 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
open-feature/python-sdk-contrib#417 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
open-feature/python-sdk-contrib#446 ·
维护者通常 1 天内回复
查看 open-feature/python-sdk-contrib 的全部 Issue
相似的 Issue
-
docs pydanty:is-working
难度 2/5 1-3 小时 新手友好度 75/100
pydantic/pydantic-ai#8863 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
run-llama/llama_index#23278 ·
维护者通常 2 天内回复
-
documentation from-review-extraction github-actions priority: low severity:nit
难度 1/5 1 小时以内 新手友好度 92/100
LearningCircuit/local-deep-research#6946 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
oracle/langchain-oracle#323 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
tenstorrent/tt-metal#58057 · 1 条评论 ·
维护者通常 1 天内回复