summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Hook.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2014-02-25 22:43:57 +0100
committerDave Lawrence <dlawrence@mozilla.com>2014-02-25 22:43:57 +0100
commitb06a5f44ac35f92a28498c90292eef1735df6f7d (patch)
treef02d19a40d1c499adaa03b86b4bea74844b29e9a /Bugzilla/Hook.pm
parent3ff1cbe6e067833673c6e5d2e64d76613398ed69 (diff)
downloadbugzilla-b06a5f44ac35f92a28498c90292eef1735df6f7d.tar.gz
bugzilla-b06a5f44ac35f92a28498c90292eef1735df6f7d.tar.xz
Bug 972881 - Add hooks to Bugzilla/WebService/Server/REST.pm to allow for extensions to extend and alter REST data
r=glob,a=justdave
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 e6a0ba283..811e858d7 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -1623,6 +1623,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>