api: Don't require Client-ID for root document
Doing so would be a breaking API change. We also fix a typo and tweak some formatting in the api-ref. Change-Id: I5b1d857e473987ada0b9666685951fc7ae436f53 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
committed by
Takashi Kajinami
parent
6feedb1f13
commit
54aea875e4
@@ -4,7 +4,7 @@ Messages (messages)
|
||||
Message is sent through a queue and exists until it is deleted by a recipient
|
||||
or automatically by the system based on a TTL (time-to-live) value.
|
||||
|
||||
All message-related operations require Client-Id to be included in the headers.
|
||||
All message-related operations require ``Client-ID`` to be included in the headers.
|
||||
This is to ensure that messages are not echoed back to the client that posted
|
||||
them unless the client explicitly requests this.
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ def require_client_id(validate, req, resp, params):
|
||||
"""Makes sure the header `Client-ID` is present in the request
|
||||
|
||||
Use as a before hook.
|
||||
|
||||
:param validate: A validator function that will
|
||||
be used to check the format of client id against configured
|
||||
limits.
|
||||
@@ -121,6 +122,10 @@ def require_client_id(validate, req, resp, params):
|
||||
:type params: dict
|
||||
:rtype: None
|
||||
"""
|
||||
api_version_string = req.path.split('/')[1]
|
||||
if not api_version_string:
|
||||
# we don't insist on a Client-ID for the versions resource
|
||||
return
|
||||
|
||||
try:
|
||||
validate(req.get_header('Client-ID', required=True))
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import unittest
|
||||
|
||||
from zaqar.tests.functional import base
|
||||
|
||||
|
||||
@@ -29,7 +27,6 @@ class TestVersions(base.FunctionalTestBase):
|
||||
self.base_url = "{url}/".format(url=self.cfg.zaqar.url)
|
||||
self.client.set_base_url(self.base_url)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_get_versions_without_headers(self):
|
||||
self.client.set_headers({})
|
||||
result = self.client.get('')
|
||||
|
||||
Reference in New Issue
Block a user