flagd provider: allow custom gRPC metadata on the in-process SyncFlags stream
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia tracciando il flusso SyncFlags in-process e _create_metadata attraverso config.py, provider.py e grpc_watcher.py. Aggiungi il percorso di configurazione sync_metadata e verifica che selector e le coppie chiave-valore personalizzate vengano inviati insieme, mentre l'assenza di selector o di metadati personalizzati continui a non produrre metadati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 27
- Fork
- 33
- Merge medio
- 5h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-feature/python-sdk-contrib
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
open-feature/python-sdk-contrib#417 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di open-feature/python-sdk-contrib
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·