@itentialopensource/adapter-beyond_trust 0.1.1 → 0.2.1
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/.eslintignore +0 -1
- package/.jshintrc +3 -0
- package/AUTH.md +19 -17
- package/BROKER.md +31 -19
- package/CALLS.md +59 -22
- package/CHANGELOG.md +16 -1
- package/PROPERTIES.md +5 -0
- package/README.md +60 -63
- package/SYSTEMINFO.md +13 -3
- package/TAB1.md +7 -0
- package/TAB2.md +103 -2009
- package/compliance-report.json +9 -0
- package/compliance-report.txt +5 -0
- package/metadata.json +25 -5
- package/package.json +12 -14
- package/propertiesSchema.json +133 -36
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +4 -4
- package/sampleProperties.json +56 -48
- package/test/integration/adapterTestIntegration.js +1 -0
- package/test/unit/adapterTestUnit.js +12 -8
- package/utils/artifactize.js +0 -0
package/sampleProperties.json
CHANGED
|
@@ -16,26 +16,22 @@
|
|
|
16
16
|
"authentication": {
|
|
17
17
|
"auth_method": "request_token",
|
|
18
18
|
"username": "username",
|
|
19
|
-
"password": "
|
|
20
|
-
"token": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
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
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
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": "/
|
|
118
|
+
"path": "/not/mapped",
|
|
122
119
|
"method": "GET",
|
|
123
120
|
"query": {},
|
|
124
121
|
"body": {},
|
|
125
122
|
"headers": {},
|
|
126
|
-
"handleFailure": "
|
|
123
|
+
"handleFailure": "ignore",
|
|
127
124
|
"requestFields": {
|
|
128
|
-
"
|
|
125
|
+
"insample": "{port}"
|
|
129
126
|
},
|
|
130
127
|
"responseDatakey": "",
|
|
131
128
|
"responseFields": {
|
|
132
|
-
"name": "
|
|
133
|
-
"ostype": "
|
|
134
|
-
"ostypePrefix": "
|
|
135
|
-
"
|
|
136
|
-
"
|
|
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": "/
|
|
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": "
|
|
151
|
+
"handleFailure": "ignore",
|
|
154
152
|
"requestFields": {},
|
|
155
153
|
"responseDatakey": "",
|
|
156
154
|
"responseFields": {
|
|
157
|
-
"name": "
|
|
158
|
-
"ostype": "
|
|
159
|
-
"ostypePrefix": "
|
|
160
|
-
"
|
|
161
|
-
"
|
|
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": "/
|
|
167
|
+
"path": "/not/mapped/{devID}",
|
|
168
168
|
"method": "GET",
|
|
169
169
|
"query": {},
|
|
170
170
|
"body": {},
|
|
171
171
|
"headers": {},
|
|
172
|
-
"handleFailure": "
|
|
172
|
+
"handleFailure": "ignore",
|
|
173
173
|
"requestFields": {
|
|
174
|
-
"
|
|
174
|
+
"devID": "{id}"
|
|
175
175
|
},
|
|
176
176
|
"responseDatakey": "",
|
|
177
177
|
"responseFields": {
|
|
178
|
-
"status": "
|
|
179
|
-
"statusValue": "
|
|
178
|
+
"status": "return2xx",
|
|
179
|
+
"statusValue": "AD.200"
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
],
|
|
183
183
|
"getConfig": [
|
|
184
184
|
{
|
|
185
|
-
"path": "/
|
|
185
|
+
"path": "/not/mapped/{devID}",
|
|
186
186
|
"method": "GET",
|
|
187
187
|
"query": {},
|
|
188
188
|
"body": {},
|
|
189
189
|
"headers": {},
|
|
190
|
-
"handleFailure": "
|
|
190
|
+
"handleFailure": "ignore",
|
|
191
191
|
"requestFields": {
|
|
192
|
-
"
|
|
192
|
+
"devID": "{id}"
|
|
193
193
|
},
|
|
194
194
|
"responseDatakey": "",
|
|
195
195
|
"responseFields": {}
|
|
@@ -197,12 +197,12 @@
|
|
|
197
197
|
],
|
|
198
198
|
"getCount": [
|
|
199
199
|
{
|
|
200
|
-
"path": "/
|
|
200
|
+
"path": "/not/mapped",
|
|
201
201
|
"method": "GET",
|
|
202
202
|
"query": {},
|
|
203
203
|
"body": {},
|
|
204
204
|
"headers": {},
|
|
205
|
-
"handleFailure": "
|
|
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":
|
|
216
|
+
"entityType": "device",
|
|
217
|
+
"frequency": 3600,
|
|
218
218
|
"flushOnFail": false,
|
|
219
|
-
"limit":
|
|
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}`);
|
|
@@ -309,17 +314,16 @@ describe('[unit] Beyond_trust Adapter Test', () => {
|
|
|
309
314
|
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
310
315
|
assert.notEqual(null, packageDotJson.dependencies);
|
|
311
316
|
assert.notEqual('', packageDotJson.dependencies);
|
|
312
|
-
assert.equal('^8.
|
|
313
|
-
assert.equal('^1.
|
|
317
|
+
assert.equal('^8.17.1', packageDotJson.dependencies.ajv);
|
|
318
|
+
assert.equal('^1.7.2', packageDotJson.dependencies.axios);
|
|
314
319
|
assert.equal('^11.0.0', packageDotJson.dependencies.commander);
|
|
315
|
-
assert.equal('^11.
|
|
316
|
-
assert.equal('^10.
|
|
320
|
+
assert.equal('^11.2.0', packageDotJson.dependencies['fs-extra']);
|
|
321
|
+
assert.equal('^10.7.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
|
-
assert.equal('^7.
|
|
322
|
-
assert.equal('^3.
|
|
325
|
+
assert.equal('^7.6.3', packageDotJson.dependencies.semver);
|
|
326
|
+
assert.equal('^3.13.1', packageDotJson.dependencies.winston);
|
|
323
327
|
done();
|
|
324
328
|
} catch (error) {
|
|
325
329
|
log.error(`Test Failure: ${error}`);
|
package/utils/artifactize.js
CHANGED
|
File without changes
|