@itentialopensource/adapter-zscaler 0.6.3 → 0.6.7

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/adapterBase.js CHANGED
@@ -22,6 +22,7 @@ const AjvCl = require('ajv');
22
22
  const PropUtilCl = require('@itentialopensource/adapter-utils').PropertyUtility;
23
23
  const RequestHandlerCl = require('@itentialopensource/adapter-utils').RequestHandler;
24
24
 
25
+ const entitiesToDB = require(path.join(__dirname, 'utils/entitiesToDB'));
25
26
  const troubleshootingAdapter = require(path.join(__dirname, 'utils/troubleshootingAdapter'));
26
27
  const tbUtils = require(path.join(__dirname, 'utils/tbUtils'));
27
28
 
@@ -821,7 +822,7 @@ class AdapterBase extends EventEmitterCl {
821
822
  */
822
823
  async runConnectivity(callback) {
823
824
  try {
824
- const { serviceItem } = await troubleshootingAdapter.getAdapterConfig();
825
+ const { serviceItem } = await tbUtils.getAdapterConfig();
825
826
  const { host } = serviceItem.properties.properties;
826
827
  const result = tbUtils.runConnectivity(host, false);
827
828
  if (result.failCount > 0) {
@@ -1001,6 +1002,27 @@ class AdapterBase extends EventEmitterCl {
1001
1002
  return [];
1002
1003
  }
1003
1004
  }
1005
+
1006
+ /**
1007
+ * @summary moves entities to mongo database
1008
+ *
1009
+ * @function moveEntitiesToDB
1010
+ *
1011
+ * @return {Callback} - containing the response from the mongo transaction
1012
+ */
1013
+ moveEntitiesToDB(callback) {
1014
+ const meth = 'adapterBase-moveEntitiesToDB';
1015
+ const origin = `${this.id}-${meth}`;
1016
+ log.trace(origin);
1017
+
1018
+ try {
1019
+ return callback(entitiesToDB.moveEntitiesToDB(__dirname, { pronghornProps: this.allProps, id: this.id }), null);
1020
+ } catch (err) {
1021
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, err);
1022
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1023
+ return callback(null, errorObj);
1024
+ }
1025
+ }
1004
1026
  }
1005
1027
 
1006
1028
  module.exports = AdapterBase;
@@ -4,7 +4,7 @@
4
4
  "name": "getGenerics",
5
5
  "protocol": "REST",
6
6
  "method": "GET",
7
- "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}?{query}",
7
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
8
8
  "requestSchema": "schema.json",
9
9
  "responseSchema": "schema.json",
10
10
  "timeout": 0,
@@ -25,7 +25,7 @@
25
25
  "name": "createGeneric",
26
26
  "protocol": "REST",
27
27
  "method": "POST",
28
- "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}?{query}",
28
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
29
29
  "requestSchema": "schema.json",
30
30
  "responseSchema": "schema.json",
31
31
  "timeout": 0,
@@ -46,7 +46,7 @@
46
46
  "name": "updateGeneric",
47
47
  "protocol": "REST",
48
48
  "method": "PUT",
49
- "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}?{query}",
49
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
50
50
  "requestSchema": "schema.json",
51
51
  "responseSchema": "schema.json",
52
52
  "timeout": 0,
@@ -67,7 +67,7 @@
67
67
  "name": "patchGeneric",
68
68
  "protocol": "REST",
69
69
  "method": "PATCH",
70
- "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}?{query}",
70
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
71
71
  "requestSchema": "schema.json",
72
72
  "responseSchema": "schema.json",
73
73
  "timeout": 0,
@@ -88,7 +88,7 @@
88
88
  "name": "deleteGeneric",
89
89
  "protocol": "REST",
90
90
  "method": "DELETE",
91
- "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}?{query}",
91
+ "entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
92
92
  "requestSchema": "schema.json",
93
93
  "responseSchema": "schema.json",
94
94
  "timeout": 0,
@@ -4,12 +4,12 @@
4
4
  "name": "getToken",
5
5
  "protocol": "REST",
6
6
  "method": "POST",
7
- "entitypath": "{base_path}/{version}/login",
7
+ "entitypath": "{base_path}/{version}/authenticatedSession",
8
8
  "requestSchema": "schemaTokenReq.json",
9
9
  "responseSchema": "schemaTokenResp.json",
10
10
  "timeout": 0,
11
- "sendEmpty": false,
12
- "sendGetBody": false,
11
+ "sendEmpty": true,
12
+ "sendGetBody": true,
13
13
  "requestDatatype": "JSON",
14
14
  "responseDatatype": "JSON",
15
15
  "headers": {},
@@ -30,7 +30,7 @@
30
30
  "name": "healthcheck",
31
31
  "protocol": "REST",
32
32
  "method": "GET",
33
- "entitypath": "{base_path}/{version}/healthcheck?{query}",
33
+ "entitypath": "{base_path}/{version}/authenticatedSession",
34
34
  "requestSchema": "schema.json",
35
35
  "responseSchema": "schema.json",
36
36
  "timeout": 0,
@@ -48,4 +48,4 @@
48
48
  ]
49
49
  }
50
50
  ]
51
- }
51
+ }
@@ -3,7 +3,7 @@
3
3
  "type": "object",
4
4
  "$schema": "http://json-schema.org/draft-07/schema#",
5
5
  "translate": true,
