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

Unix socket ignores first part of the uri #1433

Closed
jopicornell opened this issue May 15, 2019 · 3 comments
Closed

Unix socket ignores first part of the uri #1433

jopicornell opened this issue May 15, 2019 · 3 comments

Comments

@jopicornell
Copy link

Describe the bug

When using unix as host for the administrative REST API, it seems that the first part of the uri is being ignored. You can put whatever you want at the first part of the path (usually oauth2) and it will get ignored, receiving a 404.

Reproducing the bug

Steps to reproduce the behavior:

  1. Run hydra serve all
  2. Make API Request to with curl --unix-socket /opt/hydra/admin.sock "http:/oauth2/auth/requests/login?login_challenge=0bc25c8363e14156b2d637009bdc3f12"
  3. Request fails with response: {"error": "Error 404 - The requested route does not exist. Make sure you are using the right path, domain, and port."}
  4. Make API Request to with curl --unix-socket /opt/hydra/admin.sock "http:/11111/oauth2/auth/requests/login?login_challenge=0bc25c8363e14156b2d637009bdc3f12"
  5. Request success with response: {"challenge":"0bc25c8363e14156b2d637009bdc3f12","requested_scope":["openid"],...

Server logs

May 15 20:51:47 joan-arch hydra[31638]: time="2019-05-15T20:51:47+02:00" level=info msg="completed handling request" measure#hydra/admin: https://auth.mercator.test/.latency=128428 method=GET remote=@ request="/auth/requests/login?login_challenge=0bc25c8363e14156b2d637009bdc3f12" status=404 text_status="Not Found" took="128.428µs"
May 15 20:51:58 joan-arch hydra[31638]: time="2019-05-15T20:51:58+02:00" level=info msg="started handling request" method=GET remote=@ request="/oauth2/auth/requests/login?login_challenge=0bc25c8363e14156b2d637009bdc3f12"

Server configuration

Expected behavior

It should allow to make a request with cURL like curl --unix-socket /opt/hydra/admin.sock "http:/clients"

Environment

  • Version: v1.0.0-rc.11
    Git Hash: 33acfa8
    Build Time: 2019-05-02T14:03:15Z

  • Environment: ArchLinux x86_64, Kernel 5.0.7

@aeneasr
Copy link
Member

aeneasr commented May 16, 2019

ping @someone1

However it feels like this should be http:///clients.

@jopicornell
Copy link
Author

@aaslamin Not an expert on unix domain sockets. I didn't found official documentation about this, but many people connecting to docker http socket like the way I do (Like this, this, and here, on the "HTTP" example tab)

Maybe a curl problem?

@jopicornell
Copy link
Author

@aaslamin @someone1 Further investigation lead me to curl and I tried to find something related inside curl. It seems that this discussion is what is giving me the problem and hydra is handling the request correctly.

Sorry for opening the bug. It seemed premature opened but yesterday I was crazy finding the right solution and I thought hydra was the problem. Thank you guys!

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

No branches or pull requests

2 participants