From c3f625b127689438304bf8b5dbf16dd34c7fb905 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Tue, 25 Feb 2014 21:51:40 +0000 Subject: Bug 976765 - backport upstream bug 972881 to bmo/4.2 to add hooks to Bugzilla/WebService/Server/REST.pm --- Bugzilla/Hook.pm | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to 'Bugzilla/Hook.pm') diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index a18b11f77..5e3dca655 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -1594,6 +1594,89 @@ See L for an example. =back +=head2 webservice_fix_credentials + +This hook allows for altering the credential parameters provided by the client +before authentication actually occurs. For example, this can be used to allow mapping +of custom parameters to the standard Bugzilla_login and Bugzilla_password parameters. + +Params: + +=over + +=item C + +A hash ref containing the parameters passed into the webservice after +they have been obtained from the URL or body of the request. + +=back + +=head2 webservice_rest_request + +This hook allows for altering any of the parameters provided by the client +after authentication has occured. You are able to change things like renaming +of keys, removing values, or adding additional information. + +Params: + +=over + +=item C + +A hash ref containing the parameters passed into the webservice after +they have been obtained from the URL or body of the request. + +=item C + +The current JSONRPC, XMLRPC, or REST object. + +=back + +=head2 webservice_rest_resources + +This hook allows for altering of the REST resources data allowing you to +add additional paths to perform additional operations or to override the +resources already provided by the webservice modules. + +Params: + +=over + +=item C + +A hash returned from each module loaded that is used to determine +which code handler to use based on a regex match of the CGI path. + +=item C + +The current JSONRPC, XMLRPC, or REST object. + +=back + +=head2 webservice_rest_response + +This hook allows for altering the result data or response object +that is being returned by the current REST webservice call. + +Params: + +=over + +=item C + +The HTTP response object generated by JSON-RPC library. You can use this +to add headers, etc. + +=item C + +A reference to a hash that contains the result data. + +=item C + +The current JSONRPC, XMLRPC, or REST object. + +=back + =head1 SEE ALSO L -- cgit v1.2.3-24-g4f1b