Designate DNS – list shared zones API (using Admin) responds with 200 OK for non-existing zone/project ID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
Confirmed
|
Low
|
Unassigned |
Bug Description
### Scenario ###
List shared zones using invalid zone ID, here is it:
@decorators.
def test_list_
LOG.info(
'Admin user lists shared zone using not existing zone ID')
sudo_header = {
self.
lambda: self.adm_
To reproduce the scenario you can use this test patch:
1) test_list_
https:/
2) test_list_
https:/
### Actual Result ###
API responds with 200 OK + empty list for shared_zones, like this:
2023-03-08 10:31:04.536 560986 INFO tempest.
2023-03-08 10:31:04.537 560986 DEBUG tempest.
Body: None
Response - Headers: {'date': 'Wed, 08 Mar 2023 10:31:04 GMT', 'server': 'Apache/2.4.41 (Ubuntu)', 'content-length': '119', 'content-type': 'application/json', 'x-openstack-
Body: b'{"shared_zones": [], "links": {"self": "https:/
### Expected result ###
If zone ID doesn’t exists in Designate DB, responding with “404 NotFound" (instead of 200 OK and empty list) could have make sense.
### Note ###
Existing zones list API has the same behavior:
REQ: curl -g -i -X GET http://
Resetting dropped connection: 10.21.21.126
http://
RESP: [200] Connection: close Content-Length: 110 Content-Type: application/json Date: Wed, 08 Mar 2023 21:28:41 GMT Server: Apache/2.4.52 (Ubuntu) x-openstack-
RESP BODY: {"zones": [], "links": {"self": "http://
This means that will need to fix Zone API and maybe some other APIs that have a similar behavior.
description: | updated |
summary: |
- Designate DNS – list shared zones responds with 200 OK for non-existing - zone ID + Designate DNS – list shared zones API (using Admin) responds with 200 OK + for non-existing zone/project ID |
description: | updated |
I am not sure this is a bug given the existing zone list API behaves the same way.
The list API is a "search" API and it's saying it found no results, which I think is ok.
Would like to hear any community comments on this. Marking low priority for now.