@itentialopensource/adapter-beyond_trust 0.1.1 → 0.2.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.
@@ -16,26 +16,22 @@
16
16
  "authentication": {
17
17
  "auth_method": "request_token",
18
18
  "username": "username",
19
- "password": "password",
20
- "token": "token",
21
- "token_timeout": 600000,
22
- "token_cache": "local",
19
+ "password": "paswword",
20
+ "token": "",
21
+ "token_user_field": "",
22
+ "token_password_field": "",
23
+ "token_result_field": "access_token",
24
+ "token_URI_path": "/oauth2/token",
23
25
  "invalid_token_error": 401,
24
- "auth_field": "header.headers.Authorization",
25
- "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
26
- "auth_logging": false,
27
- "client_id": "",
28
- "client_secret": "",
29
- "grant_type": "",
26
+ "token_timeout": -1,
27
+ "token_cache": "local",
28
+ "auth_field": "header.headers.Authentication",
29
+ "auth_field_format": "Bearer {token}",
30
+ "auth_logging": true,
31
+ "client_id": "client id",
32
+ "client_secret": "client secret",
33
+ "grant_type": "client credentials",
30
34
  "sensitive": [],
31
- "multiStepAuthCalls": [
32
- {
33
- "name": "",
34
- "requestFields": {},
35
- "responseFields": {},
36
- "successfullResponseCode": 200
37
- }
38
- ],
39
35
  "sso": {
40
36
  "protocol": "",
41
37
  "host": "",
@@ -116,30 +112,32 @@
116
112
  }
117
113
  },
