flagd provider: allow custom gRPC metadata on the in-process SyncFlags stream
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza siguiendo el flujo SyncFlags en proceso y _create_metadata a través de config.py, provider.py y grpc_watcher.py. Añade la ruta de configuración sync_metadata y verifica que selector y los pares clave-valor personalizados se envíen juntos, mientras que la ausencia de selector o de metadatos personalizados siga sin producir metadatos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 27
- Forks
- 33
- Merge medio
- 5 h
- PR fusionados (30 d)
- 10
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de open-feature/python-sdk-contrib
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
UnleashProvider.track has the wrong signature: client.track raises TypeError instead of no-op Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
open-feature/python-sdk-contrib#417 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Todos los issues de open-feature/python-sdk-contrib
Issues similares
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Abiertoarea: harness bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Human-Agent-Society/reef#625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
learningequality/kolibri#15351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Name consistency Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eellak/triplestore#65 · 1 comentario ·