@itentialopensource/adapter-aruba_central 2.2.4 → 2.2.6

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/AUTH.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Authenticating Aruba Central Adapter
2
2
 
3
- This document will go through the steps for authenticating the Aruba Central adapter with Static Token Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
3
+ This document will go through the steps for authenticating the Aruba Central adapter with Static Token Authentication and Multi Step Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
4
4
 
5
5
  Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
6
6
 
@@ -24,6 +24,85 @@ you can leave all of the other properties in the authentication section, they wi
24
24
 
25
25
  4. Restart the adapter. If your properties were set correctly, the adapter should go online.
26
26
 
27
+ ### Multi Step Authentication
28
+ The Aruba Central adapter also supports Multi Step Authentication. You can read more about Aruba Central OAuth <a href="https://developer.arubanetworks.com/hpe-aruba-networking-central/docs/api-oauth-access-token" target="_blank">here</a>. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
29
+
30
+ STEPS
31
+ 1. Ensure you have access to a Aruba Central server and that it is running
32
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
33
+ 3. Use the properties below for the ```properties.authentication``` field
34
+ ```json
35
+ "authentication": {
36
+ "auth_method": "multi_step_authentication",
37
+ "multiStepAuthCalls": [
38
+ {
39
+ "name": "getFirstToken",
40
+ "requestFields": {
41
+ "query.client_id": "<your_client_id>",
42
+ "username": "<your_username>",
43
+ "password": "<your_password>"
44
+ },
45
+ "responseFields": {
46
+ "csrftoken": "set-cookie.csrftoken",
47
+ "session": "set-cookie.session"
48
+ },
49
+ "successfullResponseCode": 200
50
+ },
51
+ {
52
+ "name": "getSecondToken",
53
+ "requestFields": {
54
+ "query.client_id": "<your_client_id>",
55
+ "query.response_type": "code",
56
+ "query.scope": "all",
57
+ "header.Cookie": "session={getFirstToken.responseFields.session}",
58
+ "header.X-CSRF-Token": "{getFirstToken.responseFields.csrftoken}",
59
+ "customer_id": "<your_customer_id>"
60
+ },
61
+ "responseFields": {
62
+ "authCode": "auth_code"
63
+ },
64
+ "successfullResponseCode": 200
65
+ },
66
+ {
67
+ "name": "getThirdToken",
68
+ "requestFields": {
69
+ "client_id": "<your_client_id>",
70
+ "client_secret": "<your_client_secret>",
71
+ "grant_type": "authorization_code",
72
+ "code": "{getSecondToken.responseFields.authCode}"
73
+ },
74
+ "responseFields": {
75
+ "token": "access_token"
76
+ },
77
+ "successfullResponseCode": 200
78
+ }
79
+ ],
80
+ "token_timeout": 100000,
81
+ "token_cache": "local",
82
+ "invalid_token_error": 401,
83
+ "auth_field": "header.headers.Authorization",
84
+ "auth_field_format": "Bearer {token}",
85
+ "auth_logging": true
86
+ }
87
+ ```
88
+
89
+ 4. Use the properties below for the ```properties.authentication.refresh_token_request``` field if you want to refresh the access token when it expires, instead of making multiple requests to obtain a new access token
90
+ ```json
91
+ "refresh_token_request": {
92
+ "requestFields": {
93
+ "query.client_id": "<your_client_id>",
94
+ "query.client_secret": "<your_client_secret>",
95
+ "query.grant_type": "refresh_token"
96
+ },
97
+ "refresh_token": {
98
+ "placement": "query",
99
+ "token_timeout": 1296000000
100
+ }
101
+ }
102
+ ```
103
+
104
+ 5. Restart the adapter. If your properties were set correctly, the adapter should go online.
105
+
27
106
  ### Troubleshooting
28
107
  - Make sure you copied over the correct token.
29
108
  - Turn on debug level logs for the adapter in IAP Admin Essentials.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 2.2.6 [10-15-2024]
3
+
4
+ * Changes made at 2024.10.14_19:49PM
5
+
6
+ See merge request itentialopensource/adapters/adapter-aruba_central!16
7
+
8
+ ---
9
+
10
+ ## 2.2.5 [10-08-2024]
11
+
12
+ * Add config for msa and refresh token
13
+
14
+ See merge request itentialopensource/adapters/adapter-aruba_central!14
15
+
16
+ ---
17
+
2
18
  ## 2.2.4 [08-23-2024]
3
19
 
4
20
  * update dependencies and metadata
