grpc / grpc/grpc-java

Support of `dns:name` URIs

Aperta Adatta ai principianti
#10,824 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
docs enhancement
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

As it currently stands, the URI validation and parsing for `dns` schema in grpc-java is in contradiction of ~~both RFC-4501 and~~ (not relevant really) core gRPC specs by rejecting `dns:name`-type URIs (no slash). This generates discrepancies between different gRPC implementations and is generally problematic. [Currently we have 6 (yes, literally six) competing standards as to what URIs are allowed, none of which are actually aligned, and all of them are "official" in some way.](https://github.com/grpc/grpc/issues/35539#issuecomment-1889957866) The only thing that's missing for grpc-java to be a strict superset here (and thus reduce the incompatibilities and confusion) is to have `dns:name` allowed ~~as per RFC-4501 spec~~ (ditto).

A fully backwards-compatible solution would be to change https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java#L56 to allow any reasonable/valid ~~RFC-4501-compliant~~ (ditto) URI to be accepted. Code-wise, it's trivial, has no parsing ambiguities and has no negative impact on the existing code solutions.

### Describe the solution you'd like
`dns:name` would be included as valid ~~, RFC-4501-type URIs would be better~~ (ditto) and supported, confusion and discrepancies would be reduced.

### Additional context
https://github.com/grpc/grpc/issues/35539 & https://github.com/grpc-ecosystem/grpc-spring/issues/1024
If a PR is needed, I'll gladly do it.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con core/src/main/java/io/grpc/internal/DnsNameResolverProvider.java, nella validazione intorno alla riga 56, poi esamina i test esistenti del resolver per l’accettazione degli URI. Conferma che dns:name sia accettato senza modificare le forme valide esistenti e verifica che i test pertinenti abbiano esito positivo.

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

Valutazione

Stack tecnologico
java
Ambito
networking
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.