@itentialopensource/adapter-paragon_active_assurance 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ ## 0.1.2 [05-01-2023]
3
+
4
+ * Add multi step authentication
5
+
6
+ See merge request itentialopensource/adapters/telemetry-analytics/adapter-paragon_active_assurance!1
7
+
8
+ ---
9
+
2
10
  ## 0.1.1 [03-13-2023]
3
11
 
4
12
  * Bug fixes and performance improvements
@@ -6,4 +14,3 @@
6
14
  See commit ca41529
7
15
 
8
16
  ---
9
-
@@ -25,6 +25,46 @@
25
25
  }
26
26
  ]
27
27
  },
28
+ {
29
+ "name": "MFA_Step_1",
30
+ "protocol": "REST",
31
+ "method": "POST",
32
+ "entitypath": "{base_path}/{version}/iam/authenticate",
33
+ "requestSchema": "schemaTokenReq_MFA_Step_1.json",
34
+ "responseSchema": "schemaTokenResp_MFA_Step_1.json",
35
+ "timeout": 0,
36
+ "sendEmpty": false,
37
+ "requestDatatype": "JSON",
38
+ "responseDatatype": "JSON",
39
+ "headers": {},
40
+ "responseObjects": [
41
+ {
42
+ "type": "default",
43
+ "key": "",
44
+ "mockFile": "mockdatafiles/MFA_Step_1-default.json"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "name": "MFA_Step_2",
50
+ "protocol": "REST",
51
+ "method": "POST",
52
+ "entitypath": "{base_path}/{version}/iam/authenticate",
53
+ "requestSchema": "schemaTokenReq_MFA_Step_2.json",
54
+ "responseSchema": "schemaTokenResp_MFA_Step_2.json",
55
+ "timeout": 0,
56
+ "sendEmpty": false,
57
+ "requestDatatype": "JSON",
58
+ "responseDatatype": "JSON",
59
+ "headers": {},
60
+ "responseObjects": [
61
+ {
62
+ "type": "default",
63
+ "key": "",
64
+ "mockFile": "mockdatafiles/MFA_Step_2-default.json"
65
+ }
66
+ ]
67
+ },
28
68
  {
29
69
  "name": "healthcheck",
30
70
  "protocol": "REST",
@@ -0,0 +1,31 @@
1
+ {
2
+ "status": "AUTHENTICATED",
3
+ "user_id": "string",
4
+ "id_token": "eyJh",
5
+ "token": {
6
+ "user_id": "string",
7
+ "user_name": "admin",
8
+ "iat": "string",
9
+ "exp": "string",
10
+ "unique_identifier": "string",
11
+ "identity_provider_type": "Local"
12
+ },
13
+ "scopes": [
14
+ {
15
+ "id": "string",
16
+ "name": "default",
17
+ "display_name": "default",
18
+ "type": "string"
19
+ },
20
+ {
21
+ "id": "string",
22
+ "name": "string",
23
+ "display_name": "string",
24
+ "type": "Tenant",
25
+ "parent_id": "string",
26
+ "parent_name": "default",
27
+ "parent_type": "string"
28
+ }
29
+ ],
30
+ "identity_provider_type": "Local"
31
+ }
@@ -0,0 +1,107 @@
1
+ {
2
+ "status": "AUTHENTICATED",
3
+ "user_id": "string",
4
+ "id_token": "eyJhbGc",
5
+ "token": {
6
+ "user_id": "string",
7
+ "user_name": "admin",
8
+ "iat": "string",
9
+ "exp": "string",
10
+ "roles": [
11
+ {
12
+ "id": "string",
13
+ "name": "string",
14
+ "type": "string",
15
+ "predefined": true
16
+ }
17
+ ],
18
+ "intents": [],
19
+ "scope": {
20
+ "id": "string",
21
+ "name": "default",
22
+ "type": "string",
23
+ "display_name": "default"
24
+ },
25
+ "capabilities": [
26
+ {
27
+ "service": "string",
28
+ "methods": []
29
+ },
30
+ {
31
+ "service": "string",
32
+ "methods": []
33
+ },
34
+ {
35
+ "service": "string",
36
+ "methods": []
37
+ },
38
+ {
39
+ "service": "string",
40
+ "methods": []
41
+ },
42
+ {
43
+ "service": "string",
44
+ "methods": []
45
+ },
46
+ {
47
+ "service": "string",
48
+ "methods": []
49
+ },
50
+ {
51
+ "service": "string",
52
+ "methods": []
53
+ },
54
+ {
55
+ "service": "string",
56
+ "methods": []
57
+ },
58
+ {
59
+ "service": "string",
60
+ "methods": []
61
+ },
62
+ {
63
+ "service": "string",
64
+ "methods": []
65
+ },
66
+ {
67
+ "service": "string",
68
+ "methods": []
69
+ },
70
+ {
71
+ "service": "string",
72
+ "methods": []
73
+ },
74
+ {
75
+ "service": "string",
76
+ "methods": []
77
+ },
78
+ {
79
+ "service": "string",
80
+ "methods": []
81
+ },
82
+ {
83
+ "service": "string",
84
+ "methods": []
85
+ },
86
+ {
87
+ "service": "string",
88
+ "methods": []
89
+ },
90
+ {
91
+ "service": "string",
92
+ "methods": []
93
+ },
94
+ {
95
+ "service": "string",
96
+ "methods": []
97
+ },
98
+ {
99
+ "service": "string",
100
+ "methods": []
101
+ }
102
+ ],
103
+ "unique_identifier": "string",
104
+ "identity_provider_type": "Local"
105
+ },
106
+ "identity_provider_type": "Local"
107
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$id": ".system-schemaTokenReq_MFA_Step_1.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": true,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "MFA_Step_1",
12
+ "enum": [
13
+ "MFA_Step_1"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ }
17
+ },
18
+ "definitions": {}
19
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$id": ".system-schemaTokenReq_MFA_Step_2.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": true,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "MFA_Step_2",
12
+ "enum": [
13
+ "MFA_Step_2"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ },
17
+ "scopeId": {
18
+ "type": "string",
19
+ "description": "scopeId",
20
+ "external_name": "scope_id"
21
+ }
22
+ },
23
+ "definitions": {}
24
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$id": ".system-schemaTokenResp_MFA_Step_1.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": false,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "MFA_Step_1",
12
+ "enum": [
13
+ "MFA_Step_1"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ },
17
+ "token": {
18
+ "description": "token returned by system",
19
+ "parse": false,
20
+ "encode": false,
21
+ "placement": "BODY",
22
+ "external_name": "id_token"
23
+ },
24
+ "tokenp2": {
25
+ "description": "token returned by system",
26
+ "parse": false,
27
+ "encode": false,
28
+ "placement": "BODY",
29
+ "encrypt": {
30
+ "type": "AES",
31
+ "key": ""
32
+ },
33
+ "external_name": "scopes.0.id"
34
+ }
35
+
36
+ },
37
+ "definitions": {}
38
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$id": ".system-schemaTokenResp_MFA_Step_2.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": true,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "MFA_Step_2",
12
+ "enum": [
13
+ "MFA_Step_2"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ },
17
+ "token": {
18
+ "description": "token returned by system",
19
+ "parse": false,
20
+ "encode": false,
21
+ "placement": "BODY",
22
+ "external_name": "token"
23
+ },
24
+ "tokenp2": {
25
+ "description": "token returned by system",
26
+ "parse": false,
27
+ "encode": false,
28
+ "placement": "BODY",
29
+ "external_name": "id_token"
30
+ }
31
+ },
32
+ "definitions": {}
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-paragon_active_assurance",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "This adapter integrates with system described as: netroundsOrchestrationRestApi.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.15",
@@ -54,7 +54,7 @@
54
54
  "author": "Itential",
