[go: up one dir, main page]

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

auth API: Servers request returns "Method Not Allowed" starting with v4.9 #14572

Open
2 tasks done
joeig opened this issue Aug 20, 2024 · 4 comments
Open
2 tasks done

Comments

@joeig
Copy link
Contributor
joeig commented Aug 20, 2024
  • Program: Authoritative
  • Issue type: Bug report

Short description

Starting with v4.9, the REST API returns Method Not Allowed instead of Not Found when requesting a server that does not exist.

Environment

  • Operating system: Docker image powerdns/pdns-auth-49:4.9.1
  • Software version: v4.9.1
  • Software source: Docker Hub

Steps to reproduce

  1. Identify a server name which does not exist (e.g. doesntExist)
  2. Request details about the non-existent server using the REST API: GET /api/v1/servers/doesntExist

Expected behaviour

I expect the response body to be Not Found.

Actual behaviour

The actual response body is Method Not Allowed.

Other information

The issue started with v4.9. v4.8 was correctly returning Not Found.

@cmouse
Copy link
Contributor
cmouse commented Aug 20, 2024

Could you provide exact URL and Method used, please?

@cmouse
Copy link
Contributor
cmouse commented Aug 20, 2024

Thank you.

@joeig
Copy link
Contributor Author
joeig commented Aug 20, 2024

Example requests:

% curl -H'X-Api-Key: apipw' 'http://localhost:8080/api/v1/servers/localhost'
{"autoprimaries_url": "/api/v1/servers/localhost/autoprimaries{/autoprimary}", "config_url": "/api/v1/servers/localhost/config{/config_setting}", "daemon_type": "authoritative", "id": "localhost", "type": "Server", "url": "/api/v1/servers/localhost", "version": "4.9.1", "zones_url": "/api/v1/servers/localhost/zones{/zone}"}
% curl -H'X-Api-Key: apipw' 'http://localhost:8080/api/v1/servers/doesntexist'
Method Not Allowed

@zeha
Copy link
Collaborator
zeha commented Aug 20, 2024

(Should also add a test for this.)

@zeha zeha added this to the auth-5 milestone Aug 20, 2024
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