6
- "dynamicfields": false,
6
+ "dynamicfields": true,
7
7
  "properties": {
8
8
  "ph_request_type": {
9
9
  "type": "string",
@@ -23,7 +23,7 @@
23
23
  "type": "AES",
24
24
  "key": ""
25
25
  },
26
- "external_name": "aaaUser.attributes.name"
26
+ "external_name": "username"
27
27
  },
28
28
  "password": {
29
29
  "type": "string",
@@ -34,9 +34,8 @@
34
34
  "type": "AES",
35
35
  "key": ""
36
36
  },
37
- "external_name": "aaaUser.attributes.pwd"
37
+ "external_name": "password"
38
38
  }
39
39
  },
40
- "required": ["username","password"],
41
40
  "definitions": {}
42
41
  }
@@ -19,23 +19,12 @@
19
19
  "description": "the token returned from system",
20
20
  "parse": false,
21
21
  "encode": false,
22
- "placement": "BODY",
22
+ "placement": "HEADER",
23
23
  "encrypt": {
24
24
  "type": "AES",
25
25
  "key": ""
26
26
  },
27
- "external_name": "aaaLogin.attributes.token"
28
- },
29
- "expires": {
30
- "type": "string",
31
- "description": "when the token will expire",
32
- "parse": false,
33
- "encode": false,
34
- "encrypt": {
35
- "type": "AES",
36
- "key": ""
37
- },
38
- "external_name": "expires"
27
+ "external_name": "set-cookie.JSESSIONID"
39
28
  }
40
29
  },
41
30
  "definitions": {}
package/error.json CHANGED
@@ -168,6 +168,12 @@
168
168
  "displayString": "Failure response received for $VARIABLE$",
169
169
  "recommendation": "Check the reason for failure in the stack trace"
170
170
  },
171
+ {
172
+ "key": "Suspended Adapter",
173
+ "icode": "AD.600",
174
+ "displayString": "Adapter is suspended",
175
+ "recommendation": "Check if external system is functional and unsuspend if appropriate"
176
+ },
171
177
  {
172
178
  "key": "Caught Exception",
173
179
  "icode": "AD.900",
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-zscaler",
3
- "version": "0.6.3",
3
+ "version": "0.6.7",
4
4
  "description": "This adapter integrates with system Zscaler",
5
5
  "main": "adapter.js",
6
- "wizardVersion": "2.43.12",
7
- "engineVersion": "1.58.6",
6
+ "wizardVersion": "2.44.7",
7
+ "engineVersion": "1.59.55",
8
+ "adapterType": "http",
8
9
  "scripts": {
9
10
  "artifactize": "npm i && node utils/packModificationScript.js",
10
- "preinstall": "node utils/setup.js",
11
+ "preinstall": "node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions",
11
12
  "lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
12
13
  "lint:errors": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet",
13
14
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
@@ -15,7 +16,7 @@
15
16
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
16
17
  "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
17
18
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
18
- "adapter:install": "node utils/tbScript.js install",
19
+ "adapter:install": "npm i && node utils/tbScript.js install",
19
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
20
21
  "adapter:findPath": "node utils/findPath.js",
21
22
  "adapter:migrate": "node utils/modify.js -m",
@@ -25,7 +26,7 @@
25
26
  "healthcheck": "node utils/tbScript.js healthcheck",
26
27
  "basicget": "node utils/tbScript.js basicget",
27
28
  "connectivity": "node utils/tbScript.js connectivity",
28
- "deploy": "npm publish --registry=http://registry.npmjs.org --access=public",
29
+ "deploy": "npm publish --registry=https://registry.npmjs.org --access=public",
29
30
  "build": "npm run deploy"
30
31
  },
31
32
  "keywords": [
@@ -51,13 +52,14 @@
51
52
  "author": "Itential",
52
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/security/adapter-zscaler#readme",
53
54
  "dependencies": {
54
- "@itentialopensource/adapter-utils": "^4.39.2",
55
+ "@itentialopensource/adapter-utils": "^4.44.11",
55
56
  "ajv": "^6.12.0",
56
57
  "axios": "^0.21.0",
57
58
  "commander": "^2.20.0",
58
59
  "fs-extra": "^8.1.0",
59
- "mocha": "^8.1.1",
60
+ "mocha": "^9.0.1",
60
61
  "mocha-param": "^2.0.1",
62
+ "mongodb": "^4.1.0",
61
63
  "network-diagnostics": "^0.5.3",
62
64
  "nyc": "^15.1.0",
63
65
  "readline-sync": "^1.4.10",
@@ -65,13 +67,16 @@
65
67
  "winston": "^3.3.3"
66
68
  },
67
69
  "devDependencies": {
68
- "chai": "^4.2.0",
69
- "eslint": "^7.2.0",
70
- "eslint-config-airbnb-base": "^14.2.0",
71
- "eslint-plugin-import": "^2.21.2",
72
- "eslint-plugin-json": "^2.1.1",
70
+ "chai": "^4.3.4",
71
+ "eslint": "^7.29.0",
72
+ "eslint-config-airbnb-base": "^14.2.1",
73
+ "eslint-plugin-import": "^2.23.4",
74
+ "eslint-plugin-json": "^3.0.0",
73
75
  "package-json-validator": "^0.6.3",
74
76
  "testdouble": "^3.16.1"
75
77
  },
78
+ "resolutions": {
79
+ "minimist": "^1.2.5"
80
+ },
76
81
  "private": false
77
82
  }