package/TAB2.md CHANGED
@@ -11,7 +11,7 @@
11
11
  ## Specific Adapter Information
12
12
  ### Authentication
13
13
 
14
- This document will go through the steps for authenticating the Aruba Central adapter with Static Token Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
14
+ This document will go through the steps for authenticating the Aruba Central adapter with Static Token Authentication and Multi Step Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
15
 
16
16
  Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
17
17
 
@@ -35,6 +35,85 @@ you can leave all of the other properties in the authentication section, they wi
35
35
 
36
36
  4. Restart the adapter. If your properties were set correctly, the adapter should go online.
37
37
 
38
+ #### Multi Step Authentication
39
+ The Aruba Central adapter also supports Multi Step Authentication. You can read more about Aruba Central OAuth <a href="https://developer.arubanetworks.com/hpe-aruba-networking-central/docs/api-oauth-access-token" target="_blank">here</a>. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
40
+
41
+ STEPS
42
+ 1. Ensure you have access to a Aruba Central server and that it is running
43
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
44
+ 3. Use the properties below for the ```properties.authentication``` field
45
+ ```json
46
+ "authentication": {
47
+ "auth_method": "multi_step_authentication",
48
+ "multiStepAuthCalls": [
49
+ {
50
+ "name": "getFirstToken",
51
+ "requestFields": {
52
+ "query.client_id": "<your_client_id>",
53
+ "username": "<your_username>",
54
+ "password": "<your_password>"
55
+ },
56
+ "responseFields": {
57
+ "csrftoken": "set-cookie.csrftoken",
58
+ "session": "set-cookie.session"
59
+ },
60
+ "successfullResponseCode": 200
61
+ },
62
+ {
63
+ "name": "getSecondToken",
64
+ "requestFields": {
65
+ "query.client_id": "<your_client_id>",
66
+ "query.response_type": "code",
67
+ "query.scope": "all",
68
+ "header.Cookie": "session={getFirstToken.responseFields.session}",
69
+ "header.X-CSRF-Token": "{getFirstToken.responseFields.csrftoken}",
70
+ "customer_id": "<your_customer_id>"
71
+ },
72
+ "responseFields": {
73
+ "authCode": "auth_code"
74
+ },
75
+ "successfullResponseCode": 200
76
+ },
77
+ {
78
+ "name": "getThirdToken",
79
+ "requestFields": {
80
+ "client_id": "<your_client_id>",
81
+ "client_secret": "<your_client_secret>",
82
+ "grant_type": "authorization_code",
83
+ "code": "{getSecondToken.responseFields.authCode}"
84
+ },
85
+ "responseFields": {
86
+ "token": "access_token"
87
+ },
88
+ "successfullResponseCode": 200
89
+ }
90
+ ],
91
+ "token_timeout": 100000,
92
+ "token_cache": "local",
93
+ "invalid_token_error": 401,
94
+ "auth_field": "header.headers.Authorization",
95
+ "auth_field_format": "Bearer {token}",
96
+ "auth_logging": true
97
+ }
98
+ ```
99
+
100
+ 4. Use the properties below for the ```properties.authentication.refresh_token_request``` field if you want to refresh the access token when it expires, instead of making multiple requests to obtain a new access token
101
+ ```json
102
+ "refresh_token_request": {
103
+ "requestFields": {
104
+ "query.client_id": "<your_client_id>",
105
+ "query.client_secret": "<your_client_secret>",
106
+ "query.grant_type": "refresh_token"
107
+ },
108
+ "refresh_token": {
109
+ "placement": "query",
110
+ "token_timeout": 1296000000
111
+ }
112
+ }
113
+ ```
114
+
115
+ 5. Restart the adapter. If your properties were set correctly, the adapter should go online.
116
+
38
117
  #### Troubleshooting
39
118
  - Make sure you copied over the correct token.
40
119
  - Turn on debug level logs for the adapter in IAP Admin Essentials.
@@ -25,11 +25,96 @@
25
25
  }
26
26
  ]
27
27
  },
