summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Hook.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2014-02-25 22:51:40 +0100
committerDave Lawrence <dlawrence@mozilla.com>2014-02-25 22:51:40 +0100
commitc3f625b127689438304bf8b5dbf16dd34c7fb905 (patch)
tree5634a35dc871bc2616f33f9f75b25fe9bc715ae7 /Bugzilla/Hook.pm
parent8fee28c9137095b37103106ae41c35d9c6523a52 (diff)
downloadbugzilla-c3f625b127689438304bf8b5dbf16dd34c7fb905.tar.gz
bugzilla-c3f625b127689438304bf8b5dbf16dd34c7fb905.tar.xz
Bug 976765 - backport upstream bug 972881 to bmo/4.2 to add hooks to Bugzilla/WebService/Server/REST.pm
Diffstat (limited to 'Bugzilla/Hook.pm')
-rw-r--r--Bugzilla/Hook.pm83
1 files changed, 83 insertions, 0 deletions
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<Bugzilla::WebService::Constants/WS_ERROR_CODE> 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<params>
+
+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<params>
+
+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<rpc>
+
+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<resources>
+
+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<rpc>
+
+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<response>
+
+The HTTP response object generated by JSON-RPC library. You can use this
+to add headers, etc.
+
+=item C<result>
+
+A reference to a hash that contains the result data.
+
+=item C<rpc>
+
+The current JSONRPC, XMLRPC, or REST object.
+
+=back
+
=head1 SEE ALSO
L<Bugzilla::Extension>