[PATCH 5/5] docs: Document token auth support

Andrew Donnellan andrew.donnellan at au1.ibm.com
Tue Jun 13 21:35:57 AEST 2017


Acked-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

On 10/06/17 03:25, Stephen Finucane wrote:
> Signed-off-by: Stephen Finucane <stephen at that.guru>
> ---
>  docs/api/rest.rst | 23 +++++++++++++++++++----
>  1 file 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
>  ----------
>

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Patchwork mailing list