28
+ {
29
+ "name": "getRefreshToken",
30
+ "protocol": "REST",
31
+ "method": "POST",
32
+ "entitypath": "{base_path}/{version}/oauth2/token",
33
+ "requestSchema": "refreshTokenRequest.json",
34
+ "responseSchema": "schemaTokenResp_MFA_Step_3.json",
35
+ "timeout": 0,
36
+ "sendEmpty": false,
37
+ "requestDatatype": "URLENCODE",
38
+ "responseDatatype": "JSON",
39
+ "headers": {},
40
+ "sso": {
41
+ "protocol": "",
42
+ "host": "",
43
+ "port": 0
44
+ },
45
+ "responseObjects": [
46
+ {
47
+ "type": "default",
48
+ "key": "",
49
+ "mockFile": "mockdatafiles/getRefreshToken-default.json"
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "name": "MFA_Step_1",
55
+ "protocol": "REST",
56
+ "method": "POST",
57
+ "entitypath": "/oauth2/authorize/central/api/login",
58
+ "requestSchema": "schemaTokenReq_MFA_Step_1.json",
59
+ "responseSchema": "schemaTokenResp_MFA_Step_1.json",
60
+ "timeout": 0,
61
+ "sendEmpty": false,
62
+ "requestDatatype": "JSON",
63
+ "responseDatatype": "JSON",
64
+ "headers": {},
65
+ "responseObjects": [
66
+ {
67
+ "type": "default",
68
+ "key": "",
69
+ "mockFile": "mockdatafiles/MFA_Step_1-default.json"
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "name": "MFA_Step_2",
75
+ "protocol": "REST",
76
+ "method": "POST",
77
+ "entitypath": "/oauth2/authorize/central/api",
78
+ "requestSchema": "schemaTokenReq_MFA_Step_2.json",
79
+ "responseSchema": "schemaTokenResp_MFA_Step_2.json",
80
+ "timeout": 0,
81
+ "sendEmpty": false,
82
+ "requestDatatype": "JSON",
83
+ "responseDatatype": "JSON",
84
+ "headers": {},
85
+ "responseObjects": [
86
+ {
87
+ "type": "default",
88
+ "key": "",
89
+ "mockFile": "mockdatafiles/MFA_Step_2-default.json"
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "name": "MFA_Step_3",
95
+ "protocol": "REST",
96
+ "method": "POST",
97
+ "entitypath": "/oauth2/token",
98
+ "requestSchema": "schemaTokenReq_MFA_Step_3.json",
99
+ "responseSchema": "schemaTokenResp_MFA_Step_3.json",
100
+ "timeout": 0,
101
+ "sendEmpty": false,
102
+ "requestDatatype": "JSON",
103
+ "responseDatatype": "JSON",
104
+ "headers": {},
105
+ "responseObjects": [
106
+ {
107
+ "type": "default",
108
+ "key": "",
109
+ "mockFile": "mockdatafiles/MFA_Step_3-default.json"
110
+ }
111
+ ]
112
+ },
28
113
  {
29
114
  "name": "healthcheck",
30
115
  "protocol": "REST",
31
116
  "method": "GET",
32
- "entitypath": "{base_path}/{version}/healthcheck?{query}",
117
+ "entitypath": "{base_path}/{version}/monitoring/v2/networks?{query}",
33
118
  "requestSchema": "schema.json",
34
119
  "responseSchema": "schema.json",
35
120
  "timeout": 0,
@@ -0,0 +1,3 @@
1
+ {
2
+ "Set-Cookie": "csrftoken=csrf123;session=session123"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "auth_code": "authcode123"
3
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "refresh_token":"refreshtoken",
3
+ "token_type":"bearer",
4
+ "access_token":"accesstoken",
5
+ "expires_in":7200
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "refresh_token":"newrefreshtoken",
3
+ "token_type":"bearer",
4
+ "access_token":"newaccesstoken",
5
+ "expires_in":7200
6
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$id": "refreshTokenRequest.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": "getRefreshToken",
12
+ "enum": [
13
+ "getRefreshToken"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ },
17
+ "grant_type": {
18
+ "type": "string",
19
+ "description": "type of auth",
20
+ "parse": false,
21
+ "encode": false,
22
+ "encrypt": {
23
+ "type": "AES",
24
+ "key": ""
25
+ },
26
+ "external_name": "grant_type"
27
+ },
28
+ "client_secret": {
29
+ "type": "string",
30
+ "description": "secret used during login",
31
+ "parse": false,
32
+ "encode": false,
33
+ "encrypt": {
34
+ "type": "AES",
35
+ "key": ""
36
+ },
37
+ "external_name": "client_secret"
38
+ },
39
+ "client_id": {
40
+ "type": "string",
41
+ "description": "client application id",
42
+ "parse": false,
43
+ "encode": false,
44
+ "encrypt": {
45
+ "type": "AES",
46
+ "key": ""
47
+ },
48
+ "external_name": "client_id"
49
+ },
50
+ "refreshToken": {
51
+ "type": "string",
52
+ "description": "refresh token",
53
+ "parse": false,
54
+ "encode": false,
55
+ "encrypt": {
56
+ "type": "AES",
57
+ "key": ""
58
+ },
59
+ "external_name": "refresh_token"
60
+ }
61
+ },
62
+ "definitions": {}
63
+ }
@@ -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,19 @@
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
+ },
18
+ "definitions": {}
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$id": ".system-schemaTokenReq_MFA_Step_3.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_3",
12
+ "enum": [
13
+ "MFA_Step_3"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ }
17
+ },
18
+ "definitions": {}
19
+ }
@@ -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": 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
+ "token": {
18
+ "type": "string",
19
+ "description": "token returned by system",
20
+ "parse": false,
21
+ "encode": false,
22
+ "placement": "HEADER",
23
+ "encrypt": {
24
+ "type": "AES",
25
+ "key": ""
26
+ },
27
+ "external_name": "set-cookie.csrftoken"
28
+ },
29
+ "tokenp2": {
30
+ "description": "second token returned by system",
31
+ "parse": false,
32
+ "encode": false,
33
+ "placement": "HEADER",
34
+ "external_name": "set-cookie.session"
35
+ }
36
+ },
37
+ "definitions": {}
38
+ }
@@ -0,0 +1,26 @@
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": "auth_code"
23
+ }
24
+ },
25
+ "definitions": {}
26
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": ".system-schemaTokenResp_MFA_Step_3.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_3",
12
+ "enum": [
13
+ "MFA_Step_3",
14
+ "getRefreshToken"
15
+ ],
16
+ "external_name": "ph_request_type"
17
+ },
18
+ "token": {
19
+ "description": "token returned by system",
20
+ "parse": false,
21
+ "encode": false,
22
+ "placement": "BODY",
23
+ "external_name": "access_token"
24
+ },
25
+ "refreshToken": {
26
+ "type": "string",
27
+ "description": "refresh token returned by system",
28
+ "parse": false,
29
+ "encode": false,
30
+ "placement": "BODY",
31
+ "encrypt": {
32
+ "type": "AES",
33
+ "key": ""
34
+ },
35
+ "external_name": "refresh_token"
36
+ }
37
+ },
38
+ "definitions": {}
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-aruba_central",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "This adapter integrates with system described as: arubaCentralAllMethods.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
@@ -52,7 +52,7 @@
52
52
  "author": "Itential",
