Merge remote-tracking branch 'origin/master' into finish-tests

This commit is contained in:
Ondřej Fischer 2019-10-01 14:58:44 +02:00
commit 16625aff2d
3 changed files with 252 additions and 8 deletions

216
Insomnia_2019-10-01.yaml Normal file
View File

@ -0,0 +1,216 @@
_type: export
__export_format: 4
__export_date: 2019-10-01T12:26:42.443Z
__export_source: insomnia.desktop.app:v6.6.2
resources:
- _id: req_f0797b6411b144f0bf0a40d9300ee92f
authentication:
disabled: false
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
type: basic
username: spaceti
body:
mimeType: application/json
text: >-
{
"username": "spaceti",
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
}
created: 1569905755136
description: ""
headers:
- id: pair_061d15d1294e412caca8300559541695
name: content-type
value: application/json
isPrivate: false
metaSortKey: -1569905755136
method: POST
modified: 1569931985286
name: Login user
parameters: []
parentId: fld_9ef1d96e0e6d40ef9094250114269496
settingDisableRenderRequestBody: false
settingEncodeUrl: true
settingRebuildPath: true
settingSendCookies: true
settingStoreCookies: true
url: "{{ base_url }}/AaaManager/authSession"
_type: request
- _id: fld_9ef1d96e0e6d40ef9094250114269496
created: 1569905755142
description: Login information ( token )
environment: {}
environmentPropertyOrder: null
metaSortKey: -1569905755142
modified: 1569905755142
name: login
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
_type: request_group
- _id: wrk_43652e59afaf4825a8bbbf31e346f616
created: 1569905755149
description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod)
Jira issues: [Communicaiton with
Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78\
&projectKey=INT&modal=detail&selectedIssue=INT-3563)"
modified: 1569905755149
name: Colnod server 1.0.0
parentId: null
_type: workspace
- _id: req_00f9f99d933c4638900385ffbbd4f8f7
authentication:
token: cb50c0a8-9297-4369-85e5-2edf2715c8d4
type: bearer
body:
mimeType: application/json
text: ""
created: 1569905755134
description: ""
headers:
- id: pair_a2a3c43a20f64efbb8a4752c7e983c8e
name: Content-Type
value: application/json
isPrivate: false
metaSortKey: -1569905755134
method: POST
modified: 1569932320745
name: Get subjects
parameters: []
parentId: fld_2fb4c2cef1f44cff83d6b00fe0886384
settingDisableRenderRequestBody: false
settingEncodeUrl: true
settingRebuildPath: true
settingSendCookies: true
settingStoreCookies: true
url: "{{ base_url }}/SubjectManager/getSubjects"
_type: request
- _id: fld_2fb4c2cef1f44cff83d6b00fe0886384
created: 1569905755140
description: Operations about user
environment: {}
environmentPropertyOrder: null
metaSortKey: -1569905755140
modified: 1569905755140
name: user
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
_type: request_group
- _id: req_9e42a5023f9d4235a5de099cd7573d2b
authentication:
token: e3cabdeb-a883-48ff-93a0-a0290bc3fc2a
type: bearer
body: {}
created: 1569905755131
description: ""
headers: []
isPrivate: false
metaSortKey: -1569905755131
method: POST
modified: 1569932279898
name: Get Tokens
parameters: []
parentId: fld_36a4be72380440a0ace83ad508a0458d
settingDisableRenderRequestBody: false
settingEncodeUrl: true
settingRebuildPath: true
settingSendCookies: true
settingStoreCookies: true
url: "{{ base_url }}/TokenManager/getTokens"
_type: request
- _id: fld_36a4be72380440a0ace83ad508a0458d
created: 1569905755138
description: Working with tokens ( keys )
environment: {}
environmentPropertyOrder: null
metaSortKey: -1569905755138
modified: 1569905755138
name: token
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
_type: request_group
- _id: req_31d5f570d3c14ccaa66942104b425edf
authentication:
token: e3cabdeb-a883-48ff-93a0-a0290bc3fc2a
type: bearer
body: {}
created: 1569932671808
description: ""
headers: []
isPrivate: false
metaSortKey: -1569905755130.5
method: POST
modified: 1569932695037
name: Get Token Subject
parameters: []
parentId: fld_36a4be72380440a0ace83ad508a0458d
settingDisableRenderRequestBody: false
settingEncodeUrl: true
settingRebuildPath: true
settingSendCookies: true
settingStoreCookies: true
url: "{{ base_url }}/OpenManager/getTokenSubject"
_type: request
- _id: req_4f99d61a83c14da29882cc80c07ddf54
authentication:
token: e3cabdeb-a883-48ff-93a0-a0290bc3fc2a
type: bearer
body: {}
created: 1569905755127
description: ""
headers: []
isPrivate: false
metaSortKey: -1569905755129
method: POST
modified: 1569932283290
name: Set Tokens
parameters: []
parentId: fld_36a4be72380440a0ace83ad508a0458d
settingDisableRenderRequestBody: false
settingEncodeUrl: true
settingRebuildPath: true
settingSendCookies: true
settingStoreCookies: true
url: /TokenManager/setTokens
_type: request
- _id: env_7bc4918f1ec5467393a2ab36a460e4d0
color: null
created: 1569905755147
data:
base_url: "{{ scheme }}://{{ host }}{{ base_path }}"
dataPropertyOrder:
"&":
- base_url
isPrivate: false
metaSortKey: 1569905755147
modified: 1569905805832
name: Base environment
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
_type: environment
- _id: jar_61bbb3fdc5ee80a49ee817b3e5341053a6022960
cookies:
- creation: 2019-10-01T04:57:46.521Z
domain: 192.168.1.3
hostOnly: true
httpOnly: true
id: "6820483365057537"
key: JSESSIONID
lastAccessed: 2019-10-01T11:56:56.476Z
path: /
secure: true
value: 825F318A0B50FCB64C295AD38164FA01
created: 1569905764431
modified: 1569931016477
name: Default Jar
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
_type: cookie_jar
- _id: env_92b9543a27e847689c951d1b1eeff229
color: "#cb5dc2"
created: 1569905755144
data:
base_path: /
host: 192.168.1.3:8443
scheme: https
dataPropertyOrder: null
isPrivate: false
metaSortKey: 1569905755144
modified: 1569905819689
name: OpenAPI env
parentId: env_7bc4918f1ec5467393a2ab36a460e4d0
_type: environment

View File

@ -3,10 +3,27 @@
Acces Management System of Colsys: [Product info](http://produkty.colsys.cz/colnod/)
## Endpoints
1. POST request - `/AaaManager/authSession` - to login, return JSON with Auth token
2. GET request - `/SubjectManager/getSubjects` - get subjects
3. GET request - `/TokenManager/getTokens` - get tokens
4. POST request - `/TokenManager/setTokens` - set tokens
- POST `/AaaManager/authSession`
- Header: Authorization: Basic =4589022lj3.....
- password: spaceti1 -> sha512 `echo spaceti1 | sha512sum`
```bash
E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
```
- body:
```json
{
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0",
"username": "spaceti"
}
```
1. GET request - `/SubjectManager/getSubjects` - get subjects
2. GET request - `/TokenManager/getTokens` - get tokens
3. POST request - `/TokenManager/setTokens` - set tokens
## RestAPI definitions
@ -39,6 +56,20 @@ curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E847
curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.254.11:8443/AaaManager/authSession
```
## Insomnia Rest client
[Insomnia Rest](https://insomnia.rest/)
It is possible to chain requests: [see doc](https://support.insomnia.rest/article/43-chaining-requests)
- use token from login response as an Authorization header
- use id from POST /item in PUT /items/<id>
- use entire body from one response to upload to another
### Import workspace
- import: `Insomnia_2019_10_01.yaml`
## Testing Blueprint API
### Snowboard
@ -53,9 +84,6 @@ curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E847
[Colnod API snowboard documentation](http://localhost:8088)
#### Install snowboard
`npm install -g snowboard`

View File

@ -9,7 +9,7 @@ Jira issues:
title: Colnod server
contact:
name: Filip Bucek
email: filip.bucek@spaceti.com
email: filip.bucek@spaceti.com
servers:
- url: https://192.168.1.3:8443