Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Improve documentation [dev] #107

Merged
merged 2 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/apiary.apib
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HOST: http://localhost:8000/auth

<!-- include(auth.apib) -->
<!-- include(crud-api.apib) -->
<!-- include(relation.apib) -->
Expand Down
9 changes: 5 additions & 4 deletions docs/auth.apib
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ Service is the token that associates the user with the set of devices and flows

## Individual user settings [/user/{id}]
Access a user's authorization and identification information
+ parameters

+ Parameters
+ id: 1 (required, string) - The user ID

### Get user info [GET /user/{id}]
### Get user info [GET]
Retrieves all information from a specific registered user
+ Request
+ Headers
Expand Down Expand Up @@ -181,7 +182,7 @@ Retrieves all information from a specific registered user
}


### Update user info [PUT /user/{id}]
### Update user info [PUT]
Replaces user information. Fields or attributes that are not informed will revert to their defaults.
+ Request (application/json)
+ Headers
Expand Down Expand Up @@ -214,7 +215,7 @@ Replaces user information. Fields or attributes that are not informed will rever
"status": 404
}

### Remove user [DELETE /user/{id}]
### Remove user [DELETE]
Removes a user from the system
+ Request
+ Headers
Expand Down
35 changes: 30 additions & 5 deletions docs/crud-api.apib
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ also be escaped
"message": "No permission with found this ID"
}

+ Response 404 (application/json)

{
"status": 404,
"message": "No permission with found this ID"
}
+ Response 405 (application/json)

{
"status": 405,
"message": "Can't edit a system permission"
}

### Remove a permission [DELETE]

+ Request
Expand All @@ -136,7 +149,7 @@ also be escaped
Authorization: Bearer JWT

+ Response 200 (application/json)

{
"status": 200,
"message": "ok"
Expand Down Expand Up @@ -171,7 +184,7 @@ also be escaped
}

+ Response 200 (application/json)

{
"status": 200,
"id": 3
Expand All @@ -191,7 +204,7 @@ also be escaped
+ name: testadm (optional, string) - a group name, or part of a group name.

+ Response 200 (application/json)

{
"groups": [
{
Expand Down Expand Up @@ -227,7 +240,7 @@ also be escaped
}

+ Response 404 (application/json)

{
"status": 404,
"message": "No group found with this ID"
Expand All @@ -241,7 +254,7 @@ also be escaped
Authorization: Bearer JWT

+ Body

{
"name": "testadm",
"description" : "projectX"
Expand All @@ -261,6 +274,12 @@ also be escaped
"message": "No group found with this ID"
}

+ Response 405 (application/json)

{
"status": 405,
"message": "Can't edit admin group"
}

### Remove a group [DELETE]
+ Request (application/json)
Expand All @@ -282,3 +301,9 @@ also be escaped
"message": "No group found with this ID"
}

+ Response 405 (application/json)

{
"status": 405,
"message": "Can't delete admin group""
}