53
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-aruba_central#readme",
54
54
  "dependencies": {
55
- "@itentialopensource/adapter-utils": "^5.7.0",
55
+ "@itentialopensource/adapter-utils": "^5.9.4",
56
56
  "acorn": "^8.12.1",
57
57
  "ajv": "^8.17.1",
58
58
  "axios": "^1.7.4",
@@ -213,7 +213,7 @@
213
213
  "description": "How long a token is valid (in milliseconds), -1 (always get token), 0 use expiration returned with token",
214
214
  "default": -1,
215
215
  "minimum": -1,
216
- "maximum": 3600000
216
+ "maximum": 7200000
217
217
  },
218
218
  "token_cache": {
219
219
  "type": "string",
@@ -341,6 +341,29 @@
341
341
  }
342
342
  }
343
343
  }
344
+ },
345
+ "refresh_token_request": {
346
+ "type": "object",
347
+ "properties": {
348
+ "requestFields": {
349
+ "type": "object",
350
+ "description": "Params used in the refresh token call"
351
+ },
352
+ "refresh_token": {
353
+ "type": "object",
354
+ "description": "Refresh token fields",
355
+ "properties": {
356
+ "placement": {
357
+ "type": "string",
358
+ "description": "Where to place refresh token"
359
+ },
360
+ "token_timeout": {
361
+ "type": "integer",
362
+ "description": "How long a token is valid (in milliseconds)"
363
+ }
364
+ }
365
+ }
366
+ }
344
367
  }
345
368
  },
346
369
  "required": [
Binary file
@@ -1,9 +0,0 @@
1
- {
2
- "ComplianceEntries": [
3
- {
4
- "name": "Compliance Summary",
5
- "numInvalidProjects": 0,
6
- "numValidProjects": 0
7
- }
8
- ]
9
- }
@@ -1,5 +0,0 @@
1
- ---------------------------------------------------------------------------------------------
2
- **** Project Compliance Summary ****
3
- 0 project(s) are not valid
4
- 0 project(s) are valid
5
- ---------------------------------------------------------------------------------------------