Issue #824
closedRetrieve binding by consumer and repository url should accept only GET
Description
this issue was initially present in webpy, during the django conversion we decided to solve this issue separately(so it is present in django also).
$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 500 Internal Server Error
Date: Mon, 30 Mar 2015 11:37:47 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 4459
Connection: close
Content-Type: application/json
{"http_request_method": "POST", "exception": ["TypeError: POST() takes exactly 2 arguments (3 given)\n"], "error_message": "POST() takes exactly 2 arguments (3 given)", "_href": "/pulp/api/v2/consumers/1234/bindings/zoo1/", "http_status": 500, "traceback": [" File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/exception.py\", line 46, in call\n return self.app(environ, start_response)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/postponed.py\", line 55, in call\n return self.app(environ, start_response)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 279, in wsgi\n result = self.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 422, in _delegate\n return f()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 430, in <lambda>\n f = lambda: self._delegate_sub_application(pat, what)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 455, in _delegate_sub_application\n return app.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 405, in _delegate\n return handle_class(f)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 396, in handle_class\n return tocall(*args)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 241, in _auth_decorator\n return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 195, in _verify_auth\n value = method(self, *args, **kwargs)\n"]}[ipanova@ina pulp]$
[ipanova@ina pulp]$
[ipanova@ina pulp]$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 405 Method Not Allowed
Date: Mon, 30 Mar 2015 11:37:55 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Allow: GET, POST
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
None
$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X POST -k -u admin:admin -d {} "https://localhost/pulp/api/v2/consumers/1234/bindings/zoo1/"
HTTP/1.1 500 INTERNAL SERVER ERROR
Date: Mon, 30 Mar 2015 15:43:33 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 1306
Connection: close
Content-Type: application/json
{"http_request_method": "POST", "exception": ["TypeError: post() got an unexpected keyword argument 'repo_id'\n"], "error_message": "post() got an unexpected keyword argument 'repo_id'", "_href": "/pulp/api/v2/consumers/1234/bindings/zoo1/", "http_status": 500, "traceback": [" File \"/usr/lib/python2.7/site-packages/django/core/handlers/base.py\", line 112, in get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n", " File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 69, in view\n return self.dispatch(request, *args, **kwargs)\n", " File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 87, in dispatch\n return handler(request, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 241, in _auth_decorator\n return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 195, in _verify_auth\n value = method(self, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/views/util.py\", line 90, in wrapper\n return func(*args, **kwargs)\n"]}
Updated by mhrivnak almost 10 years ago
- Triaged changed from No to Yes
- Tags Easy Fix added
Updated by ttereshc almost 9 years ago
- Status changed from ASSIGNED to POST
Added by ttereshc almost 9 years ago
Added by ttereshc almost 9 years ago
Revision d7201019 | View on GitHub
824 - Retrieve binding by consumer and repository url should accept only GET
Updated by ttereshc almost 9 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|d7201019d360bc86e1aaa588e72f5e0b385f9c51.
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from MODIFIED to 5
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
824 - Retrieve binding by consumer and repository url should accept only GET
closes #824 https://pulp.plan.io/issues/824