mvn spring-boot:run
The project as a demo has 2 inmemory accounts
- user:password
- user2:password
The following apis are Basic authenticated
POST /tasks
{
"label": "urgent"
}
{
"id": "e4e638b7-4813-4659-9ada-43f903929d48",
"label": "urgent",
"complete": false,
"author": "user"
}
GET /tasks/[id]
{
"id": "[id]]",
"label": "urgent",
"complete": false,
"author": "user"
}
GET /tasks?complete=false
[
{
"id": "[îd]]",
"label": "tres urgent",
"complete": false,
"author": "user"
}
]
- complete (optional) :
- not set : get all the tasks
- false : get all the not completed tasks
- true : get all the completed tasks
Only the author can update a task
PUT /tasks/[id]
{
"label": "tres urgent"
}
{
"id": "[id]]",
"label": "urgent",
"complete": false,
"author": "user"
}
- 403 : the authenticated user is not the author of the task and can't update it
Only the author can complete or uncomplete a task
POST \tasks\[id]\complete
POST \tasks\[id]\uncomplete
The answer body has the field "complete" to true in the first case, false in the second case.
- 403 : the authenticated user is not the author of the task and can't update it
Only the author can update a task
DELETE /tasks/[id]
- 403 : the authenticated user is not the author of the task and can't update it