@itentialopensource/adapter-paragon_iam 0.2.4 → 0.3.0

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.
@@ -14,15 +14,15 @@
14
14
  "stub": true,
15
15
  "protocol": "https",
16
16
  "authentication": {
17
- "auth_method": "request_token",
18
- "username": "username",
19
- "password": "password",
17
+ "auth_method": "multi_step_authentication",
18
+ "username": "admin",
19
+ "password": "pass",
20
20
  "token": "token",
21
21
  "token_timeout": 1800000,
22
22
  "token_cache": "local",
23
23
  "invalid_token_error": 401,
24
24
  "auth_field": "header.headers.x-iam-token",
25
- "auth_field_format": "{token}",
25
+ "auth_field_format": "{tokenp2}",
26
26
  "auth_logging": false,
27
27
  "client_id": "",
28
28
  "client_secret": "",
@@ -35,9 +35,35 @@
35
35
  },
36
36
  "multiStepAuthCalls": [
37
37
  {
38
- "name": "",
39
- "requestFields": {},
40
- "responseFields": {},
38
+ "name": "getFirstToken",
39
+ "requestFields": {
40
+ "user": {
41
+ "domain": "",
42
+ "name": ""
43
+ },
44
+ "password": "",
45
+ "methods": [
46
+ "PASSWORD"
47
+ ]
48
+ },
49
+ "responseFields": {
50
+ "firstIdToken": "id_token",
51
+ "scopeId": "scopes.0.id"
52
+ },
53
+ "successfullResponseCode": 200
54
+ },
55
+ {
56
+ "name": "getSecondToken",
57
+ "requestFields": {
58
+ "token": "{getFirstToken.responseFields.firstIdToken}",
59
+ "scopeId": "{getFirstToken.responseFields.scopeId}",
60
+ "methods": [
61
+ "TOKEN"
62
+ ]
63
+ },
64
+ "responseFields": {
65
+ "tokenp2": "id_token"
66
+ },
41
67
  "successfullResponseCode": 200
42
68
  }
43
69
  ]
@@ -116,30 +142,32 @@
116
142
  }
117
143
  },