55
55
  "homepage": "https://gitlab.com/itentialopensource/adapters/telemetry-analytics/adapter-paragon_active_assurance#readme",
56
56
  "dependencies": {
57
- "@itentialopensource/adapter-utils": "^4.48.0",
57
+ "@itentialopensource/adapter-utils": "^4.48.13",
58
58
  "ajv": "^6.12.0",
59
59
  "axios": "^0.21.0",
60
60
  "commander": "^2.20.0",
@@ -122,7 +122,8 @@
122
122
  "static_token",
123
123
  "jwt_token",
124
124
  "request_token",
125
- "no_authentication"
125
+ "no_authentication",
126
+ "multi_step_authentication"
126
127
  ]
127
128
  },
128
129
  "username": {
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.0",
3
- "configLines": 11763,
2
+ "version": "0.1.1",
3
+ "configLines": 11764,
4
4
  "scriptLines": 1795,
5
5
  "codeLines": 13964,
6
- "testLines": 10748,
6
+ "testLines": 10749,
7
7
  "testCases": 542,
8
- "totalCodeLines": 26507,
8
+ "totalCodeLines": 26508,
9
9
  "wfTasks": 133
10
10
  }
@@ -13,15 +13,49 @@
13
13
  "stub": true,
14
14
  "protocol": "https",
