Skip to content
Open
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
74 changes: 60 additions & 14 deletions server/api.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"info": {
"_postman_id": "866d0706-8c3f-42a9-a894-37ff2462e1f8",
"_postman_id": "84c3f50c-339d-41ae-8152-29bb900426d1",
"name": "scrumlr.io",
"description": "This is the documentation for the REST API server of the application [scrumlr.io](https://scrumlr.io). You get in touch with us and send an email to [info@scrumlr.io](https://info@scrumlr.io). The software is [MIT licensed](https://opensource.org/licenses/MIT) so do whatever you want with it. If you want to checkout the progress of our development and take a peek into our backlog you can checkout our [GitHub repository](https://github.com/inovex/scrumlr.io). By the way, this already the third iteration of our server and we're still working on the interface and on further improvements. Since the API is mainly intended for our web client we won't start with API versions at the moment so breaking changes may be incoming. Once it got stable we'll maybe start with that.\n\nIf you're using the postman collection in order to explore the different resources you should also checkout the variables of the collection. Anytime you'll create new resources (e.g. your login or a board) variables will be stored and used for subsequent calls on other resources.\n\nAccess to protected resources will be authorized if a bearer token is sent or it is included in the `jwt` Cookie, which will be automatically set upon login.\n\n## Getting started\n\nLet's try to explain the basic flow of how a new board can will be created and someone tries to join the board as a participant.\n\nFirst you can check whether you are already logged in by a `GET` request on `/user`. See the _User_ section for more information.\n\n1. A user signs into the application (see _Login_ section)\n \n2. The user creates a new board (`POST` on `/boards`, checkout _Boards_ section)\n \n3. Another logged in user tries to join the board (`POST` on `/boards/{id}/participants`, checkout _Participants_ section)\n 1. If the boards access policy is set to `PUBLIC` the participant will be added to the board and afterwards all resources will be available\n \n 2. If the board requires a passphrase and the access policy is set to `BY_PASSPHRASE` a client error will be reported until the user sends the correct passphrase within the payload of the request\n \n 3. If the boards access policy is set to `BY_INVITE` a session request will be created instead and the user will be redirected to the new resource. The board owner now needs to accept or reject the request until the user can continue\n \n\nThese are just the basic steps of how sessions can be created. You can also have a look into the section _Realtime_ to see how you can open websockets and listen to live updates on the data.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "32837949"
"_exporter_id": "33458987"
},
"item": [
{
Expand Down Expand Up @@ -482,6 +482,52 @@
"body": "{\n \"id\": \"34fc390b-8abe-458b-8a1e-9a918dec4b48\",\n \"name\": \"Jane Doe\"\n}"
}
]
},
{
"name": "Get user by ID",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const res = pm.response.json();",
"pm.test(\"Successful GET request\", () => {",
" pm.expect(pm.response).to.have.status(200);",
"});",
"",
"pm.test(\"Check id is included\", () => {",
" pm.expect(res.id).to.exist;",
"});",
"",
"pm.test(\"Check name is included\", () => {",
" pm.expect(res.name).to.exist;",
"});",
"",
"pm.test(\"Check identical id\", () => {",
" pm.expect(res.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/user/{{user_id}}",
"host": [
"{{base_url}}"
],
"path": [
"user",
"{{user_id}}"
]
}
},
"response": []
}
],
"description": "These resources can update or read user information of the currently authenticated user. Since the `jwt` Cookie, which holds the user session, is set to HTTP only and therefore cannot be read from your web application you can use these methods to check which is user is actively using the application.",
Expand Down Expand Up @@ -2093,7 +2139,7 @@
" pm.expect(res).to.have.property('participants');",
" pm.expect(res.participants).to.be.an('array');",
" pm.expect(res.participants.length).to.equal(1);",
" pm.expect(res.participants[0].user.id).to.equal(pm.collectionVariables.get('user_id'));",
" pm.expect(res.participants[0].id).to.equal(pm.collectionVariables.get('user_id'));",
"})",
"",
"pm.test('Check notes', () => {",
Expand Down Expand Up @@ -5115,8 +5161,8 @@
"});",
"",
"pm.test(\"Check response content\", () => {",
" pm.expect(res.user).to.be.an(\"object\");",
" pm.expect(res.user.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
" pm.expect(res.id).to.be.a(\"string\");",
" pm.expect(res.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
"})"
],
"type": "text/javascript",
Expand Down Expand Up @@ -5156,9 +5202,9 @@
"\r",
"pm.test(\"Check response content\", () => {\r",
" pm.expect(res).to.be.an(\"array\");\r",
" pm.expect(res[0].user.id).to.equal(pm.collectionVariables.get(\"user_id\"));\r",
" pm.expect(res[0].id).to.equal(pm.collectionVariables.get(\"user_id\"));\r",
"\r",
" pm.collectionVariables.set(\"owner_id\", res[0].user.id);\r",
" pm.collectionVariables.set(\"owner_id\", res[0].id);\r",
"})"
],
"type": "text/javascript",
Expand Down Expand Up @@ -5198,9 +5244,9 @@
"\r",
"pm.test(\"Check response content\", () => {\r",
" pm.expect(res).to.be.an(\"array\");\r",
" pm.expect(res[0].user.id).to.equal(pm.collectionVariables.get(\"user_id\"));\r",
" pm.expect(res[0].id).to.equal(pm.collectionVariables.get(\"user_id\"));\r",
"\r",
" pm.collectionVariables.set(\"owner_id\", res[0].user.id);\r",
" pm.collectionVariables.set(\"owner_id\", res[0].id);\r",
"})"
],
"type": "text/javascript",
Expand Down Expand Up @@ -5261,8 +5307,8 @@
"});",
"",
"pm.test(\"Check response content\", () => {",
" pm.expect(res.user).to.be.an(\"object\");",
" pm.expect(res.user.id).to.equal(pm.collectionVariables.get(\"owner_id\"));",
" pm.expect(res.id).to.be.a(\"string\");",
" pm.expect(res.id).to.equal(pm.collectionVariables.get(\"owner_id\"));",
"})"
],
"type": "text/javascript",
Expand Down Expand Up @@ -5303,7 +5349,7 @@
"",
"pm.test(\"Check response content\", () => {",
" pm.expect(res).to.be.an(\"array\");",
" pm.expect(res[0].user.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
" pm.expect(res[0].id).to.equal(pm.collectionVariables.get(\"user_id\"));",
"",
" pm.expect(res[0].ready).to.equal(false);",
" pm.expect(res[0].raisedHand).to.equal(false);",
Expand Down Expand Up @@ -5354,7 +5400,7 @@
"});",
"",
"pm.test(\"Check response content\", () => {",
" pm.expect(res.user.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
" pm.expect(res.id).to.equal(pm.collectionVariables.get(\"user_id\"));",
"",
" pm.expect(res.ready).to.equal(true);",
" pm.expect(res.raisedHand).to.equal(true);",
Expand Down Expand Up @@ -5561,4 +5607,4 @@
"value": "{column_template_id}"
}
]
}
}
12 changes: 5 additions & 7 deletions server/src/.mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ packages:
interfaces:
SessionService:
SessionDatabase:
UserService:
UserDatabase:

scrumlr.io/server/sessionrequests:
interfaces:
Expand All @@ -50,11 +48,11 @@ packages:
interfaces:
NotesService:
NotesDatabase:
# todo: reimplement this interface
# scrumlr.io/server/sessions:
# interfaces:
# UserService:
# UserDatabase:

scrumlr.io/server/users:
interfaces:
UserService:
UserDatabase:

scrumlr.io/server/votings:
interfaces:
Expand Down
Loading
Loading