ruby / ruby/net-http

Lack of support for unix domain sockets

Aperta
#53 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Ruby
Stelle
148
Fork
95
Merge medio
10h 54m
PR unite (30g)
4

Descrizione

Hi,

it's a common practice and used in an increasing number or projects to offer HTTP interfaces, especially REST APIs, over unix domain sockets instead of regular TCP, for several reasons, most prominent security. The socket is not accessible over internet, no matter how broken firewalling and network filtering is, and unix file system rights can be applied, e.g. limit the access to owner, group or extended file permissions (acl). Daemons like snapd or docker engine offer their APIs as HTTP/REST over unix domain sockets.

Therefore, it is not just a strange thing that ruby/net-http does not just not support unix-domain sockets, but seems to completely ignore all requests to implement, e.g.

https://bugs.ruby-lang.org/issues/13719

https://bugs.ruby-lang.org/issues/17166

and even desperate attempts to workaround:

https://github.com/puppetlabs/net_http_unix

which, as a wrapper around net/http, solves the problem with just a few lines of code, but can be used in your own code, eight years old. Unfortunately, it doesn't help with all those libs directly based on net/http, such as ruby rest-client.

I wonder why the maintainers of net/http silently ignore all those requests without any comment (at least, I didn't find one), while other languages like python do handle unix domain sockets (which exist, if I remember correctly, for at least about 35 years). It's a shame that one has to prefer python over ruby for easy access to unix domain rest apis.

Is there any particular reason for not supporting http over unix domain sockets?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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.

Direzione di ricerca

Iniziare esaminando le issue Ruby 13719 e 17166, quindi confrontare il workaround puppetlabs/net_http_unix citato nel report. Il risultato richiesto è il supporto in ruby/net-http per l’accesso HTTP o REST tramite socket di dominio Unix; il comportamento richiesto e i test sono ancora da definire.

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

Valutazione

Stack tecnologico
ruby
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.