15
15
  "authentication": {
16
- "auth_method": "static_token",
17
- "username": "username",
18
- "password": "password",
16
+ "auth_method": "multi_step_authentication",
17
+ "multiStepAuthCalls": [
18
+ {
19
+ "name": "getFirstToken",
20
+ "requestFields": {
21
+ "user": {
22
+ "domain": "",
23
+ "name": ""
24
+ },
25
+ "password": "",
26
+ "methods": [
27
+ "PASSWORD"
28
+ ]
29
+ },
30
+ "responseFields": {
31
+ "firstIdToken": "id_token",
32
+ "scopeId": "scopes.0.id"
33
+ },
34
+ "successfullResponseCode": 200
35
+ },
36
+ {
37
+ "name": "getSecondToken",
38
+ "requestFields": {
39
+ "token": "{getFirstToken.responseFields.firstIdToken}",
40
+ "scopeId": "{getFirstToken.responseFields.scopeId}",
41
+ "methods": [
42
+ "TOKEN"
43
+ ]
44
+ },
45
+ "responseFields": {
46
+ "tokenp2": "id_token"
47
+ },
48
+ "successfullResponseCode": 200
49
+ }
50
+ ],
51
+ "username": "admin",
52
+ "password": "pass",
19
53
  "token": "token",
20
54
  "token_timeout": 600000,
21
55
  "token_cache": "local",
22
56
  "invalid_token_error": 401,
23
- "auth_field": "header.headers.API-Token",
24
- "auth_field_format": "{token}",
57
+ "auth_field": "header.headers.x-iam-token",
58
+ "auth_field_format": "{tokenp2}",
25
59
  "auth_logging": false,
26
60
  "client_id": "",
27
61
  "client_secret": "",
@@ -831,9 +831,11 @@ describe('[unit] Adapter Base Test', () => {
831
831
  assert.equal('patchGenericNoBase', expectedCapabilities[0].actions[8]);
832
832
  assert.equal('deleteGenericNoBase', expectedCapabilities[0].actions[9]);
833
833
  assert.equal('.system', expectedCapabilities[1].entity);
834
- assert.equal(2, expectedCapabilities[1].actions.length);
834
+ assert.equal(4, expectedCapabilities[1].actions.length);
835
835
  assert.equal('getToken', expectedCapabilities[1].actions[0]);
836
- assert.equal('healthcheck', expectedCapabilities[1].actions[1]);
836
+ assert.equal('MFA_Step_1', expectedCapabilities[1].actions[1]);
837
+ assert.equal('MFA_Step_2', expectedCapabilities[1].actions[2]);
838
+ assert.equal('healthcheck', expectedCapabilities[1].actions[3]);
837
839
  for (let e = 1; e < expectedCapabilities.length; e += 1) {
838
840
  assert.notEqual('', expectedCapabilities[e].entity);
839
841
  assert.notEqual(null, expectedCapabilities[e].actions);