ruby / ruby/net-http

Lack of support for unix domain sockets

Offen
#53 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Ruby
Sterne
148
Forks
95
Ø Merge
10 Std. 54 Min.
Gemergte PRs (30 T.)
4

Beschreibung

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?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der Durchsicht der Ruby-Issues 13719 und 17166 und vergleichen Sie anschließend die im Bericht referenzierte puppetlabs/net_http_unix-Workaround-Lösung. Das angestrebte Ergebnis ist die Unterstützung des HTTP- oder REST-Zugriffs über Unix-Domain-Sockets in ruby/net-http, wobei das erforderliche Verhalten und die Tests noch festgelegt werden müssen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ruby
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.