118
114
  "devicebroker": {
115
+ "enabled": false,
119
116
  "getDevice": [
120
117
  {
121
- "path": "/get/devices/{id}",
118
+ "path": "/not/mapped",
122
119
  "method": "GET",
123
120
  "query": {},
124
121
  "body": {},
125
122
  "headers": {},
126
- "handleFailure": "fail",
123
+ "handleFailure": "ignore",
127
124
  "requestFields": {
128
- "id": "name"
125
+ "insample": "{port}"
129
126
  },
130
127
  "responseDatakey": "",
131
128
  "responseFields": {
132
- "name": "host",
133
- "ostype": "os",
134
- "ostypePrefix": "system-",
135
- "ipaddress": "attributes.ipaddr",
136
- "port": "443"
129
+ "name": "{this}{||}{that}",
130
+ "ostype": "{osfield}",
131
+ "ostypePrefix": "meraki-",
132
+ "port": "{port}",
133
+ "ipaddress": "{ip_addr}",
134
+ "serial" : "{serial}"
137
135
  }
138
136
  }
139
137
  ],
140
138
  "getDevicesFiltered": [
141
139
  {
142
- "path": "/get/devices",
140
+ "path": "/not/mapped",
143
141
  "method": "GET",
144
142
  "pagination": {
145
143
  "offsetVar": "",
@@ -150,46 +148,48 @@
150
148
  "query": {},
151
149
  "body": {},
152
150
  "headers": {},
153
- "handleFailure": "fail",
151
+ "handleFailure": "ignore",
154
152
  "requestFields": {},
155
153
  "responseDatakey": "",
156
154
  "responseFields": {
157
- "name": "host",
158
- "ostype": "os",
159
- "ostypePrefix": "system-",
160
- "ipaddress": "attributes.ipaddr",
161
- "port": "443"
155
+ "name": "{this}{||}{that}",
156
+ "ostype": "{osfield}",
157
+ "ostypePrefix": "meraki-",
158
+ "port": "{port}",
159
+ "ipaddress": "{ip_addr}",
160
+ "serial" : "{serial}",
161
+ "id": "{myid}"
162
162
  }
163
163
  }
164
164
  ],
165
165
  "isAlive": [
166
166
  {
167
- "path": "/get/devices/{id}/status",
167
+ "path": "/not/mapped/{devID}",
168
168
  "method": "GET",
169
169
  "query": {},
170
170
  "body": {},
171
171
  "headers": {},
172
- "handleFailure": "fail",
172
+ "handleFailure": "ignore",
173
173
  "requestFields": {
174
- "id": "name"
174
+ "devID": "{id}"
175
175
  },
176
176
  "responseDatakey": "",
177
177
  "responseFields": {
178
- "status": "status",
179
- "statusValue": "online"
178
+ "status": "return2xx",
179
+ "statusValue": "AD.200"
180
180
  }
181
181
  }
182
182
  ],
183
183
  "getConfig": [
184
184
  {
185
- "path": "/get/devices/{id}/configPart1",
185
+ "path": "/not/mapped/{devID}",
186
186
  "method": "GET",
187
187
  "query": {},
188
188
  "body": {},
189
189
  "headers": {},
190
- "handleFailure": "fail",
190
+ "handleFailure": "ignore",
191
191
  "requestFields": {
192
- "id": "name"
192
+ "devID": "{id}"
193
193
  },
194
194
  "responseDatakey": "",
195
195
  "responseFields": {}
@@ -197,12 +197,12 @@
197
197
  ],
198
198
  "getCount": [
199
199
  {
200
- "path": "/get/devices",
200
+ "path": "/not/mapped",
201
201
  "method": "GET",
202
202
  "query": {},
203
203
  "body": {},
204
204
  "headers": {},
205
- "handleFailure": "fail",
205
+ "handleFailure": "ignore",
206
206
  "requestFields": {},
207
207
  "responseDatakey": "",
208
208
  "responseFields": {}
@@ -213,15 +213,15 @@
213
213
  "enabled": false,
214
214
  "entities": [
215
215
  {
216
- "entityType": "",
217
- "frequency": 1440,
216
+ "entityType": "device",
217
+ "frequency": 3600,
218
218
  "flushOnFail": false,
219
- "limit": 1000,
219
+ "limit": 10000,
220
220
  "retryAttempts": 5,
221
221
  "sort": true,
222
222
  "populate": [
223
223
  {
224
- "path": "",
224
+ "path": "/not/mapped",
225
225
  "method": "GET",
226
226
  "pagination": {
227
227
  "offsetVar": "",
@@ -235,7 +235,15 @@
235
235
  "handleFailure": "ignore",
236
236
  "requestFields": {},
237
237
  "responseDatakey": "",
238
- "responseFields": {}
238
+ "responseFields": {
239
+ "name": "{this}{||}{that}",
240
+ "ostype": "{osfield}",
241
+ "ostypePrefix": "meraki-",
242
+ "port": "{port}",
243
+ "ipaddress": "{ip_addr}",
244
+ "serial" : "{serial}",
245
+ "id": "{myid}"
246
+ }
239
247
  }
240
248
  ],
241
249
  "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
 
@@ -278,13 +278,15 @@ describe('[unit] Beyond_trust Adapter Test', () => {
278
278
  assert.notEqual(undefined, packageDotJson.scripts);
279
279
  assert.notEqual(null, packageDotJson.scripts);
280
280
  assert.notEqual('', packageDotJson.scripts);
281
+ assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
281
282
  assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
282
283
  assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
283
284
  assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
284
285
  assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
285
286
  assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
286
- assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
287
287
  assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
288
+ assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
289
+ assert.equal('npm run deploy', packageDotJson.scripts.build);
288
290
  done();
289
291
  } catch (error) {
290
292
  log.error(`Test Failure: ${error}`);
@@ -297,6 +299,9 @@ describe('[unit] Beyond_trust Adapter Test', () => {
297
299
  assert.notEqual(undefined, packageDotJson.repository);
298
300
  assert.notEqual(null, packageDotJson.repository);
299
301
  assert.notEqual('', packageDotJson.repository);
302
+ assert.equal('git', packageDotJson.repository.type);
303
+ assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
304
+ assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
300
305
  done();
301
306
  } catch (error) {
302
307
  log.error(`Test Failure: ${error}`);
@@ -310,12 +315,11 @@ describe('[unit] Beyond_trust Adapter Test', () => {
310
315
  assert.notEqual(null, packageDotJson.dependencies);
311
316
  assert.notEqual('', packageDotJson.dependencies);
312
317
  assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
313
- assert.equal('^1.4.0', packageDotJson.dependencies.axios);
318
+ assert.equal('^1.6.8', packageDotJson.dependencies.axios);
314
319
  assert.equal('^11.0.0', packageDotJson.dependencies.commander);
315
320
  assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
316
- assert.equal('^10.2.0', packageDotJson.dependencies.mocha);
321
+ assert.equal('^10.3.0', packageDotJson.dependencies.mocha);
317
322
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
318
- assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
319
323
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
320
324
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
321
325
  assert.equal('^7.5.3', packageDotJson.dependencies.semver);
File without changes