summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/views/xmlrpc.py
Commit message (Collapse)AuthorAgeFilesLines
* xmlrpc: support filtering by 'archived'Brian Norris2015-03-221-0/+1
| | | | | Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: include UNIX mbox 'From ' header in patch_get_mbox()Brian Norris2015-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This function is misleadingly named 'mbox'; the contents do not begin with a proper 'From xxx <date>' separator line. (Notably, the mbox format does not have an authoritative standard, but at least this basic 'separator' construct is noted in http://tools.ietf.org/html/rfc4155.) The Message.as_string() function takes an optional [unixfrom] boolean argument. Let's use it, like we do everywhere else (including in the web interface 'mbox' link). Among other things, this means that we can straightforwardly concatenate the output of patch_get_mbox(), and more tools can use this output as-is. Example header: >From patchwork Fri Nov 21 18:24:29 2014 ... Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: add 'archived' status to patch summaryBrian Norris2015-03-221-0/+1
| | | | | | | This will now show up in 'pwclient info'. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/xmlrpc: fix xmlrpc delegate filteringJohannes Berg2015-03-221-0/+3
| | | | | | | | | | | | Trying to use pwclient list -d 'johannes@sipsolutions.net' doesn't result in any patches listed - it seems that the filter is constructed wrongly on the xmlrpc server side (going by how the submitter filter is done.) Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/xmlrpc: request.raw_post_data has been deprecatedJeremy Kerr2014-05-071-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Move mbox handling from models to viewsJeremy Kerr2013-06-101-1/+2
| | | | | | | | Mbox generation is related to views, not the models themselves. This change creates a patch_to_mbox function in the views/ directory, which the actual view handlers use instead of Patch.mbox(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: Avoid trying to marshall None for people with no nameDoug Anderson2012-12-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a person sent patches with no real name, they may have None for their name. In this case just use their email address as their name. The previous pwclient error that would show up looks like: $ pwclient list -w anonymous@example.com Traceback (most recent call last): File ".../pwclient", line 631, in <module> main() File ".../pwclient", line 570, in main action_list(rpc, filt, submitter_str, delegate_str, series_str) File ".../pwclient", line 316, in action_list ids = person_ids_by_name(rpc, submitter_str) File ".../pwclient", line 241, in person_ids_by_name people = rpc.person_list(name, 0) File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request verbose=self.__verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request return self.parse_response(response) File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response return u.close() File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal None unless allow_none is enabled"> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: do slice before patch_to_dictJeremy Kerr2011-07-181-1/+1
| | | | | | | | | | | Currently, we map patch_to_dict before we slice the results (to only return max_count patches). This means that we hacve to retrieve all patches, then throw away most of the results of the map. This change does the slice on the patches before the map, letting django do a LIMIT-ed query instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove a bunch of unused variablesGuilherme Salgado2011-03-301-1/+1
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use the 'in' operator instead of dict.has_key(), which has been deprecatedGuilherme Salgado2011-03-301-2/+2
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove unused importsGuilherme Salgado2011-03-151-4/+1
| | | | | | | | | This is so that we can use static analysis tools like pyflakes to find undefined names (and other common mistakes we often make) without being swamped with unused imports warnings. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Replace tab in indentation with spaceDirk Wallenstein2011-02-111-4/+4
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: implement CSRF protectionJeremy Kerr2010-08-101-0/+2
| | | | | | | | | | | Since we've got the csrf token present, we may as well check it for requests. We're using RequestContext already (via PatchworkRequestContext), so we just need to switch it on in the settings, and add an exemption on the xmlrpc interface. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient,xmlrpc: Specify project for patch hash lookupsJeremy Kerr2009-10-221-0/+10
| | | | | | | | | | | | We may see the same hash for two patches if one is sent to two lists tracked by patchwork. This change adds a new xmlrpc method, patch_get_by_project_hash, which adds the linkname parameter to the lookup. We need to add a new method instead of replacing patch_get_by_hash, to avoid breaking existing pwclient apps. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: Remove duplicated "name" fieldAbhishek Kulkarni2009-08-151-1/+0
| | | | | | | | Remove duplicated "name" field from the list of allowed fields for a patch list filter in the XML RPC interface. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix non-ascii character encodings on xmlrpc interfaceMauro Carvalho Chehab2009-02-151-6/+6
| | | | | | | | | | The current xmlrpc interface dies when trying to retrieve patches that contain non-ascii characters. This change uses unicode() rather than str(). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: Fix Python 2.4 compatibility in _marshaled_dispatchJeremy Kerr2008-09-101-7/+11
| | | | | | | | | Based on an original patch from Nate Case <ncase@xes-inc.com>. Python 24 doesn't accept encoding and allow_none fields for xmlrpclib.dumps, so abstract this function at dispatcher init time. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add patch_get_by_hash method to XMLRPC interfaceJeremy Kerr2008-09-091-0/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Pass Authorization headers in fastcgi applicationJeremy Kerr2008-09-091-2/+10
| | | | | | | | By default, mod_fcgi doens't allow the Authorization header, so enable -pass-header, and handle the different header name in the xmlrpc view Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add 'update' method to pwclientJeremy Kerr2008-09-091-0/+407
This requires a new xmlrpc function, 'patch_set'. To do this, we need HTTP Authentication support, which means changing to a custom XMLRPC distpatcher that is aware of the Authorization: header. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>