@itentialopensource/adapter-okta 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.
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +9 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +223 -569
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +349 -58
- package/adapterBase.js +1021 -245
- package/entities/.generic/action.json +110 -5
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +17 -11
- package/pronghorn.json +642 -378
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +437 -1
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1654086669778.json +120 -0
- package/sampleProperties.json +94 -2
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +26 -103
- package/test/unit/adapterBaseTestUnit.js +34 -26
- package/test/unit/adapterTestUnit.js +219 -197
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +0 -0
- package/utils/basicGet.js +1 -14
- package/utils/entitiesToDB.js +179 -0
- package/utils/modify.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +3 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +43 -22
- package/utils/tbUtils.js +126 -29
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +2 -26
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint global-require: warn */
|
|
6
6
|
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
7
8
|
|
|
8
9
|
// include required items for testing & logging
|
|
9
10
|
const assert = require('assert');
|
|
@@ -18,22 +19,31 @@ const { use } = require('chai');
|
|
|
18
19
|
const td = require('testdouble');
|
|
19
20
|
|
|
20
21
|
const anything = td.matchers.anything();
|
|
21
|
-
|
|
22
|
-
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
22
|
let logLevel = 'none';
|
|
24
|
-
const stub = true;
|
|
25
23
|
const isRapidFail = false;
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
// read in the properties from the sampleProperties files
|
|
26
|
+
let adaptdir = __dirname;
|
|
27
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
28
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
29
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
31
|
+
}
|
|
32
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
27
33
|
|
|
28
34
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
35
|
// always check these in with bogus data!!!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
samProps.stub = true;
|
|
37
|
+
samProps.host = 'replace.hostorip.here';
|
|
38
|
+
samProps.authentication.username = 'username';
|
|
39
|
+
samProps.authentication.password = 'password';
|
|
40
|
+
samProps.protocol = 'http';
|
|
41
|
+
samProps.port = 80;
|
|
42
|
+
samProps.ssl.enabled = false;
|
|
43
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
44
|
+
samProps.request.attempt_timeout = 60000;
|
|
45
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
46
|
+
const { stub } = samProps;
|
|
37
47
|
|
|
38
48
|
// these are the adapter properties. You generally should not need to alter
|
|
39
49
|
// any of these after they are initially set up
|
|
@@ -45,99 +55,7 @@ global.pronghornProps = {
|
|
|
45
55
|
adapters: [{
|
|
46
56
|
id: 'Test-okta',
|
|
47
57
|
type: 'Okta',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '/',
|
|
52
|
-
version: '',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
encode_pathvars: true,
|
|
55
|
-
save_metric: false,
|
|
56
|
-
stub,
|
|
57
|
-
protocol,
|
|
58
|
-
authentication: {
|
|
59
|
-
auth_method: 'no_authentication',
|
|
60
|
-
username,
|
|
61
|
-
password,
|
|
62
|
-
token: '',
|
|
63
|
-
invalid_token_error: 401,
|
|
64
|
-
token_timeout: -1,
|
|
65
|
-
token_cache: 'local',
|
|
66
|
-
auth_field: 'header.headers.Authorization',
|
|
67
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
68
|
-
auth_logging: false
|
|
69
|
-
},
|
|
70
|
-
healthcheck: {
|
|
71
|
-
type: 'none',
|
|
72
|
-
frequency: 60000,
|
|
73
|
-
query_object: {}
|
|
74
|
-
},
|
|
75
|
-
throttle: {
|
|
76
|
-
throttle_enabled: false,
|
|
77
|
-
number_pronghorns: 1,
|
|
78
|
-
sync_async: 'sync',
|
|
79
|
-
max_in_queue: 1000,
|
|
80
|
-
concurrent_max: 1,
|
|
81
|
-
expire_timeout: 0,
|
|
82
|
-
avg_runtime: 200,
|
|
83
|
-
priorities: [
|
|
84
|
-
{
|
|
85
|
-
value: 0,
|
|
86
|
-
percent: 100
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
request: {
|
|
91
|
-
number_redirects: 0,
|
|
92
|
-
number_retries: 3,
|
|
93
|
-
limit_retry_error: [0],
|
|
94
|
-
failover_codes: [],
|
|
95
|
-
attempt_timeout: attemptTimeout,
|
|
96
|
-
global_request: {
|
|
97
|
-
payload: {},
|
|
98
|
-
uriOptions: {},
|
|
99
|
-
addlHeaders: {},
|
|
100
|
-
authData: {}
|
|
101
|
-
},
|
|
102
|
-
healthcheck_on_timeout: true,
|
|
103
|
-
return_raw: true,
|
|
104
|
-
archiving: false,
|
|
105
|
-
return_request: false
|
|
106
|
-
},
|
|
107
|
-
proxy: {
|
|
108
|
-
enabled: false,
|
|
109
|
-
host: '',
|
|
110
|
-
port: 1,
|
|
111
|
-
protocol: 'http',
|
|
112
|
-
username: '',
|
|
113
|
-
password: ''
|
|
114
|
-
},
|
|
115
|
-
ssl: {
|
|
116
|
-
ecdhCurve: '',
|
|
117
|
-
enabled: sslenable,
|
|
118
|
-
accept_invalid_cert: sslinvalid,
|
|
119
|
-
ca_file: '',
|
|
120
|
-
key_file: '',
|
|
121
|
-
cert_file: '',
|
|
122
|
-
secure_protocol: '',
|
|
123
|
-
ciphers: ''
|
|
124
|
-
},
|
|
125
|
-
mongo: {
|
|
126
|
-
host: '',
|
|
127
|
-
port: 0,
|
|
128
|
-
database: '',
|
|
129
|
-
username: '',
|
|
130
|
-
password: '',
|
|
131
|
-
replSet: '',
|
|
132
|
-
db_ssl: {
|
|
133
|
-
enabled: false,
|
|
134
|
-
accept_invalid_cert: false,
|
|
135
|
-
ca_file: '',
|
|
136
|
-
key_file: '',
|
|
137
|
-
cert_file: ''
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
58
|
+
properties: samProps
|
|
141
59
|
}]
|
|
142
60
|
}
|
|
143
61
|
};
|
|
@@ -268,10 +186,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
268
186
|
});
|
|
269
187
|
|
|
270
188
|
let wffunctions = [];
|
|
271
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
272
190
|
it('should retrieve workflow functions', (done) => {
|
|
273
191
|
try {
|
|
274
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
275
193
|
|
|
276
194
|
try {
|
|
277
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -353,6 +271,7 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
353
271
|
assert.notEqual(undefined, packageDotJson.scripts);
|
|
354
272
|
assert.notEqual(null, packageDotJson.scripts);
|
|
355
273
|
assert.notEqual('', packageDotJson.scripts);
|
|
274
|
+
assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
|
|
356
275
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
357
276
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
358
277
|
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
@@ -360,6 +279,8 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
360
279
|
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
361
280
|
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
362
281
|
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
282
|
+
assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
|
|
283
|
+
assert.equal('npm run deploy', packageDotJson.scripts.build);
|
|
363
284
|
done();
|
|
364
285
|
} catch (error) {
|
|
365
286
|
log.error(`Test Failure: ${error}`);
|
|
@@ -372,6 +293,9 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
372
293
|
assert.notEqual(undefined, packageDotJson.repository);
|
|
373
294
|
assert.notEqual(null, packageDotJson.repository);
|
|
374
295
|
assert.notEqual('', packageDotJson.repository);
|
|
296
|
+
assert.equal('git', packageDotJson.repository.type);
|
|
297
|
+
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
|
|
298
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
|
|
375
299
|
done();
|
|
376
300
|
} catch (error) {
|
|
377
301
|
log.error(`Test Failure: ${error}`);
|
|
@@ -388,7 +312,7 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
388
312
|
assert.equal('^0.21.0', packageDotJson.dependencies.axios);
|
|
389
313
|
assert.equal('^2.20.0', packageDotJson.dependencies.commander);
|
|
390
314
|
assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
|
|
391
|
-
assert.equal('^
|
|
315
|
+
assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
|
|
392
316
|
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
393
317
|
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
394
318
|
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
@@ -407,12 +331,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
407
331
|
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
408
332
|
assert.notEqual(null, packageDotJson.devDependencies);
|
|
409
333
|
assert.notEqual('', packageDotJson.devDependencies);
|
|
410
|
-
assert.equal('^
|
|
411
|
-
assert.equal('^
|
|
412
|
-
assert.equal('^7.26.0', packageDotJson.devDependencies.eslint);
|
|
334
|
+
assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
|
|
335
|
+
assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
|
|
413
336
|
assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
414
|
-
assert.equal('^2.
|
|
415
|
-
assert.equal('^2.23.0', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
337
|
+
assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
416
338
|
assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
417
339
|
assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
|
|
418
340
|
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
@@ -458,16 +380,17 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
458
380
|
assert.notEqual('', pronghornDotJson.methods);
|
|
459
381
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
460
382
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
461
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
462
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
463
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
464
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
465
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
466
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
467
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
468
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
469
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
383
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
384
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
385
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
386
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
387
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
388
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
389
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
390
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
391
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
470
392
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
471
394
|
done();
|
|
472
395
|
} catch (error) {
|
|
473
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -623,15 +546,6 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
623
546
|
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
624
547
|
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
625
548
|
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
626
|
-
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
627
|
-
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
628
|
-
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
629
|
-
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
630
|
-
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
631
|
-
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
632
|
-
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
633
|
-
assert.notEqual(null, propertiesDotJson.definitions);
|
|
634
|
-
assert.notEqual('', propertiesDotJson.definitions);
|
|
635
549
|
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
636
550
|
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
637
551
|
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
@@ -645,6 +559,30 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
645
559
|
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
646
560
|
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
647
561
|
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
562
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
563
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
564
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
565
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
566
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
567
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
568
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
569
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
570
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
571
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
572
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
573
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
574
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
575
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
576
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
577
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
578
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
579
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
581
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
582
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
583
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
584
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
585
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
648
586
|
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
649
587
|
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
650
588
|
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
@@ -688,17 +626,6 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
688
626
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
689
627
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
690
628
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
691
|
-
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
692
|
-
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
693
|
-
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
694
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
695
|
-
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
696
|
-
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
697
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
698
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
699
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
700
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
701
|
-
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
702
629
|
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
703
630
|
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
704
631
|
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
@@ -714,6 +641,12 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
714
641
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
715
642
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
716
643
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
644
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
645
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
646
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
647
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
648
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
649
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
717
650
|
done();
|
|
718
651
|
} catch (error) {
|
|
719
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -803,17 +736,6 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
803
736
|
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
804
737
|
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
805
738
|
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
806
|
-
|
|
807
|
-
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
808
|
-
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
809
|
-
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
810
|
-
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
811
|
-
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
812
|
-
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
813
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
814
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
815
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
816
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
817
739
|
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
818
740
|
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
819
741
|
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
@@ -827,6 +749,27 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
827
749
|
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
828
750
|
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
829
751
|
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
752
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
753
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
754
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
755
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
756
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
757
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
758
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
759
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
760
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
761
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
762
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
763
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
764
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
765
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
766
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
767
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
768
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
769
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
771
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
772
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
830
773
|
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
831
774
|
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
832
775
|
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
@@ -870,17 +813,6 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
870
813
|
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
871
814
|
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
872
815
|
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
873
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
874
|
-
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
875
|
-
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
876
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
877
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
878
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
879
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
880
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
881
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
882
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
883
|
-
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
884
816
|
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
885
817
|
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
886
818
|
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
@@ -896,6 +828,12 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
896
828
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
897
829
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
898
830
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
899
837
|
done();
|
|
900
838
|
} catch (error) {
|
|
901
839
|
log.error(`Test Failure: ${error}`);
|
|
@@ -989,10 +927,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
989
927
|
});
|
|
990
928
|
});
|
|
991
929
|
|
|
992
|
-
describe('#
|
|
993
|
-
it('should have a
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
994
932
|
try {
|
|
995
|
-
assert.equal(true, typeof a.
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
996
934
|
done();
|
|
997
935
|
} catch (error) {
|
|
998
936
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1001,19 +939,19 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1001
939
|
});
|
|
1002
940
|
});
|
|
1003
941
|
|
|
1004
|
-
describe('#
|
|
1005
|
-
it('should have a
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
1006
944
|
try {
|
|
1007
|
-
assert.equal(true, typeof a.
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
1008
946
|
done();
|
|
1009
947
|
} catch (error) {
|
|
1010
948
|
log.error(`Test Failure: ${error}`);
|
|
1011
949
|
done(error);
|
|
1012
950
|
}
|
|
1013
951
|
});
|
|
1014
|
-
it('
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1015
953
|
try {
|
|
1016
|
-
a.
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1017
955
|
try {
|
|
1018
956
|
assert.equal(undefined, error);
|
|
1019
957
|
assert.notEqual(undefined, data);
|
|
@@ -1035,10 +973,22 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1035
973
|
}).timeout(attemptTimeout);
|
|
1036
974
|
});
|
|
1037
975
|
|
|
1038
|
-
describe('#
|
|
1039
|
-
it('should have a
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
978
|
+
try {
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
980
|
+
done();
|
|
981
|
+
} catch (error) {
|
|
982
|
+
log.error(`Test Failure: ${error}`);
|
|
983
|
+
done(error);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
1040
990
|
try {
|
|
1041
|
-
assert.equal(true, typeof a.
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1042
992
|
done();
|
|
1043
993
|
} catch (error) {
|
|
1044
994
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1047,10 +997,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1047
997
|
});
|
|
1048
998
|
});
|
|
1049
999
|
|
|
1050
|
-
describe('#
|
|
1051
|
-
it('should have a
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1052
1002
|
try {
|
|
1053
|
-
assert.equal(true, typeof a.
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1054
1004
|
done();
|
|
1055
1005
|
} catch (error) {
|
|
1056
1006
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1059,10 +1009,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1059
1009
|
});
|
|
1060
1010
|
});
|
|
1061
1011
|
|
|
1062
|
-
describe('#
|
|
1063
|
-
it('should have a
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1064
1014
|
try {
|
|
1065
|
-
assert.equal(true, typeof a.
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1066
1016
|
done();
|
|
1067
1017
|
} catch (error) {
|
|
1068
1018
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1071,10 +1021,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1071
1021
|
});
|
|
1072
1022
|
});
|
|
1073
1023
|
|
|
1074
|
-
describe('#
|
|
1075
|
-
it('should have a
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1076
1026
|
try {
|
|
1077
|
-
assert.equal(true, typeof a.
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1078
1028
|
done();
|
|
1079
1029
|
} catch (error) {
|
|
1080
1030
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1083,10 +1033,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1083
1033
|
});
|
|
1084
1034
|
});
|
|
1085
1035
|
|
|
1086
|
-
describe('#
|
|
1087
|
-
it('should have a
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1088
1038
|
try {
|
|
1089
|
-
assert.equal(true, typeof a.
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1090
1040
|
done();
|
|
1091
1041
|
} catch (error) {
|
|
1092
1042
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1095,10 +1045,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1095
1045
|
});
|
|
1096
1046
|
});
|
|
1097
1047
|
|
|
1098
|
-
describe('#
|
|
1099
|
-
it('should have a
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1100
1050
|
try {
|
|
1101
|
-
assert.equal(true, typeof a.
|
|
1051
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1102
1052
|
done();
|
|
1103
1053
|
} catch (error) {
|
|
1104
1054
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1107,10 +1057,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1107
1057
|
});
|
|
1108
1058
|
});
|
|
1109
1059
|
|
|
1110
|
-
describe('#
|
|
1111
|
-
it('should have a
|
|
1060
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1061
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1112
1062
|
try {
|
|
1113
|
-
assert.equal(true, typeof a.
|
|
1063
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1114
1064
|
done();
|
|
1115
1065
|
} catch (error) {
|
|
1116
1066
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1204,10 +1154,10 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1204
1154
|
}).timeout(attemptTimeout);
|
|
1205
1155
|
});
|
|
1206
1156
|
|
|
1207
|
-
// describe('#
|
|
1208
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
1209
1159
|
// try {
|
|
1210
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
1211
1161
|
// done();
|
|
1212
1162
|
// } catch (error) {
|
|
1213
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -1216,7 +1166,7 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1216
1166
|
// });
|
|
1217
1167
|
// it('should find entity', (done) => {
|
|
1218
1168
|
// try {
|
|
1219
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
1220
1170
|
// try {
|
|
1221
1171
|
// assert.equal(true, data[0]);
|
|
1222
1172
|
// done();
|
|
@@ -1232,7 +1182,7 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1232
1182
|
// }).timeout(attemptTimeout);
|
|
1233
1183
|
// it('should not find entity', (done) => {
|
|
1234
1184
|
// try {
|
|
1235
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
1236
1186
|
// try {
|
|
1237
1187
|
// assert.equal(false, data[0]);
|
|
1238
1188
|
// done();
|
|
@@ -1248,6 +1198,78 @@ describe('[unit] Okta Adapter Test', () => {
|
|
|
1248
1198
|
// }).timeout(attemptTimeout);
|
|
1249
1199
|
// });
|
|
1250
1200
|
|
|
1201
|
+
describe('#hasEntities', () => {
|
|
1202
|
+
it('should have a hasEntities function', (done) => {
|
|
1203
|
+
try {
|
|
1204
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1205
|
+
done();
|
|
1206
|
+
} catch (error) {
|
|
1207
|
+
log.error(`Test Failure: ${error}`);
|
|
1208
|
+
done(error);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
describe('#getDevice', () => {
|
|
1214
|
+
it('should have a getDevice function', (done) => {
|
|
1215
|
+
try {
|
|
1216
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1217
|
+
done();
|
|
1218
|
+
} catch (error) {
|
|
1219
|
+
log.error(`Test Failure: ${error}`);
|
|
1220
|
+
done(error);
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
describe('#getDevicesFiltered', () => {
|
|
1226
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1227
|
+
try {
|
|
1228
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1229
|
+
done();
|
|
1230
|
+
} catch (error) {
|
|
1231
|
+
log.error(`Test Failure: ${error}`);
|
|
1232
|
+
done(error);
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
describe('#isAlive', () => {
|
|
1238
|
+
it('should have a isAlive function', (done) => {
|
|
1239
|
+
try {
|
|
1240
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1241
|
+
done();
|
|
1242
|
+
} catch (error) {
|
|
1243
|
+
log.error(`Test Failure: ${error}`);
|
|
1244
|
+
done(error);
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
describe('#getConfig', () => {
|
|
1250
|
+
it('should have a getConfig function', (done) => {
|
|
1251
|
+
try {
|
|
1252
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1253
|
+
done();
|
|
1254
|
+
} catch (error) {
|
|
1255
|
+
log.error(`Test Failure: ${error}`);
|
|
1256
|
+
done(error);
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
describe('#iapGetDeviceCount', () => {
|
|
1262
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1263
|
+
try {
|
|
1264
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1265
|
+
done();
|
|
1266
|
+
} catch (error) {
|
|
1267
|
+
log.error(`Test Failure: ${error}`);
|
|
1268
|
+
done(error);
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1251
1273
|
/*
|
|
1252
1274
|
-----------------------------------------------------------------------
|
|
1253
1275
|
-----------------------------------------------------------------------
|