aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2017-06-09 18:18:38 +0100
committerStephen Finucane <stephen@that.guru>2017-06-14 09:38:25 +0100
commit09b821a95ef74c7580b79c655cf782ad9ca7d081 (patch)
tree5ebff10f938bb8570ecb179138e0a41b8d96f18b /docs
parent85c8f369204a2397aac1cdfbb1c3da85ec2d7d5a (diff)
downloadpatchwork-09b821a95ef74c7580b79c655cf782ad9ca7d081.tar
patchwork-09b821a95ef74c7580b79c655cf782ad9ca7d081.tar.gz
docs: Document token auth support
Signed-off-by: Stephen Finucane <stephen@that.guru> Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/api/rest.rst23
1 files changed, 19 insertions, 4 deletions
diff --git a/docs/api/rest.rst b/docs/api/rest.rst
index 8c8fd95..3d7292e 100644
--- a/docs/api/rest.rst
+++ b/docs/api/rest.rst
@@ -161,14 +161,29 @@ parameters should be passed as form-encoded data:
Authentication
--------------
-Patchwork only supports basic authentication:
+Patchwork supports authentication using your username and password (basic
+authentication) or with a token (token authentication). The latter is
+recommended.
+
+To authenticate with token authentication, you must first obtain a token. This
+can be done from your profile, e.g. https://patchwork.example.com/profile.
+Once you have a token, run:
+
+.. code-block:: shell
+
+ $ curl -H "Authorization: Token ${token}" \
+ 'https://patchwork.example.com/api/'
+
+To authenticate using basic auth, you should use your Patchwork username and
+password. To do this, run:
.. code-block:: shell
- $ curl -u username:password 'https://patchwork.example.com/api/'
+ $ curl -u ${username}:${password} \
+ 'https://patchwork.example.com/api/'
-Not all resources require authentication. Those that do will return ``404 Not
-Found`` if authentication is not provided to avoid leaking information.
+Not all resources require authentication. Those that do will return ``404 (Not
+Found)`` if authentication is not provided to avoid leaking information.
Pagination
----------