Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UNIX domain sockets for testing APIs #3011

Open
tristan957 opened this issue Aug 30, 2022 · 6 comments
Open

Support UNIX domain sockets for testing APIs #3011

tristan957 opened this issue Aug 30, 2022 · 6 comments

Comments

@tristan957
Copy link

I have been working on revamping the REST support in our storage engine and have worked on drafting an OpenAPI document during the process. On initialization of our storage engine, we create a UNIX domain socket and spwan a REST server so that users can query information and make requests to the storage engine at runtime outside the normal operation of the main application (MongoDB, for instance).

An example request:

curl -i -X GET --unix-socket /tmp/hse.sock http://localhost/perfc?pretty=true

One of the best features of OpenAPI is that applications that render a document can often allow you to test an API given the servers value. Unfortunately, without a way to specify a UNIX domain socket, the testing portion of the rendered document doesn't work. Even more unfortunately, there is no standard URL scheme for denoting a UNIX domain socket. Discussion has previously taken place here.

Though I have no expectations that this issue will go anywhere, I wanted to bring it up.

@handrews
Copy link
Contributor

The @OAI/tsc has repeatedly defined the scope of the OpenAPI Specification as HTTP APIs, so I'm going to close this as out-of-scope. It might be useful, but it would raise complex questions about what other non-HTTP addressing would need to be supported. Also, there's nothing preventing a tool from defining its own way to talk to a socket in place of HTTP URIs (if I understand what's going on here correctly).

@tristan957
Copy link
Author

I'm not sure that I'm following your comment. The use case is an HTTP REST server that communicates with clients over a Unix socket. Instead of defining a REST server like http://localhost:8080, I want to set http+unix://%2Ftmp%2Fprofilesvc.sock/path/to/page. Is that more clear?

@tristan957
Copy link
Author

@handrews
Copy link
Contributor

It's not clear to me why that ought to fit here, but it is clear to me that I did not understand your proposal well enough to close it 😅

I'll re-open this and we'll revisit it as we go through the OAI-scope labeled issues.

@handrews handrews reopened this Jan 27, 2024
@tristan957
Copy link
Author

I'm on mobile at the moment, but I'll try to be a little more specific next week.

@LasneF
Copy link

LasneF commented Feb 27, 2024

to me looks corner case topic,
as i cannot found an RFC defining unix socket or any official document about it ,
it s an implementation (details) for setting an IPC communication
as soon as there is no URI model defined for it , i do not beleive it s up to OAS to specify how a communication has to be established and stay in main stream approach

to me should go to private extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants