forked from ondra/colnod-connector
Lot of little changes mostly because of testing
This commit is contained in:
parent
3f57758510
commit
62343bb0b8
@ -1,240 +1,240 @@
|
|||||||
_type: export
|
_type: export
|
||||||
__export_format: 4
|
__export_format: 4
|
||||||
__export_date: 2019-10-01T14:13:03.279Z
|
__export_date: 2019-10-01T14:13:03.279Z
|
||||||
__export_source: insomnia.desktop.app:v6.6.2
|
__export_source: insomnia.desktop.app:v6.6.2
|
||||||
resources:
|
resources:
|
||||||
- _id: req_f0797b6411b144f0bf0a40d9300ee92f
|
- _id: req_f0797b6411b144f0bf0a40d9300ee92f
|
||||||
authentication:
|
authentication:
|
||||||
disabled: false
|
disabled: false
|
||||||
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
||||||
type: basic
|
type: basic
|
||||||
username: spaceti
|
username: spaceti
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: >-
|
text: >-
|
||||||
{
|
{
|
||||||
"username": "spaceti",
|
"username": "spaceti",
|
||||||
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
||||||
}
|
}
|
||||||
created: 1569905755136
|
created: 1569905755136
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- id: pair_061d15d1294e412caca8300559541695
|
- id: pair_061d15d1294e412caca8300559541695
|
||||||
name: content-type
|
name: content-type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755136
|
metaSortKey: -1569905755136
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569934518963
|
modified: 1569934518963
|
||||||
name: Login user
|
name: Login user
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_9ef1d96e0e6d40ef9094250114269496
|
parentId: fld_9ef1d96e0e6d40ef9094250114269496
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/AaaManager/authSession"
|
url: "{{ base_url }}/AaaManager/authSession"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_9ef1d96e0e6d40ef9094250114269496
|
- _id: fld_9ef1d96e0e6d40ef9094250114269496
|
||||||
created: 1569905755142
|
created: 1569905755142
|
||||||
description: Login information ( token )
|
description: Login information ( token )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755142
|
metaSortKey: -1569905755142
|
||||||
modified: 1569905755142
|
modified: 1569905755142
|
||||||
name: login
|
name: login
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: wrk_43652e59afaf4825a8bbbf31e346f616
|
- _id: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
created: 1569905755149
|
created: 1569905755149
|
||||||
description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod)
|
description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod)
|
||||||
Jira issues: [Communicaiton with
|
Jira issues: [Communicaiton with
|
||||||
Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78\
|
Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78\
|
||||||
&projectKey=INT&modal=detail&selectedIssue=INT-3563)"
|
&projectKey=INT&modal=detail&selectedIssue=INT-3563)"
|
||||||
modified: 1569905755149
|
modified: 1569905755149
|
||||||
name: Colnod server 1.0.0
|
name: Colnod server 1.0.0
|
||||||
parentId: null
|
parentId: null
|
||||||
_type: workspace
|
_type: workspace
|
||||||
- _id: req_00f9f99d933c4638900385ffbbd4f8f7
|
- _id: req_00f9f99d933c4638900385ffbbd4f8f7
|
||||||
authentication:
|
authentication:
|
||||||
disabled: false
|
disabled: false
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: ""
|
text: ""
|
||||||
created: 1569905755134
|
created: 1569905755134
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- id: pair_a2a3c43a20f64efbb8a4752c7e983c8e
|
- id: pair_a2a3c43a20f64efbb8a4752c7e983c8e
|
||||||
name: Content-Type
|
name: Content-Type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755134
|
metaSortKey: -1569905755134
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569937805044
|
modified: 1569937805044
|
||||||
name: Get subjects
|
name: Get subjects
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
parentId: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/SubjectManager/getSubjects"
|
url: "{{ base_url }}/SubjectManager/getSubjects"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
- _id: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
||||||
created: 1569905755140
|
created: 1569905755140
|
||||||
description: Operations about user
|
description: Operations about user
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755140
|
metaSortKey: -1569905755140
|
||||||
modified: 1569905755140
|
modified: 1569905755140
|
||||||
name: user
|
name: user
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: req_9e42a5023f9d4235a5de099cd7573d2b
|
- _id: req_9e42a5023f9d4235a5de099cd7573d2b
|
||||||
authentication:
|
authentication:
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: |-
|
text: |-
|
||||||
{
|
{
|
||||||
"id": "1a23c502-1665-4492-94ea-039bb7505cae"
|
"id": "1a23c502-1665-4492-94ea-039bb7505cae"
|
||||||
}
|
}
|
||||||
created: 1569905755131
|
created: 1569905755131
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- disabled: false
|
- disabled: false
|
||||||
id: pair_e888b6c679d74b0988f0dd2d77690383
|
id: pair_e888b6c679d74b0988f0dd2d77690383
|
||||||
name: Content-Type
|
name: Content-Type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755131
|
metaSortKey: -1569905755131
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569939013152
|
modified: 1569939013152
|
||||||
name: Get Tokens
|
name: Get Tokens
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/TokenManager/getTokens/"
|
url: "{{ base_url }}/TokenManager/getTokens/"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_36a4be72380440a0ace83ad508a0458d
|
- _id: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
created: 1569905755138
|
created: 1569905755138
|
||||||
description: Working with tokens ( keys )
|
description: Working with tokens ( keys )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755138
|
metaSortKey: -1569905755138
|
||||||
modified: 1569934361048
|
modified: 1569934361048
|
||||||
name: Token Manager
|
name: Token Manager
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: req_4f99d61a83c14da29882cc80c07ddf54
|
- _id: req_4f99d61a83c14da29882cc80c07ddf54
|
||||||
authentication:
|
authentication:
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body: {}
|
body: {}
|
||||||
created: 1569905755127
|
created: 1569905755127
|
||||||
description: ""
|
description: ""
|
||||||
headers: []
|
headers: []
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755129
|
metaSortKey: -1569905755129
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569938955854
|
modified: 1569938955854
|
||||||
name: Set Tokens
|
name: Set Tokens
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: /TokenManager/setTokens
|
url: /TokenManager/setTokens
|
||||||
_type: request
|
_type: request
|
||||||
- _id: req_fd2e096f45554b46b31755564a0932bf
|
- _id: req_fd2e096f45554b46b31755564a0932bf
|
||||||
authentication:
|
authentication:
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body: {}
|
body: {}
|
||||||
created: 1569934364782
|
created: 1569934364782
|
||||||
description: ""
|
description: ""
|
||||||
headers: []
|
headers: []
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755130.5
|
metaSortKey: -1569905755130.5
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569937740242
|
modified: 1569937740242
|
||||||
name: Get Token Subject
|
name: Get Token Subject
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_8d34eca167ef426c8aa998c98bbe74e2
|
- _id: fld_8d34eca167ef426c8aa998c98bbe74e2
|
||||||
created: 1569934364777
|
created: 1569934364777
|
||||||
description: Working with tokens ( keys )
|
description: Working with tokens ( keys )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755088
|
metaSortKey: -1569905755088
|
||||||
modified: 1569934370959
|
modified: 1569934370959
|
||||||
name: Open Manager
|
name: Open Manager
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: env_7bc4918f1ec5467393a2ab36a460e4d0
|
- _id: env_7bc4918f1ec5467393a2ab36a460e4d0
|
||||||
color: null
|
color: null
|
||||||
created: 1569905755147
|
created: 1569905755147
|
||||||
data:
|
data:
|
||||||
base_url: "{{ scheme }}://{{ host }}{{ base_path }}"
|
base_url: "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||||
dataPropertyOrder:
|
dataPropertyOrder:
|
||||||
"&":
|
"&":
|
||||||
- base_url
|
- base_url
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: 1569905755147
|
metaSortKey: 1569905755147
|
||||||
modified: 1569905805832
|
modified: 1569905805832
|
||||||
name: Base environment
|
name: Base environment
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: environment
|
_type: environment
|
||||||
- _id: jar_61bbb3fdc5ee80a49ee817b3e5341053a6022960
|
- _id: jar_61bbb3fdc5ee80a49ee817b3e5341053a6022960
|
||||||
cookies:
|
cookies:
|
||||||
- creation: 2019-10-01T04:57:46.521Z
|
- creation: 2019-10-01T04:57:46.521Z
|
||||||
domain: 192.168.1.3
|
domain: 192.168.1.3
|
||||||
hostOnly: true
|
hostOnly: true
|
||||||
httpOnly: true
|
httpOnly: true
|
||||||
id: "40058861704510274"
|
id: "40058861704510274"
|
||||||
key: JSESSIONID
|
key: JSESSIONID
|
||||||
lastAccessed: 2019-10-01T14:08:27.635Z
|
lastAccessed: 2019-10-01T14:08:27.635Z
|
||||||
path: /
|
path: /
|
||||||
secure: true
|
secure: true
|
||||||
value: 2A63FF79AC604DB88D26DE41876B8B88
|
value: 2A63FF79AC604DB88D26DE41876B8B88
|
||||||
created: 1569905764431
|
created: 1569905764431
|
||||||
modified: 1569938907635
|
modified: 1569938907635
|
||||||
name: Default Jar
|
name: Default Jar
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: cookie_jar
|
_type: cookie_jar
|
||||||
- _id: env_92b9543a27e847689c951d1b1eeff229
|
- _id: env_92b9543a27e847689c951d1b1eeff229
|
||||||
color: "#cb5dc2"
|
color: "#cb5dc2"
|
||||||
created: 1569905755144
|
created: 1569905755144
|
||||||
data:
|
data:
|
||||||
base_path: /
|
base_path: /
|
||||||
host: 192.168.1.3:8443
|
host: 192.168.1.3:8443
|
||||||
scheme: https
|
scheme: https
|
||||||
dataPropertyOrder: null
|
dataPropertyOrder: null
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: 1569905755144
|
metaSortKey: 1569905755144
|
||||||
modified: 1569935791597
|
modified: 1569935791597
|
||||||
name: colnod-test
|
name: colnod-test
|
||||||
parentId: env_7bc4918f1ec5467393a2ab36a460e4d0
|
parentId: env_7bc4918f1ec5467393a2ab36a460e4d0
|
||||||
_type: environment
|
_type: environment
|
||||||
|
|||||||
@ -1,270 +1,270 @@
|
|||||||
_type: export
|
_type: export
|
||||||
__export_format: 4
|
__export_format: 4
|
||||||
__export_date: 2019-10-02T15:35:40.243Z
|
__export_date: 2019-10-02T15:35:40.243Z
|
||||||
__export_source: insomnia.desktop.app:v6.6.2
|
__export_source: insomnia.desktop.app:v6.6.2
|
||||||
resources:
|
resources:
|
||||||
- _id: req_f0797b6411b144f0bf0a40d9300ee92f
|
- _id: req_f0797b6411b144f0bf0a40d9300ee92f
|
||||||
authentication:
|
authentication:
|
||||||
disabled: false
|
disabled: false
|
||||||
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
||||||
type: basic
|
type: basic
|
||||||
username: spaceti
|
username: spaceti
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: >-
|
text: >-
|
||||||
{
|
{
|
||||||
"username": "spaceti",
|
"username": "spaceti",
|
||||||
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
||||||
}
|
}
|
||||||
created: 1569905755136
|
created: 1569905755136
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- id: pair_061d15d1294e412caca8300559541695
|
- id: pair_061d15d1294e412caca8300559541695
|
||||||
name: content-type
|
name: content-type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755136
|
metaSortKey: -1569905755136
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1570026752164
|
modified: 1570026752164
|
||||||
name: Login user
|
name: Login user
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_9ef1d96e0e6d40ef9094250114269496
|
parentId: fld_9ef1d96e0e6d40ef9094250114269496
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/AaaManager/authSession"
|
url: "{{ base_url }}/AaaManager/authSession"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_9ef1d96e0e6d40ef9094250114269496
|
- _id: fld_9ef1d96e0e6d40ef9094250114269496
|
||||||
created: 1569905755142
|
created: 1569905755142
|
||||||
description: Login information ( token )
|
description: Login information ( token )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755142
|
metaSortKey: -1569905755142
|
||||||
modified: 1569905755142
|
modified: 1569905755142
|
||||||
name: login
|
name: login
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: wrk_43652e59afaf4825a8bbbf31e346f616
|
- _id: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
created: 1569905755149
|
created: 1569905755149
|
||||||
description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod)
|
description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod)
|
||||||
Jira issues: [Communicaiton with
|
Jira issues: [Communicaiton with
|
||||||
Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78\
|
Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78\
|
||||||
&projectKey=INT&modal=detail&selectedIssue=INT-3563)"
|
&projectKey=INT&modal=detail&selectedIssue=INT-3563)"
|
||||||
modified: 1569905755149
|
modified: 1569905755149
|
||||||
name: Colnod server 1.0.0
|
name: Colnod server 1.0.0
|
||||||
parentId: null
|
parentId: null
|
||||||
_type: workspace
|
_type: workspace
|
||||||
- _id: req_00f9f99d933c4638900385ffbbd4f8f7
|
- _id: req_00f9f99d933c4638900385ffbbd4f8f7
|
||||||
authentication:
|
authentication:
|
||||||
disabled: false
|
disabled: false
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'no-history' %}"
|
'b64::JC5pZA==::46b', 'no-history' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: ""
|
text: ""
|
||||||
created: 1569905755134
|
created: 1569905755134
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- id: pair_a2a3c43a20f64efbb8a4752c7e983c8e
|
- id: pair_a2a3c43a20f64efbb8a4752c7e983c8e
|
||||||
name: Content-Type
|
name: Content-Type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755134
|
metaSortKey: -1569905755134
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1570025488293
|
modified: 1570025488293
|
||||||
name: Get subjects
|
name: Get subjects
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
parentId: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/SubjectManager/getSubjects"
|
url: "{{ base_url }}/SubjectManager/getSubjects"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
- _id: fld_2fb4c2cef1f44cff83d6b00fe0886384
|
||||||
created: 1569905755140
|
created: 1569905755140
|
||||||
description: Operations about user
|
description: Operations about user
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755140
|
metaSortKey: -1569905755140
|
||||||
modified: 1569905755140
|
modified: 1569905755140
|
||||||
name: user
|
name: user
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: req_9e42a5023f9d4235a5de099cd7573d2b
|
- _id: req_9e42a5023f9d4235a5de099cd7573d2b
|
||||||
authentication:
|
authentication:
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: ""
|
text: ""
|
||||||
created: 1569905755131
|
created: 1569905755131
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- disabled: false
|
- disabled: false
|
||||||
id: pair_e888b6c679d74b0988f0dd2d77690383
|
id: pair_e888b6c679d74b0988f0dd2d77690383
|
||||||
name: Content-Type
|
name: Content-Type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755131
|
metaSortKey: -1569905755131
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569998661557
|
modified: 1569998661557
|
||||||
name: Get Tokens
|
name: Get Tokens
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/TokenManager/getTokens/"
|
url: "{{ base_url }}/TokenManager/getTokens/"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_36a4be72380440a0ace83ad508a0458d
|
- _id: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
created: 1569905755138
|
created: 1569905755138
|
||||||
description: Working with tokens ( keys )
|
description: Working with tokens ( keys )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755138
|
metaSortKey: -1569905755138
|
||||||
modified: 1569934361048
|
modified: 1569934361048
|
||||||
name: Token Manager
|
name: Token Manager
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: req_4f99d61a83c14da29882cc80c07ddf54
|
- _id: req_4f99d61a83c14da29882cc80c07ddf54
|
||||||
authentication:
|
authentication:
|
||||||
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: "{% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'never' %}"
|
'b64::JC5pZA==::46b', 'never' %}"
|
||||||
type: bearer
|
type: bearer
|
||||||
body: {}
|
body: {}
|
||||||
created: 1569905755127
|
created: 1569905755127
|
||||||
description: ""
|
description: ""
|
||||||
headers: []
|
headers: []
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755129
|
metaSortKey: -1569905755129
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1569938955854
|
modified: 1569938955854
|
||||||
name: Set Tokens
|
name: Set Tokens
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
parentId: fld_36a4be72380440a0ace83ad508a0458d
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: /TokenManager/setTokens
|
url: /TokenManager/setTokens
|
||||||
_type: request
|
_type: request
|
||||||
- _id: req_fd2e096f45554b46b31755564a0932bf
|
- _id: req_fd2e096f45554b46b31755564a0932bf
|
||||||
authentication:
|
authentication:
|
||||||
token: {% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
token: {% response 'body', 'req_f0797b6411b144f0bf0a40d9300ee92f',
|
||||||
'b64::JC5pZA==::46b', 'no-history' %}
|
'b64::JC5pZA==::46b', 'no-history' %}
|
||||||
type: bearer
|
type: bearer
|
||||||
body: {}
|
body: {}
|
||||||
created: 1569934364782
|
created: 1569934364782
|
||||||
description: ""
|
description: ""
|
||||||
headers: []
|
headers: []
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755130.5
|
metaSortKey: -1569905755130.5
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1570028425988
|
modified: 1570028425988
|
||||||
name: Get Token Subject
|
name: Get Token Subject
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: fld_8d34eca167ef426c8aa998c98bbe74e2
|
- _id: fld_8d34eca167ef426c8aa998c98bbe74e2
|
||||||
created: 1569934364777
|
created: 1569934364777
|
||||||
description: Working with tokens ( keys )
|
description: Working with tokens ( keys )
|
||||||
environment: {}
|
environment: {}
|
||||||
environmentPropertyOrder: null
|
environmentPropertyOrder: null
|
||||||
metaSortKey: -1569905755088
|
metaSortKey: -1569905755088
|
||||||
modified: 1569934370959
|
modified: 1569934370959
|
||||||
name: Open Manager
|
name: Open Manager
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: request_group
|
_type: request_group
|
||||||
- _id: req_7007bb1f6a0243a7b0568741f691f6d1
|
- _id: req_7007bb1f6a0243a7b0568741f691f6d1
|
||||||
authentication:
|
authentication:
|
||||||
disabled: false
|
disabled: false
|
||||||
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0
|
||||||
type: basic
|
type: basic
|
||||||
username: spaceti
|
username: spaceti
|
||||||
body:
|
body:
|
||||||
mimeType: application/json
|
mimeType: application/json
|
||||||
text: >-
|
text: >-
|
||||||
{
|
{
|
||||||
"username": "spaceti",
|
"username": "spaceti",
|
||||||
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
"password": "E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0"
|
||||||
}
|
}
|
||||||
created: 1570025458784
|
created: 1570025458784
|
||||||
description: ""
|
description: ""
|
||||||
headers:
|
headers:
|
||||||
- id: pair_74b4df5d54d1446a90e6a668d373fb79
|
- id: pair_74b4df5d54d1446a90e6a668d373fb79
|
||||||
name: Content-Type
|
name: Content-Type
|
||||||
value: application/json
|
value: application/json
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: -1569905755129.75
|
metaSortKey: -1569905755129.75
|
||||||
method: POST
|
method: POST
|
||||||
modified: 1570030518745
|
modified: 1570030518745
|
||||||
name: Get Token Subject Full authorization
|
name: Get Token Subject Full authorization
|
||||||
parameters: []
|
parameters: []
|
||||||
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
parentId: fld_8d34eca167ef426c8aa998c98bbe74e2
|
||||||
settingDisableRenderRequestBody: false
|
settingDisableRenderRequestBody: false
|
||||||
settingEncodeUrl: true
|
settingEncodeUrl: true
|
||||||
settingRebuildPath: true
|
settingRebuildPath: true
|
||||||
settingSendCookies: true
|
settingSendCookies: true
|
||||||
settingStoreCookies: true
|
settingStoreCookies: true
|
||||||
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
url: "{{ base_url }}/OpenManager/getTokenSubject"
|
||||||
_type: request
|
_type: request
|
||||||
- _id: env_7bc4918f1ec5467393a2ab36a460e4d0
|
- _id: env_7bc4918f1ec5467393a2ab36a460e4d0
|
||||||
color: null
|
color: null
|
||||||
created: 1569905755147
|
created: 1569905755147
|
||||||
data:
|
data:
|
||||||
base_url: "{{ scheme }}://{{ host }}{{ base_path }}"
|
base_url: "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||||
dataPropertyOrder:
|
dataPropertyOrder:
|
||||||
"&":
|
"&":
|
||||||
- base_url
|
- base_url
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: 1569905755147
|
metaSortKey: 1569905755147
|
||||||
modified: 1569905805832
|
modified: 1569905805832
|
||||||
name: Base environment
|
name: Base environment
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: environment
|
_type: environment
|
||||||
- _id: jar_61bbb3fdc5ee80a49ee817b3e5341053a6022960
|
- _id: jar_61bbb3fdc5ee80a49ee817b3e5341053a6022960
|
||||||
cookies:
|
cookies:
|
||||||
- creation: 2019-10-01T04:57:46.521Z
|
- creation: 2019-10-01T04:57:46.521Z
|
||||||
domain: 192.168.1.3
|
domain: 192.168.1.3
|
||||||
hostOnly: true
|
hostOnly: true
|
||||||
httpOnly: true
|
httpOnly: true
|
||||||
id: "9919962998126108"
|
id: "9919962998126108"
|
||||||
key: JSESSIONID
|
key: JSESSIONID
|
||||||
lastAccessed: 2019-10-02T15:35:00.995Z
|
lastAccessed: 2019-10-02T15:35:00.995Z
|
||||||
path: /
|
path: /
|
||||||
secure: true
|
secure: true
|
||||||
value: D64B135F2F3D5103F02F0B9235B13722
|
value: D64B135F2F3D5103F02F0B9235B13722
|
||||||
created: 1569905764431
|
created: 1569905764431
|
||||||
modified: 1570030500995
|
modified: 1570030500995
|
||||||
name: Default Jar
|
name: Default Jar
|
||||||
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
parentId: wrk_43652e59afaf4825a8bbbf31e346f616
|
||||||
_type: cookie_jar
|
_type: cookie_jar
|
||||||
- _id: env_92b9543a27e847689c951d1b1eeff229
|
- _id: env_92b9543a27e847689c951d1b1eeff229
|
||||||
color: "#cb5dc2"
|
color: "#cb5dc2"
|
||||||
created: 1569905755144
|
created: 1569905755144
|
||||||
data:
|
data:
|
||||||
base_path: /
|
base_path: /
|
||||||
host: 192.168.1.3:8443
|
host: 192.168.1.3:8443
|
||||||
scheme: https
|
scheme: https
|
||||||
dataPropertyOrder: null
|
dataPropertyOrder: null
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
metaSortKey: 1569905755144
|
metaSortKey: 1569905755144
|
||||||
modified: 1569935791597
|
modified: 1569935791597
|
||||||
name: colnod-test
|
name: colnod-test
|
||||||
parentId: env_7bc4918f1ec5467393a2ab36a460e4d0
|
parentId: env_7bc4918f1ec5467393a2ab36a460e4d0
|
||||||
_type: environment
|
_type: environment
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
||||||
|
|
||||||
|
|
||||||
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/SubjectManager/getSubjects
|
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/SubjectManager/getSubjects
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
||||||
|
|
||||||
|
|
||||||
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/TokenManager/getTokens/
|
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/TokenManager/getTokens/
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
TOKEN=$(curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession 2>/dev/null | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["id"]')
|
||||||
|
echo TOKEN
|
||||||
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/OpenManager/getTokenSubject
|
curl -kv -u "$TOKEN:" -X POST https://192.168.1.3:8443/OpenManager/getTokenSubject
|
||||||
|
|||||||
@ -1,127 +1,140 @@
|
|||||||
#include "requestmanager.h"
|
#include "requestmanager.h"
|
||||||
|
|
||||||
RequestManager::RequestManager()
|
RequestManager::RequestManager()
|
||||||
{
|
{
|
||||||
manager = new QNetworkAccessManager();
|
manager = new QNetworkAccessManager();
|
||||||
token = "";
|
token = "";
|
||||||
loginStatus = false;
|
loginStatus = false; //should be false, true for testing request header
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QFile configFile(QDir::current().filePath("config.json"));
|
QFile configFile(QDir::current().filePath("config.json"));
|
||||||
|
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("config.json");
|
||||||
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("config.json");
|
QCoreApplication::exit(-1);
|
||||||
QCoreApplication::exit(-1);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
this->config = QJsonDocument::fromJson(configFile.readAll());
|
||||||
|
QObject::connect(manager, &QNetworkAccessManager::sslErrors, this, &RequestManager::onSSLError);
|
||||||
this->config = QJsonDocument::fromJson(configFile.readAll());
|
}
|
||||||
QObject::connect(manager, &QNetworkAccessManager::sslErrors, this, &RequestManager::onSSLError);
|
|
||||||
}
|
void RequestManager::login(QString host, QString username, QString password)
|
||||||
|
{
|
||||||
void RequestManager::login(QString host, QString username, QString password)
|
QNetworkRequest request;
|
||||||
{
|
QString hash = encryptedPassword(password);
|
||||||
QNetworkRequest request;
|
authHeader = getLoginHeader(username, hash);
|
||||||
QString hash = encryptedPassword(password);
|
QJsonObject reqBody = {
|
||||||
authHeader = getLoginHeader(username, hash);
|
{"password", hash},
|
||||||
QJsonObject reqBody = {
|
{"username", username}
|
||||||
{"password", hash},
|
};
|
||||||
{"username", username}
|
this->host = host;
|
||||||
};
|
|
||||||
this->host = host;
|
request.setUrl(host + "/AaaManager/authSession");
|
||||||
|
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
||||||
request.setUrl(host + "/AaaManager/authSession");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json; charset=UTF-8");
|
||||||
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
QJsonDocument jsonDocument;
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json; charset=UTF-8");
|
|
||||||
QJsonDocument jsonDocument;
|
jsonDocument.setObject(reqBody);
|
||||||
jsonDocument.setObject(reqBody);
|
QNetworkReply* reply = manager->post(request, jsonDocument.toJson());
|
||||||
QNetworkReply* reply = manager->post(request, jsonDocument.toJson());
|
QObject::connect(reply, &QNetworkReply::finished, [=]() {
|
||||||
QObject::connect(reply, &QNetworkReply::finished, [=]() {
|
if (reply->error())
|
||||||
if (reply->error())
|
{
|
||||||
{
|
qDebug() << reply->errorString();
|
||||||
qDebug() << reply->errorString();
|
loginStatus = false;
|
||||||
loginStatus = false;
|
return;
|
||||||
return;
|
}
|
||||||
}
|
jsonResponse = reply->readAll();
|
||||||
jsonResponse = reply->readAll();
|
prepareAuthHeader();
|
||||||
prepareAuthHeader();
|
loginStatus = true;
|
||||||
loginStatus = true;
|
emit successLogin();
|
||||||
emit successLogin();
|
reply->deleteLater();
|
||||||
reply->deleteLater();
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
void RequestManager::getRequest(QString endpoint)
|
||||||
void RequestManager::getRequest(QString endpoint)
|
{
|
||||||
{
|
if (!loginStatus)
|
||||||
if (!loginStatus)
|
{
|
||||||
{
|
login(config.object()["host"].toString(), config.object()["username"].toString(), config.object()["password"].toString());
|
||||||
login(config.object()["host"].toString(), config.object()["username"].toString(), config.object()["password"].toString());
|
QEventLoop loop;
|
||||||
QEventLoop loop;
|
QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
|
||||||
QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
|
loop.exec();
|
||||||
loop.exec();
|
}
|
||||||
}
|
|
||||||
QNetworkRequest request;
|
//
|
||||||
request.setUrl(host + endpoint);
|
host = config.object()["host"].toString();
|
||||||
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
//
|
||||||
QNetworkReply* reply = manager->post(request, QByteArray());
|
|
||||||
QObject::connect(reply, &QNetworkReply::finished, [=]() {
|
QNetworkRequest request;
|
||||||
if (reply->error())
|
request.setUrl(host + endpoint);
|
||||||
{
|
qDebug() << authHeader;
|
||||||
qDebug() << reply->errorString();
|
request.setRawHeader("Authorization", authHeader.toLocal8Bit());
|
||||||
qDebug() << reply->readAll();
|
//request.setRawHeader("User-Agent", "curl/7.65.3");
|
||||||
loginStatus = false;
|
QNetworkReply* reply = manager->post(request, QByteArray());
|
||||||
getRequest(endpoint);
|
|
||||||
return;
|
//
|
||||||
}
|
//QEventLoop loop;
|
||||||
qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
//QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
|
||||||
jsonResponse = reply->readAll();
|
//loop.exec();
|
||||||
emit responseReady();
|
//
|
||||||
});
|
|
||||||
}
|
QObject::connect(reply, &QNetworkReply::finished, [=]() {
|
||||||
|
if (reply->error())
|
||||||
QString RequestManager::getFromJson(QString json, const QString &member)
|
{
|
||||||
{
|
qDebug() << reply->errorString();
|
||||||
QJsonParseError err;
|
qDebug() << reply->readAll();
|
||||||
QJsonDocument document = QJsonDocument::fromJson(json.toUtf8(),&err);
|
loginStatus = false;
|
||||||
if (err.error != 0)
|
getRequest(endpoint);
|
||||||
{
|
return;
|
||||||
qDebug() << err.errorString();
|
}
|
||||||
}
|
qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
||||||
return document.object().value(member).toString();
|
jsonResponse = reply->readAll();
|
||||||
}
|
emit responseReady();
|
||||||
|
});
|
||||||
QString RequestManager::encryptedPassword(QString password)
|
}
|
||||||
{
|
|
||||||
return QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha512).toHex().toUpper();
|
QString RequestManager::getFromJson(QString json, const QString &member)
|
||||||
}
|
{
|
||||||
|
QJsonParseError err;
|
||||||
QString RequestManager::getLoginHeader(QString username, QString hash)
|
QJsonDocument document = QJsonDocument::fromJson(json.toUtf8(),&err);
|
||||||
{
|
if (err.error != 0)
|
||||||
QString authValue = username + ":" + hash;
|
{
|
||||||
return "Basic " + authValue.toLocal8Bit().toBase64();
|
qDebug() << err.errorString();
|
||||||
}
|
}
|
||||||
|
return document.object().value(member).toString();
|
||||||
void RequestManager::prepareAuthHeader()
|
}
|
||||||
{
|
|
||||||
token = getFromJson(jsonResponse, "id");
|
QString RequestManager::encryptedPassword(QString password)
|
||||||
QString authValue = token + ":";
|
{
|
||||||
authHeader = "Basic" + authValue.toLocal8Bit().toBase64();
|
return QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha512).toHex().toUpper();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestManager::onSSLError(QNetworkReply *reply, const QList<QSslError> &errors)
|
QString RequestManager::getLoginHeader(QString username, QString hash)
|
||||||
{
|
{
|
||||||
qDebug() << "Network SSL errors";
|
QString authValue = username + ":" + hash;
|
||||||
for (const auto &error : errors)
|
return "Basic " + authValue.toLocal8Bit().toBase64();
|
||||||
{
|
}
|
||||||
if (error.error() == QSslError::SelfSignedCertificate)
|
|
||||||
reply->ignoreSslErrors(errors);
|
void RequestManager::prepareAuthHeader()
|
||||||
qDebug() << error.errorString();
|
{
|
||||||
}
|
token = getFromJson(jsonResponse, "id");
|
||||||
|
QString authValue = token + ":";
|
||||||
}
|
authHeader = "Basic" + authValue.toLocal8Bit().toBase64();
|
||||||
|
}
|
||||||
void RequestManager::getSubjects()
|
|
||||||
{
|
void RequestManager::onSSLError(QNetworkReply *reply, const QList<QSslError> &errors)
|
||||||
getRequest("/SubjectManager/getSubjects");
|
{
|
||||||
}
|
qDebug() << "Network SSL errors";
|
||||||
|
for (const auto &error : errors)
|
||||||
|
{
|
||||||
|
if (error.error() == QSslError::SelfSignedCertificate)
|
||||||
|
reply->ignoreSslErrors(errors);
|
||||||
|
qDebug() << error.errorString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RequestManager::getSubjects()
|
||||||
|
{
|
||||||
|
getRequest("/SubjectManager/getSubjects");
|
||||||
|
}
|
||||||
|
|||||||
@ -1,74 +1,74 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "Subject.h"
|
#include "subject.h"
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
|
||||||
QString Subject::getEmail() const {
|
QString Subject::getEmail() const {
|
||||||
return attributes["email"].toString();
|
return attributes["email"].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Subject::fromJSON(const QJsonObject &json) {
|
void Subject::fromJSON(const QJsonObject &json) {
|
||||||
Entity::fromJSON(json);
|
Entity::fromJSON(json);
|
||||||
|
|
||||||
attributes = json["attributes"]["items"].toObject();
|
attributes = json["attributes"]["items"].toObject();
|
||||||
|
|
||||||
attributes = json.value("attributes").toObject().value("items").toObject();
|
attributes = json.value("attributes").toObject().value("items").toObject();
|
||||||
|
|
||||||
const auto &tokenFlagsArray = json.value("tokenFlags").toArray();
|
const auto &tokenFlagsArray = json.value("tokenFlags").toArray();
|
||||||
for(const auto &flag : tokenFlagsArray){
|
for(const auto &flag : tokenFlagsArray){
|
||||||
tokenFlags.insert(flag.toString());
|
tokenFlags.insert(flag.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
pin = json.value("pin").toString();
|
pin = json.value("pin").toString();
|
||||||
|
|
||||||
const auto &pinFlagsArray = json.value("pinFlags").toArray();
|
const auto &pinFlagsArray = json.value("pinFlags").toArray();
|
||||||
for(const auto &flag : pinFlagsArray){
|
for(const auto &flag : pinFlagsArray){
|
||||||
pinFlags.insert(flag.toString());
|
pinFlags.insert(flag.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject Subject::toJSON() const {
|
QJsonObject Subject::toJSON() const {
|
||||||
QJsonObject json = Entity::toJSON();
|
QJsonObject json = Entity::toJSON();
|
||||||
|
|
||||||
QJsonObject items({{"items", attributes}});
|
QJsonObject items({{"items", attributes}});
|
||||||
json.value("atributes") = items;
|
json.value("atributes") = items;
|
||||||
json.value("tokenFlags") = QJsonArray::fromStringList(tokenFlags.toList());
|
json.value("tokenFlags") = QJsonArray::fromStringList(tokenFlags.toList());
|
||||||
json.value("pin") = pin;
|
json.value("pin") = pin;
|
||||||
json.value("pinFlags") = QJsonArray::fromStringList(pinFlags.toList());
|
json.value("pinFlags") = QJsonArray::fromStringList(pinFlags.toList());
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QJsonObject &Subject::getAttributes() const {
|
const QJsonObject &Subject::getAttributes() const {
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Subject::setAttributes(const QJsonObject &attributes) {
|
void Subject::setAttributes(const QJsonObject &attributes) {
|
||||||
Subject::attributes = attributes;
|
Subject::attributes = attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QSet<QString> &Subject::getTokenFlags() const {
|
const QSet<QString> &Subject::getTokenFlags() const {
|
||||||
return tokenFlags;
|
return tokenFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Subject::setTokenFlags(const QSet<QString> &tokenFlags) {
|
void Subject::setTokenFlags(const QSet<QString> &tokenFlags) {
|
||||||
Subject::tokenFlags = tokenFlags;
|
Subject::tokenFlags = tokenFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &Subject::getPin() const {
|
const QString &Subject::getPin() const {
|
||||||
return pin;
|
return pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Subject::setPin(const QString &pin) {
|
void Subject::setPin(const QString &pin) {
|
||||||
Subject::pin = pin;
|
Subject::pin = pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QSet<QString> &Subject::getPinFlags() const {
|
const QSet<QString> &Subject::getPinFlags() const {
|
||||||
return pinFlags;
|
return pinFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Subject::setPinFlags(const QSet<QString> &pinFlags) {
|
void Subject::setPinFlags(const QSet<QString> &pinFlags) {
|
||||||
Subject::pinFlags = pinFlags;
|
Subject::pinFlags = pinFlags;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,123 +1,124 @@
|
|||||||
#include "unittest.h"
|
#include "unittest.h"
|
||||||
|
|
||||||
void UnitTest::loginSuccessfully()
|
void UnitTest::loginSuccessfully()
|
||||||
{
|
{
|
||||||
RequestManager* testAccess = new RequestManager();
|
RequestManager* testAccess = new RequestManager();
|
||||||
QJsonDocument config = testAccess->getConfig();
|
QJsonDocument config = testAccess->getConfig();
|
||||||
QSignalSpy spy(testAccess, SIGNAL(successLogin()));
|
QSignalSpy spy(testAccess, SIGNAL(successLogin()));
|
||||||
testAccess->login(host, email, password);
|
testAccess->login(host, email, password);
|
||||||
spy.wait();
|
spy.wait();
|
||||||
QVERIFY(spy.isValid());
|
QVERIFY(spy.isValid());
|
||||||
QCOMPARE(spy.count(), 1);
|
QCOMPARE(spy.count(), 1);
|
||||||
QString json = testAccess->getResponse();
|
QString json = testAccess->getResponse();
|
||||||
qDebug() << json;
|
qDebug() << json;
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||||
QVERIFY2(doc.object().value("id").isString(), "No parameter 'id' in response");
|
QVERIFY2(doc.object().value("id").isString(), "No parameter 'id' in response");
|
||||||
}
|
}
|
||||||
|
|
||||||
//POST request w/o datas
|
//POST request w/o datas
|
||||||
void UnitTest::getSubjects()
|
void UnitTest::getSubjects()
|
||||||
{
|
{
|
||||||
RequestManager* testAccess = new RequestManager();
|
RequestManager* testAccess = new RequestManager();
|
||||||
// testAccess->login(host, email, password);
|
// testAccess->login(host, email, password);
|
||||||
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
||||||
testAccess->getRequest("/SubjectManager/getSubjects");
|
testAccess->getRequest("/SubjectManager/getSubjects");
|
||||||
spy.wait();
|
spy.wait();
|
||||||
QVERIFY(spy.isValid());
|
QVERIFY(spy.isValid());
|
||||||
QCOMPARE(spy.count(), 1);
|
QCOMPARE(spy.count(), 1);
|
||||||
QString json = testAccess->getResponse();
|
QString json = testAccess->getResponse();
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
qDebug() << json;
|
||||||
QVERIFY(doc.isObject());
|
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||||
QVERIFY2(doc.object().value("items").isArray(), "No parameter 'id' in response");
|
QVERIFY(doc.isObject());
|
||||||
qDebug() << doc.object().value("items").toArray()[0].toObject()["id"].toString();
|
QVERIFY2(doc.object().value("items").isArray(), "No parameter 'id' in response");
|
||||||
QVERIFY2(doc.object().value("items").toArray()[0].toObject()["id"].isString(), "ada");
|
qDebug() << doc.object().value("items").toArray()[0].toObject()["id"].toString();
|
||||||
|
QVERIFY2(doc.object().value("items").toArray()[0].toObject()["id"].isString(), "ada");
|
||||||
}
|
|
||||||
|
}
|
||||||
void UnitTest::getTokens()
|
|
||||||
{
|
void UnitTest::getTokens()
|
||||||
RequestManager* testAccess = new RequestManager();
|
{
|
||||||
// testAccess->login(host, email, password);
|
RequestManager* testAccess = new RequestManager();
|
||||||
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
// testAccess->login(host, email, password);
|
||||||
testAccess->getRequest("/TokenManager/getTokens");
|
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
||||||
QCOMPARE(spy.count(), 0);
|
testAccess->getRequest("/TokenManager/getTokens");
|
||||||
spy.wait();
|
QCOMPARE(spy.count(), 0);
|
||||||
QVERIFY(spy.isValid());
|
spy.wait();
|
||||||
QCOMPARE(spy.count(), 1);
|
QVERIFY(spy.isValid());
|
||||||
qDebug() << testAccess->getResponse();
|
QCOMPARE(spy.count(), 1);
|
||||||
}
|
qDebug() << testAccess->getResponse();
|
||||||
|
}
|
||||||
void UnitTest::getTokensOpenManager()
|
|
||||||
{
|
void UnitTest::getTokensOpenManager()
|
||||||
RequestManager* testAccess = new RequestManager();
|
{
|
||||||
// testAccess->login(host, email, password);
|
RequestManager* testAccess = new RequestManager();
|
||||||
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
// testAccess->login(host, email, password);
|
||||||
testAccess->getRequest("/OpenManager/getTokenSubject");
|
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
||||||
QCOMPARE(spy.count(), 0);
|
testAccess->getRequest("/OpenManager/getTokenSubject");
|
||||||
spy.wait();
|
QCOMPARE(spy.count(), 0);
|
||||||
QVERIFY(spy.isValid());
|
spy.wait();
|
||||||
QCOMPARE(spy.count(), 1);
|
QVERIFY(spy.isValid());
|
||||||
QString response = testAccess->getResponse();
|
QCOMPARE(spy.count(), 1);
|
||||||
qDebug() << response;
|
QString response = testAccess->getResponse();
|
||||||
QVERIFY(!response.isEmpty());
|
qDebug() << response;
|
||||||
}
|
QVERIFY(!response.isEmpty());
|
||||||
|
}
|
||||||
void UnitTest::subjectJSONParser()
|
|
||||||
{
|
void UnitTest::subjectJSONParser()
|
||||||
/*
|
{
|
||||||
QFile jsonData(QDir::current().filePath("subjects.json"));
|
/*
|
||||||
|
QFile jsonData(QDir::current().filePath("subjects.json"));
|
||||||
if (!jsonData.open(QIODevice::ReadOnly)) {
|
|
||||||
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("subjects.json");
|
if (!jsonData.open(QIODevice::ReadOnly)) {
|
||||||
QCoreApplication::exit(-1);
|
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("subjects.json");
|
||||||
return;
|
QCoreApplication::exit(-1);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(jsonData.readAll());
|
|
||||||
QJsonObject obj = doc.object();
|
QJsonDocument doc = QJsonDocument::fromJson(jsonData.readAll());
|
||||||
QJsonArray arr = obj["items"].toArray();
|
QJsonObject obj = doc.object();
|
||||||
*/
|
QJsonArray arr = obj["items"].toArray();
|
||||||
|
*/
|
||||||
RequestManager* testAccess = new RequestManager();
|
|
||||||
// testAccess->login(host, email, password);
|
RequestManager* testAccess = new RequestManager();
|
||||||
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
// testAccess->login(host, email, password);
|
||||||
testAccess->getRequest("/SubjectManager/getSubjects");
|
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
||||||
spy.wait();
|
testAccess->getRequest("/SubjectManager/getSubjects");
|
||||||
QString response = testAccess->getResponse();
|
spy.wait();
|
||||||
QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
|
QString response = testAccess->getResponse();
|
||||||
QJsonArray arr = doc.object()["items"].toArray();
|
QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
|
||||||
auto testSubject = new Subject();
|
QJsonArray arr = doc.object()["items"].toArray();
|
||||||
testSubject->fromJSON(arr[1].toObject());
|
auto testSubject = new Subject();
|
||||||
qDebug() << testSubject->getName() << " Size: " << arr.size();
|
testSubject->fromJSON(arr[1].toObject());
|
||||||
QVERIFY(!testSubject->getName().isEmpty());
|
qDebug() << testSubject->getName() << " Size: " << arr.size();
|
||||||
}
|
QVERIFY(!testSubject->getName().isEmpty());
|
||||||
|
}
|
||||||
void UnitTest::tokenJSONParser()
|
|
||||||
{
|
void UnitTest::tokenJSONParser()
|
||||||
RequestManager* testAccess = new RequestManager();
|
{
|
||||||
// testAccess->login(host, email, password);
|
RequestManager* testAccess = new RequestManager();
|
||||||
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
// testAccess->login(host, email, password);
|
||||||
testAccess->getRequest("/TokenManager/getTokens");
|
QSignalSpy spy(testAccess, SIGNAL(responseReady()));
|
||||||
spy.wait();
|
testAccess->getRequest("/TokenManager/getTokens");
|
||||||
QString response = testAccess->getResponse();
|
spy.wait();
|
||||||
|
QString response = testAccess->getResponse();
|
||||||
//TODO
|
|
||||||
/* QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
|
//TODO
|
||||||
QJsonArray arr = doc.object()["items"].toArray();
|
/* QJsonDocument doc = QJsonDocument::fromJson(response.toUtf8());
|
||||||
auto testSubject = new Subject();
|
QJsonArray arr = doc.object()["items"].toArray();
|
||||||
testSubject->fromJSON(arr[1].toObject());
|
auto testSubject = new Subject();
|
||||||
qDebug() << testSubject->getName();
|
testSubject->fromJSON(arr[1].toObject());
|
||||||
QVERIFY(!testSubject->getName().isEmpty());*/
|
qDebug() << testSubject->getName();
|
||||||
QVERIFY(true);
|
QVERIFY(!testSubject->getName().isEmpty());*/
|
||||||
|
QVERIFY(true);
|
||||||
}
|
|
||||||
|
}
|
||||||
void UnitTest::connectToDB()
|
|
||||||
{
|
void UnitTest::connectToDB()
|
||||||
DatabaseManager *db = new DatabaseManager("192.168.1.94", "deloitte", "postgres", "34rjkciea12");
|
{
|
||||||
QVERIFY(db->getOpened());
|
DatabaseManager *db = new DatabaseManager("192.168.1.94", "deloitte", "postgres", "34rjkciea12");
|
||||||
QVERIFY(true);
|
QVERIFY(db->getOpened());
|
||||||
|
QVERIFY(true);
|
||||||
}
|
|
||||||
|
}
|
||||||
QTEST_MAIN(UnitTest)
|
|
||||||
|
QTEST_MAIN(UnitTest)
|
||||||
|
|||||||
5
test/unitTests/config.json
Normal file
5
test/unitTests/config.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"host": "https://192.168.1.3:8443",
|
||||||
|
"username": "spaceti",
|
||||||
|
"password": "spaceti1"
|
||||||
|
}
|
||||||
@ -1,29 +1,29 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <requestmanager.h>
|
#include <requestmanager.h>
|
||||||
#include "subject.h"
|
#include "subject.h"
|
||||||
#include "databasemanager.h"
|
#include "databasemanager.h"
|
||||||
|
|
||||||
|
|
||||||
class UnitTest : public QObject
|
class UnitTest : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void loginSuccessfully(); // /AaaManager/authSession
|
void loginSuccessfully(); // /AaaManager/authSession
|
||||||
void getSubjects(); // /SubjectManager/getSubjects
|
void getSubjects(); // /SubjectManager/getSubjects
|
||||||
void getTokens(); // /TokenManager/getTokens
|
void getTokens(); // /TokenManager/getTokens
|
||||||
void getTokensOpenManager(); // /OpenManager/getTokenSubject
|
void getTokensOpenManager(); // /OpenManager/getTokenSubject
|
||||||
void subjectJSONParser();
|
void subjectJSONParser();
|
||||||
void tokenJSONParser();
|
void tokenJSONParser();
|
||||||
void connectToDB();
|
void connectToDB();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// QString host = "https://localhost:8080"; //colnod server (ssh -L 8080:192.168.254.11:8443 penta-master)
|
//QString host = "http://localhost:8080"; //colnod server (ssh -L 8080:192.168.254.11:8443 penta-master)
|
||||||
QString host = "https://192.168.1.3:8443"; //local testing server
|
QString host = "https://192.168.1.3:8443"; //local testing server
|
||||||
QString password = "spaceti1";
|
QString password = "spaceti1";
|
||||||
QString email = "spaceti";
|
QString email = "spaceti";
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user