Skip to content
Snippets Groups Projects
Commit 4f8acf85 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add more documentation

parent 5b6ad905
No related branches found
No related tags found
No related merge requests found
docs/_static/access_profile.png

339 KiB

docs/_static/profile.png

414 KiB

docs/_static/revoke_token.png

470 KiB

docs/_static/token_copied.png

496 KiB

docs/_static/token_revoked.png

432 KiB

API documentation CSEntry API
================= ===========
Basic usage
-----------
The root of the API is at `/api/v1`.
Example of a valid API request using curl::
curl https://csentry.esss.lu.se/api/v1/inventory/items
Authentication
--------------
To access CSEntry API, a personal access token is required.
A temporary token can be retrieved by sending a POST to `/api/v1/user/login` including the username
and password. It will return a token valid for 12 hours.
A token that never expires can be generated from the user profile page.
See :ref:`token-generation`.
The token should be passed in the header as follow::
curl --header 'Authorization: Bearer <token>' https://csentry.esss.lu.se/api/v1/inventory/items
Summary Summary
------- -------
......
...@@ -110,6 +110,8 @@ html_static_path = ['_static'] ...@@ -110,6 +110,8 @@ html_static_path = ['_static']
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = { html_sidebars = {
'**': [ '**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display 'relations.html', # needs 'show_related': True theme option to display
'searchbox.html', 'searchbox.html',
] ]
......
...@@ -6,17 +6,10 @@ ...@@ -6,17 +6,10 @@
Welcome to CSEntry's documentation! Welcome to CSEntry's documentation!
=================================== ===================================
.. toctree::
:maxdepth: 2
:caption: Contents:
API
---
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
usage
api api
......
.. _usage:
Usage
=====
Overview
--------
Control System Entry is a web application that facilitates the tracking of physical items
and network devices.
.. _token-generation:
Generate a personal access token
--------------------------------
1. Go to your profile page by clicking on your name in the upper right corner.
.. image:: _static/access_profile.png
2. Enter a description for the token and click on **Generate token**.
.. image:: _static/profile.png
3. Click on the icon on the left of the generated token to copy it to the clipboard.
Save it to a safe place. You won't be able to see the token again! Only the JWT id is saved to the database.
.. image:: _static/token_copied.png
Revoke a personal access token
-------------------------------
1. Click on the trash icon on the left of the JWT id on your profile page. A confirmation window will open.
.. image:: _static/revoke_token.png
2. Click **OK** to revoke the token. Or **Cancel**.
.. image:: _static/token_revoked.png
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment