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

Contextual information from interceptors to request handlers

Aperta
#2,871 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
grpc, node.js, typescript

Direzione di ricerca

Inizia individuando le API degli interceptor e dei gestori delle richieste nell’implementazione gRPC Node.js e verifica come i metadati per richiesta fluiscono attualmente tra loro. Definisci cosa esporrebbe ai gestori un meccanismo supportato per le informazioni contestuali, inclusi i valori oggetto e la separazione dai metadati del client; il lavoro è completato quando il comportamento e il suo utilizzo sono coperti dai test o dalla documentazione pertinenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

package: @grpc/grpc-js
Is your feature request related to a problem? Please describe.

This might already be possible but I haven't found a way to do it. Please advice.

What I would like to do is to pass additional, per-request information from the interceptors to the request handers. For example, I've an auth interceptor which validates the authentication params and I would like to attach some information (e.g. the user id) that's latter consumed by the request handler.

Describe the solution you'd like

A way to attach contextual information to requests.

Describe alternatives you've considered
  • I can think of moving some of the logic outside of the interceptor into another module/function and call that from the request handlers. While it would work, it's not as clean as adding the data I need in the interceptors.
  • I could also whatever information I want to the request metadata. I don't like this one so much because the boundaries between client metadata and my metadata are blurred. I could use a symbol to avoid clashes though (can't pass a symbol as metadata keys must be strings). And metadata only allows buffers or strings as values and I'd like to be possible to pass an object.
Additional context

This is possible in many other http api frameworks.

Lingua principale
TypeScript
Stelle
4.8k
Fork
716
Merge medio
1g 18h
PR unite (30g)
17

Preparare l'ambiente

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 grpc/grpc-node

Tutte le issue di grpc/grpc-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.