Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

flagd provider: allow custom gRPC metadata on the in-process SyncFlags stream

Aperta
#403 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
grpc, python
Ambito
api, backend

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

  1. Add a sync_metadata option to FlagdProvider and to Config. The value is a sequence of key-value pairs (header name and header value).
  2. In _create_metadata, add these pairs to the metadata. Keep the flagd-selector header. Send both the selector header and the user headers together.
  3. 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-feature/python-sdk-contrib

Tutte le issue di open-feature/python-sdk-contrib

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.