@itentialopensource/adapter-zscaler 0.11.3 → 0.11.5

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/adapter.js CHANGED
@@ -540,8 +540,17 @@ class Zscaler extends AdapterBaseCl {
540
540
  const origin = `${this.id}-${meth}`;
541
541
  log.trace(origin);
542
542
 
543
+ let mymetadata = metadata;
544
+ if (!mymetadata) {
545
+ mymetadata = {
546
+ authData: this.getObfuscatedKey()
547
+ };
548
+ } else {
549
+ mymetadata.authData = this.getObfuscatedKey();
550
+ }
551
+
543
552
  try {
544
- return super.iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback);
553
+ return super.iapExpandedGenericAdapterRequest(mymetadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback);
545
554
  } catch (err) {
546
555
  log.error(`${origin}: ${err}`);
547
556
  return callback(null, err);
@@ -569,7 +578,7 @@ class Zscaler extends AdapterBaseCl {
569
578
  log.trace(origin);
570
579
 
571
580
  try {
572
- return super.genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback);
581
+ return this.iapExpandedGenericAdapterRequest(null, uriPath, restMethod, null, queryData, requestBody, addlHeaders, callback);
573
582
  } catch (err) {
574
583
  log.error(`${origin}: ${err}`);
575
584
  return callback(null, err);
@@ -597,7 +606,7 @@ class Zscaler extends AdapterBaseCl {
597
606
  log.trace(origin);
598
607
 
599
608
  try {
600
- return super.genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback);
609
+ return this.iapExpandedGenericAdapterRequest(null, uriPath, restMethod, null, queryData, requestBody, addlHeaders, callback);
601
610
  } catch (err) {
602
611
  log.error(`${origin}: ${err}`);
603
612
  return callback(null, err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-zscaler",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "This adapter integrates with system Zscaler",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
@@ -23,9 +23,7 @@
23
23
  "troubleshoot": "node utils/tbScript.js troubleshoot",
24
24
  "healthcheck": "node utils/tbScript.js healthcheck",
25
25
  "basicget": "node utils/tbScript.js basicget",
26
- "connectivity": "node utils/tbScript.js connectivity",
27
- "deploy": "npm publish --registry=https://registry.npmjs.org --access=public",
28
- "build": "npm run deploy"
26
+ "connectivity": "node utils/tbScript.js connectivity"
29
27
  },
30
28
  "keywords": [
31
29
  "Itential",
@@ -49,7 +47,7 @@
49
47
  "author": "Itential",
50
48
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-zscaler#readme",
51
49
  "dependencies": {
52
- "@itentialopensource/adapter-utils": "5.10.20",
50
+ "@itentialopensource/adapter-utils": "5.10.23",
53
51
  "acorn": "8.14.1",
54
52
  "ajv": "8.17.1",
55
53
  "axios": "1.9.0",
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.11.0",
2
+ "version": "0.11.4",
3
3
  "configLines": 35632,
4
4
  "scriptLines": 2498,
5
- "codeLines": 31206,
6
- "testLines": 20221,
7
- "testCases": 1033,
8
- "totalCodeLines": 53925,
5
+ "codeLines": 31215,
6
+ "testLines": 20248,
7
+ "testCases": 1034,
8
+ "totalCodeLines": 53961,
9
9
  "wfTasks": 369
10
10
  }
@@ -431,6 +431,33 @@ describe('[integration] Zscaler Adapter Test', () => {
431
431
  }
432
432
  }).timeout(attemptTimeout);
433
433
  });
434
+
435
+ describe('#genericAdapterRequest - errors', () => {
436
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
437
+ try {
438
+ a.genericAdapterRequest('/fake/data', 'GET', {}, {}, {}, (data, error) => {
439
+ try {
440
+ if (stub) {
441
+ assert.equal(null, data);
442
+ assert.notEqual(null, error);
443
+ assert.notEqual(undefined, error);
444
+ } else {
445
+ assert.equal(undefined, error);
446
+ assert.notEqual(null, data);
447
+ assert.notEqual(undefined, data);
448
+ }
449
+ done();
450
+ } catch (err) {
451
+ log.error(`Test Failure: ${err}`);
452
+ done(err);
453
+ }
454
+ });
455
+ } catch (error) {
456
+ log.error(`Adapter Exception: ${error}`);
457
+ done(error);
458
+ }
459
+ }).timeout(attemptTimeout);
460
+ });
434
461
  /*
435
462
  -----------------------------------------------------------------------
436
463
  -----------------------------------------------------------------------
@@ -956,14 +956,16 @@ describe('[unit] Adapter Base Test', () => {
956
956
  });
957
957
  it('should get information for all of the requests currently in the queue', (done) => {
958
958
  try {
959
- const expectedFunctions = a.iapGetAdapterQueue();
960
- try {
961
- assert.equal(0, expectedFunctions.length);
962
- done();
963
- } catch (err) {
964
- log.error(`Test Failure: ${err}`);
965
- done(err);
966
- }
959
+ a.iapGetAdapterQueue((data, error) => {
960
+ try {
961
+ assert.notEqual(null, data);
962
+ assert.equal(0, data.length);
963
+ done();
964
+ } catch (err) {
965
+ log.error(`Test Failure: ${err}`);
966
+ done(err);
967
+ }
968
+ });
967
969
  } catch (error) {
968
970
  log.error(`Adapter Exception: ${error}`);
969
971
  done(error);
@@ -252,8 +252,6 @@ describe('[unit] Zscaler Adapter Test', () => {
252
252
  assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
253
253
  assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
254
254
  assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
255
- assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
256
- assert.equal('npm run deploy', packageDotJson.scripts.build);
257
255
  done();
258
256
  } catch (error) {
259
257
  log.error(`Test Failure: ${error}`);