Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents f72483b + 59e8e6c commit 4e78887d6eb13c27a8e55b711e1e99f30a425820 @svituz svituz committed May 10, 2017
@@ -1,2 +1,37 @@
Authentication
-~~~~
+==============
+
+Authentication is performed using OAuth2 protocol. The implementation is based on
+`django-oauth2-providers <https://django-oauth2-provider.readthedocs.io/en/latest/>`_ Django application so for generale
+documentation overview refer to the official documentation. Here we only explain the difference of the MOST implementation.
+
+MOST implementation requires also the *taskgroup* field to get an access_token in the REST call.
+
+REST API
+********
+
+.. http:post:: /oauth2/access_token/
+
+ It authenticates the client providing an access token which can be used in subsequent REST calls.
+ The request data are:
+
+ * client_id: the id of an OAuth2 client as configured in database
+ * client_secret: the client secret,
+ * grant_type: password|pincode,
+ * username: the username,
+ * password|pincode: the password or the pincode depending on the grant_type value,
+ * taskgroup: the id of the taskgroup of the user
+
+ :reqheader Content-Type: application/json
+ :resheader Content-Type: application/json
+
+ **Example of correct response**
+
+ .. sourcecode:: json
+
+ {"access_token": "25735f2de89eff6fa7576b7f8ca5efb952a23ef7",
+ "expires_in": 31535999,
+ "refresh_token": "e2a310b568aba5f92bf8683715f862b98b1d714d",
+ "scope": "read",
+ "token_type": "Bearer"
+ }
View
@@ -44,9 +44,9 @@
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
- 'sphinx.ext.pngmath',
+ 'sphinx.ext.imgmath',
'sphinx.ext.viewcode',
- 'sphinx_http_domain',
+ 'sphinxcontrib.httpdomain',
]
# Add any paths that contain templates here, relative to this directory.
@@ -119,7 +119,7 @@ API Methods
MostUser
````````
- .. http:method:: POST /users/user/new/
+ .. http:post:: /users/user/new/
Create new user.
@@ -146,7 +146,7 @@ MostUser
:parameter json `data`: if success is True, it contains the created user data in json format
- .. http:method:: POST /users/user/login/
+ .. http:post:: /users/user/login/
Log a user in the system
@@ -160,7 +160,7 @@ MostUser
:parameter json `data`: if success is True, it contains the logged user data in json format
- .. http:method:: GET /users/user/logout/
+ .. http:get:: /users/user/logout/
Log a user out of the system
@@ -172,7 +172,7 @@ MostUser
:parameter str `errors`: an error string that explains the raised problems
- .. http:method:: GET /users/user/(user_id)/get_user_info/
+ .. http:get:: /users/user/(user_id)/get_user_info/
Get the information of the user identified by `user_id`
@@ -185,7 +185,7 @@ MostUser
:parameter json `data`: if success is True, it contains the data of user identified by `user_id`, in json format
- .. http:method:: GET /users/user/search/
+ .. http:get:: /users/user/search/
Get a list of users matching a query string in fields: username, last_name, first_name, email or certified_email
@@ -201,7 +201,7 @@ MostUser
data of users matching the query string, in json format
- .. http:method:: POST /users/user/(user_id)/edit/
+ .. http:post:: /users/user/(user_id)/edit/
Edit the information of the user identified by `user_id`
@@ -214,7 +214,7 @@ MostUser
:parameter json `data`: if success is True, it contains the updated data of user identified by `user_id`, in json format
- .. http:method:: POST /users/user/(user_id)/deactivate/
+ .. http:post:: /users/user/(user_id)/deactivate/
Deactivate the user identified by `user_id`
@@ -227,7 +227,7 @@ MostUser
:parameter json `data`: if success is True, it contains the keys `id` (for the user id) and `is_active` (for the activation state):
- .. http:method:: POST /users/user/(user_id)/activate/
+ .. http:post:: /users/user/(user_id)/activate/
Activate the user identified by `user_id`
@@ -243,7 +243,7 @@ MostUser
ClinicianUser
`````````````
- .. http:method:: POST /users/clinician_user/new/
+ .. http:post:: /users/clinician_user/new/
Create new clinician user.
@@ -260,7 +260,7 @@ ClinicianUser
:parameter json `data`: if success is True, it contains the created user data in json format
- .. http:method:: GET /users/clinician_user/(user_id)/is_provider/
+ .. http:get:: /users/clinician_user/(user_id)/is_provider/
Investigate if the clinician user, with related user identified by `user_id`, is health care provider
@@ -273,7 +273,7 @@ ClinicianUser
:parameter json `data`: if success is True, it contains the keys `user_id` (for the related user id) and `is_health_care_provider` (for the health care provider state)
- .. http:method:: POST /users/clinician_user/(user_id)/set_provider/
+ .. http:post:: /users/clinician_user/(user_id)/set_provider/
Set the clinician user, with related user identified by `user_id`, health care provider state to True
@@ -286,7 +286,7 @@ ClinicianUser
:parameter json `data`: if success is True, it contains the keys `user_id` (for the related user id) and `is_health_care_provider` (for the health care provider state)
- .. http:method:: GET /users/clinician_user/search/
+ .. http:get:: /users/clinician_user/search/
Get a list of clinician users matching a query string in fields: username, last_name, first_name, email, certified_email or specialization
@@ -302,7 +302,7 @@ ClinicianUser
data of clinician users matching the query string, in json format
- .. http:method:: GET /users/clinician_user/(user_id)/get_user_info/
+ .. http:get:: /users/clinician_user/(user_id)/get_user_info/
Get the information of the clinician user, with related user identified by `user_id`
@@ -318,7 +318,7 @@ ClinicianUser
TaskGroup
`````````
- .. http:method:: POST /users/task_group/new/
+ .. http:post:: /users/task_group/new/
Create new task group
@@ -339,7 +339,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the created task group data in json format
- .. http:method:: GET /users/task_group/search/
+ .. http:get:: /users/task_group/search/
Get a list of task group matching a query string in fields: title, description or hospital
@@ -355,7 +355,7 @@ TaskGroup
data of task groups matching the query string, in json format
- .. http:method:: POST /users/task_group/(task_group_id)/edit/
+ .. http:post:: /users/task_group/(task_group_id)/edit/
Edit the information of the task group identified by `task_group_id`
@@ -369,7 +369,7 @@ TaskGroup
- .. http:method:: GET /users/task_group/list_available_states/
+ .. http:get:: /users/task_group/list_available_states/
Get a list of available state of activation
@@ -382,7 +382,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains an array of available activation states in json format
- .. http:method:: POST /users/task_group/(task_group_id)/set_active_state/(active_state)/
+ .. http:post:: /users/task_group/(task_group_id)/set_active_state/(active_state)/
Set the activation state `active_state` (active or inactive) to the task group identified by `task_group_id`
@@ -395,7 +395,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `id` (for the task group id) and `is_active` (for the activation state), in json format
- .. http:method:: GET /users/task_group/(task_group_id)/is_provider/
+ .. http:get:: /users/task_group/(task_group_id)/is_provider/
Investigate if the task group identified by `task_group_id` is health care provider
@@ -408,7 +408,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `id` (for the task group id) and `is_health_care_provider` (for the health care provider state)
- .. http:method:: POST /users/task_group/(task_group_id)/set_provider/
+ .. http:post:: /users/task_group/(task_group_id)/set_provider/
Set the task group identified by `task_group_id` as health care provider
@@ -421,7 +421,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `id` (for the task group id) and `is_active` (for the activation state), in json format
- .. http:method:: POST /users/task_group/(task_group_id)/add_user/(user_id)/
+ .. http:post:: /users/task_group/(task_group_id)/add_user/(user_id)/
Add the user identified by `user_id` to the task group identified by `task_group_id`
@@ -434,7 +434,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `user_id` (for the user just added to the task group), in json format
- .. http:method:: POST /users/task_group/(task_group_id)/remove_user/(user_id)/
+ .. http:post:: /users/task_group/(task_group_id)/remove_user/(user_id)/
Remove the user identified by `user_id` from the task group identified by `task_group_id`
@@ -447,7 +447,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `user_id` (for the user just removed from the task group), in json format
- .. http:method:: GET /users/task_group/(task_group_id)/list_users/
+ .. http:get:: /users/task_group/(task_group_id)/list_users/
List all users that belong to the task group identified by `task_group_id`
@@ -460,7 +460,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains an array of data of users that belong to the task group, in json format
- .. http:method:: POST /users/task_group/(task_group_id)/add_related_task_group/(related_task_group_id)/
+ .. http:post:: /users/task_group/(task_group_id)/add_related_task_group/(related_task_group_id)/
Add the related task group identified by `related_task_group_id` to the task group identified by `task_group_id`
@@ -473,7 +473,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `related_task_group_id` (for the related task group just added to the task group), in json format
- .. http:method:: POST /users/task_group/(task_group_id)/remove_related_task_group/(related_task_group_id)/
+ .. http:post:: /users/task_group/(task_group_id)/remove_related_task_group/(related_task_group_id)/
Remove the related task group identified by `related_task_group_id` from the task group identified by `task_group_id`
@@ -486,7 +486,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `related_task_group_id` (for the related task group just removed from the task group), in json format
- .. http:method:: GET /users/task_group/(task_group_id)/list_related_task_groups/
+ .. http:get:: /users/task_group/(task_group_id)/list_related_task_groups/
List all related task groups that belong to the task group identified by `task_group_id`
@@ -499,7 +499,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains an array of data of related task groups that belong to the task group, in json format
- .. http:method:: GET /users/task_group/(task_group_id)/has_clinicians/
+ .. http:get:: /users/task_group/(task_group_id)/has_clinicians/
Investigate if the task group identified by `task_group_id` has clinician users
@@ -512,7 +512,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `clinicians_count` (for the number of clinician user that belong to task group)
- .. http:method:: GET /users/task_group/(task_group_id)/list_clinicians/
+ .. http:get:: /users/task_group/(task_group_id)/list_clinicians/
List all related clinician users that belong to the task group identified by `task_group_id`
@@ -525,7 +525,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains an array of data of clinician users that belong to the task group, in json format
- .. http:method:: GET /users/task_group/(task_group_id)/has_clinician_provider/
+ .. http:get:: /users/task_group/(task_group_id)/has_clinician_provider/
Investigate if the task group identified by `task_group_id` has health care provider clinician users
@@ -538,7 +538,7 @@ TaskGroup
:parameter json `data`: if success is True, it contains the keys `task_group_id` (for the task group id) and `clinicians_count` (for the number of health care provider clinician user that belong to task group)
- .. http:method:: GET /users/task_group/(task_group_id)/list_clinician_providers/
+ .. http:get:: /users/task_group/(task_group_id)/list_clinician_providers/
List all health care provider clinician users that belong to the task group identified by `task_group_id`
@@ -1,7 +1,7 @@
APIs
~~~~
- .. http:method:: POST /users/clinician_user/new/
+ .. http:post:: /users/clinician_user/new/
Create new clinician user.
@@ -18,7 +18,7 @@ APIs
:parameter json `data`: if success is True, it contains the created user data in json format
- .. http:method:: GET /users/clinician_user/(user_id)/is_provider/
+ .. http:get:: /users/clinician_user/(user_id)/is_provider/
Investigate if the clinician user, with related user identified by `user_id`, is health care provider
@@ -31,7 +31,7 @@ APIs
:parameter json `data`: if success is True, it contains the keys `user_id` (for the related user id) and `is_health_care_provider` (for the health care provider state)
- .. http:method:: POST /users/clinician_user/(user_id)/set_provider/
+ .. http:post:: /users/clinician_user/(user_id)/set_provider/
Set the clinician user, with related user identified by `user_id`, health care provider state to True
@@ -44,7 +44,7 @@ APIs
:parameter json `data`: if success is True, it contains the keys `user_id` (for the related user id) and `is_health_care_provider` (for the health care provider state)
- .. http:method:: GET /users/clinician_user/search/
+ .. http:get:: /users/clinician_user/search/
Get a list of clinician users matching a query string in fields: username, last_name, first_name, email, certified_email or specialization
@@ -60,7 +60,7 @@ APIs
data of clinician users matching the query string, in json format
- .. http:method:: GET /users/clinician_user/(user_id)/get_user_info/
+ .. http:get:: /users/clinician_user/(user_id)/get_user_info/
Get the information of the clinician user, with related user identified by `user_id`
Oops, something went wrong.

0 comments on commit 4e78887

Please sign in to comment.