118
144
  "devicebroker": {
145
+ "enabled": false,
119
146
  "getDevice": [
120
147
  {
121
- "path": "/get/devices/{id}",
148
+ "path": "/not/mapped",
122
149
  "method": "GET",
123
150
  "query": {},
124
151
  "body": {},
125
152
  "headers": {},
126
153
  "handleFailure": "ignore",
127
154
  "requestFields": {
128
- "id": "name"
155
+ "insample": "{port}"
129
156
  },
130
157
  "responseDatakey": "",
131
158
  "responseFields": {
132
- "name": "host",
133
- "ostype": "os",
134
- "ostypePrefix": "system-",
135
- "ipaddress": "attributes.ipaddr",
136
- "port": "443"
159
+ "name": "{this}{||}{that}",
160
+ "ostype": "{osfield}",
161
+ "ostypePrefix": "meraki-",
162
+ "port": "{port}",
163
+ "ipaddress": "{ip_addr}",
164
+ "serial": "{serial}"
137
165
  }
138
166
  }
139
167
  ],
140
168
  "getDevicesFiltered": [
141
169
  {
142
- "path": "/get/devices",
170
+ "path": "/not/mapped",
143
171
  "method": "GET",
144
172
  "pagination": {
145
173
  "offsetVar": "",
@@ -154,42 +182,44 @@
154
182
  "requestFields": {},
155
183
  "responseDatakey": "",
156
184
  "responseFields": {
157
- "name": "host",
158
- "ostype": "os",
159
- "ostypePrefix": "system-",
160
- "ipaddress": "attributes.ipaddr",
161
- "port": "443"
185
+ "name": "{this}{||}{that}",
186
+ "ostype": "{osfield}",
187
+ "ostypePrefix": "meraki-",
188
+ "port": "{port}",
189
+ "ipaddress": "{ip_addr}",
190
+ "serial": "{serial}",
191
+ "id": "{myid}"
162
192
  }
163
193
  }
164
194
  ],
165
195
  "isAlive": [
166
196
  {
167
- "path": "/get/devices/{id}/status",
197
+ "path": "/not/mapped/{devID}",
168
198
  "method": "GET",
169
199
  "query": {},
170
200
  "body": {},
171
201
  "headers": {},
172
202
  "handleFailure": "ignore",
173
203
  "requestFields": {
174
- "id": "name"
204
+ "devID": "{id}"
175
205
  },
176
206
  "responseDatakey": "",
177
207
  "responseFields": {
178
- "status": "status",
179
- "statusValue": "online"
208
+ "status": "return2xx",
209
+ "statusValue": "AD.200"
180
210
  }
181
211
  }
182
212
  ],
183
213
  "getConfig": [
184
214
  {
185
- "path": "/get/devices/{id}/configPart1",
215
+ "path": "/not/mapped/{devID}",
186
216
  "method": "GET",
187
217
  "query": {},
188
218
  "body": {},
189
219
  "headers": {},
190
220
  "handleFailure": "ignore",
191
221
  "requestFields": {
192
- "id": "name"
222
+ "devID": "{id}"
193
223
  },
194
224
  "responseDatakey": "",
195
225
  "responseFields": {}
@@ -197,7 +227,7 @@
197
227
  ],
198
228
  "getCount": [
199
229
  {
200
- "path": "/get/devices",
230
+ "path": "/not/mapped",
201
231
  "method": "GET",
202
232
  "query": {},
203
233
  "body": {},
@@ -213,15 +243,15 @@
213
243
  "enabled": false,
214
244
  "entities": [
215
245
  {
216
- "entityType": "",
217
- "frequency": 1440,
246
+ "entityType": "device",
247
+ "frequency": 3600,
218
248
  "flushOnFail": false,
219
- "limit": 1000,
249
+ "limit": 10000,
220
250
  "retryAttempts": 5,
221
251
  "sort": true,
222
252
  "populate": [
223
253
  {
224
- "path": "",
254
+ "path": "/not/mapped",
225
255
  "method": "GET",
226
256
  "pagination": {
227
257
  "offsetVar": "",
@@ -235,7 +265,15 @@
235
265
  "handleFailure": "ignore",
236
266
  "requestFields": {},
237
267
  "responseDatakey": "",
238
- "responseFields": {}
268
+ "responseFields": {
269
+ "name": "{this}{||}{that}",
270
+ "ostype": "{osfield}",
271
+ "ostypePrefix": "meraki-",
272
+ "port": "{port}",
273
+ "ipaddress": "{ip_addr}",
274
+ "serial": "{serial}",
275
+ "id": "{myid}"
276
+ }
239
277
  }
240
278
  ],
241
279
  "cachedTasks": [
@@ -46,6 +46,7 @@ samProps.ssl.accept_invalid_cert = false;
46
46
  if (samProps.request.attempt_timeout < 30000) {
47
47
  samProps.request.attempt_timeout = 30000;
48
48
  }
49
+ samProps.devicebroker.enabled = true;
49
50
  const attemptTimeout = samProps.request.attempt_timeout;
50
51
  const { stub } = samProps;
51
52
 
@@ -284,7 +284,6 @@ describe('[unit] Paragon_iam Adapter Test', () => {
284
284
  assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
285
285
  assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
286
286
  assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
287
- assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
288
287
  assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
289
288
  assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
290
289
  assert.equal('npm run deploy', packageDotJson.scripts.build);
@@ -321,7 +320,6 @@ describe('[unit] Paragon_iam Adapter Test', () => {
321
320
  assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
322
321
  assert.equal('^10.3.0', packageDotJson.dependencies.mocha);
323
322
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
324
- assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
325
323
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
326
324
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
327
325
  assert.equal('^7.5.3', packageDotJson.dependencies.semver);