@itentialopensource/adapter-zscaler 0.10.6 → 0.10.8

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/CALLS.md CHANGED
@@ -395,8 +395,8 @@ Specific adapter calls are built based on the API of the Adapter for Zscaler. Th
395
395
  <td style="padding:15px">Yes</td>
396
396
  </tr>
397
397
  <tr>
398
- <td style="padding:15px">getUrlCategories(customOnly, callback)</td>
399
- <td style="padding:15px">Gets information about all or custom URL categories</td>
398
+ <td style="padding:15px">getUrlCategoriesWithOptions(queryData, callback)</td>
399
+ <td style="padding:15px">Gets information about all or custom URL categories with query data</td>
400
400
  <td style="padding:15px">{base_path}/{version}/urlCategories?{query}</td>
401
401
  <td style="padding:15px">Yes</td>
402
402
  </tr>
@@ -1660,5 +1660,17 @@ Specific adapter calls are built based on the API of the Adapter for Zscaler. Th
1660
1660
  <td style="padding:15px">{base_path}/{version}/locations/groups?{query}</td>
1661
1661
  <td style="padding:15px">Yes</td>
1662
1662
  </tr>
1663
+ <tr>
1664
+ <td style="padding:15px">postUrlCategoriesReviewDomain(body, callback)</td>
1665
+ <td style="padding:15px">URL Categories - Review Domain</td>
1666
+ <td style="padding:15px">{base_path}/{version}/urlCategories/review/domains?{query}</td>
1667
+ <td style="padding:15px">Yes</td>
1668
+ </tr>
1669
+ <tr>
1670
+ <td style="padding:15px">putUrlCategoriesReviewDomainAddURLs(body, callback)</td>
1671
+ <td style="padding:15px">URL Categories - Review Domain - Add URLs</td>
1672
+ <td style="padding:15px">{base_path}/{version}/urlCategories/review/domains?{query}</td>
1673
+ <td style="padding:15px">Yes</td>
1674
+ </tr>
1663
1675
  </table>
1664
1676
  <br>
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.10.8 [09-25-2024]
3
+
4
+ * Add missing calls and add a task to take in query data
5
+
6
+ See merge request itentialopensource/adapters/adapter-zscaler!35
7
+
8
+ ---
9
+
10
+ ## 0.10.7 [09-20-2024]
11
+
12
+ * add workshop and fix vulnerabilities
13
+
14
+ See merge request itentialopensource/adapters/adapter-zscaler!36
15
+
16
+ ---
17
+
2
18
  ## 0.10.6 [08-15-2024]
3
19
 
4
20
  * fix vulnerabilities
package/SYSTEMINFO.md CHANGED
@@ -4,7 +4,7 @@ Vendor: Zscaler
4
4
  Homepage: https://www.zscaler.com/
5
5
 
6
6
  Product: Internet Access (ZIA)
7
- Product Page: https://www.zscaler.com/products/zscaler-internet-access
7
+ Product Page: https://www.zscaler.com/products-and-solutions/zscaler-internet-access
8
8
 
9
9
  ## Introduction
10
10
  We classify Zscaler into the Security domain as Zscaler provides access to cloud security services and functionalities.
package/TAB2.md CHANGED
@@ -71,9 +71,9 @@ Sample Properties can be used to help you configure the adapter in the Itential
71
71
  "protocol": "https",
72
72
  "authentication": {
73
73
  "auth_method": "request_token",
74
- "username": "exampleUsername",
75
- "password": "examplePassword",
76
- "apiKey": "exampleApiKey",
74
+ "username": "username",
75
+ "password": "password",
76
+ "apiKey": "token",
77
77
  "token": "",
78
78
  "token_timeout": 180000,
79
79
  "token_cache": "local",
package/adapter.js CHANGED
@@ -2716,7 +2716,20 @@ class Zscaler extends AdapterBaseCl {
2716
2716
  */
2717
2717
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2718
2718
  getUrlCategories(customOnly, callback) {
2719
- const meth = 'adapter-getUrlCategories';
2719
+ const queryData = { customOnly };
2720
+ this.getUrlCategoriesWithOptions(queryData, callback);
2721
+ }
2722
+
2723
+ /**
2724
+ * @summary Gets information about all or custom URL categories
2725
+ *
2726
+ * @function getUrlCategoriesWithOptions
2727
+ * @param {object} queryData - object of query data - includeOnlyUrlKeywordCounts, customOnly
2728
+ * @param {getCallback} callback - a callback function to return the result
2729
+ */
2730
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2731
+ getUrlCategoriesWithOptions(queryData, callback) {
2732
+ const meth = 'adapter-getUrlCategoriesWithOptions';
2720
2733
  const origin = `${this.id}-${meth}`;
2721
2734
  log.trace(origin);
2722
2735
 
@@ -2729,7 +2742,10 @@ class Zscaler extends AdapterBaseCl {
2729
2742
  /* HERE IS WHERE YOU VALIDATE DATA */
2730
2743
 
2731
2744
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2732
- const queryParamsAvailable = { customOnly };
2745
+ let queryParamsAvailable = {};
2746
+ if (queryData) {
2747
+ queryParamsAvailable = queryData;
2748
+ }
2733
2749
  const queryParams = {};
2734
2750
  const pathVars = [];
2735
2751
  const bodyVars = {};
@@ -19478,6 +19494,170 @@ class Zscaler extends AdapterBaseCl {
19478
19494
  return callback(null, errorObj);
19479
19495
  }
19480
19496
  }
19497
+
19498
+ /**
19499
+ * @function postUrlCategoriesReviewDomain
19500
+ * @pronghornType method
19501
+ * @name postUrlCategoriesReviewDomain
19502
+ * @summary URL Categories - Review Domain
19503
+ *
19504
+ * @param {array} body - body param
19505
+ * @param {getCallback} callback - a callback function to return the result
19506
+ * @return {object} results - An object containing the response of the action
19507
+ *
19508
+ * @route {POST} /postUrlCategoriesReviewDomain
19509
+ * @roles admin
19510
+ * @task true
19511
+ */
19512
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
19513
+ postUrlCategoriesReviewDomain(body, callback) {
19514
+ const meth = 'adapter-postUrlCategoriesReviewDomain';
19515
+ const origin = `${this.id}-${meth}`;
19516
+ log.trace(origin);
19517
+
19518
+ if (this.suspended && this.suspendMode === 'error') {
19519
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
19520
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19521
+ return callback(null, errorObj);
19522
+ }
19523
+
19524
+ /* HERE IS WHERE YOU VALIDATE DATA */
19525
+ if (body === undefined || body === null || body === '') {
19526
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
19527
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19528
+ return callback(null, errorObj);
19529
+ }
19530
+
19531
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
19532
+ const queryParamsAvailable = {};
19533
+ const queryParams = {};
19534
+ const pathVars = [];
19535
+ const bodyVars = body;
19536
+
19537
+ // loop in template. long callback arg name to avoid identifier conflicts
19538
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
19539
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
19540
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
19541
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
19542
+ }
19543
+ });
19544
+
19545
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
19546
+ // see adapter code documentation for more information on the request object's fields
19547
+ const reqObj = {
19548
+ payload: bodyVars,
19549
+ uriPathVars: pathVars,
19550
+ uriQuery: queryParams
19551
+ };
19552
+
19553
+ try {
19554
+ // Make the call -
19555
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
19556
+ return this.requestHandlerInst.identifyRequest('URLCategories', 'postUrlCategoriesReviewDomain', reqObj, true, (irReturnData, irReturnError) => {
19557
+ // if we received an error or their is no response on the results
19558
+ // return an error
19559
+ if (irReturnError) {
19560
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
19561
+ return callback(null, irReturnError);
19562
+ }
19563
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
19564
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['postUrlCategoriesReviewDomain'], null, null, null);
19565
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19566
+ return callback(null, errorObj);
19567
+ }
19568
+
19569
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
19570
+ // return the response
19571
+ return callback(irReturnData, null);
19572
+ });
19573
+ } catch (ex) {
19574
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
19575
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19576
+ return callback(null, errorObj);
19577
+ }
19578
+ }
19579
+
19580
+ /**
19581
+ * @function putUrlCategoriesReviewDomainAddURLs
19582
+ * @pronghornType method
19583
+ * @name putUrlCategoriesReviewDomainAddURLs
19584
+ * @summary URL Categories - Review Domain - Add URLs
19585
+ *
19586
+ * @param {array} body - body param
19587
+ * @param {getCallback} callback - a callback function to return the result
19588
+ * @return {object} results - An object containing the response of the action
19589
+ *
19590
+ * @route {POST} /putUrlCategoriesReviewDomainAddURLs
19591
+ * @roles admin
19592
+ * @task true
19593
+ */
19594
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
19595
+ putUrlCategoriesReviewDomainAddURLs(body, callback) {
19596
+ const meth = 'adapter-putUrlCategoriesReviewDomainAddURLs';
19597
+ const origin = `${this.id}-${meth}`;
19598
+ log.trace(origin);
19599
+
19600
+ if (this.suspended && this.suspendMode === 'error') {
19601
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
19602
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19603
+ return callback(null, errorObj);
19604
+ }
19605
+
19606
+ /* HERE IS WHERE YOU VALIDATE DATA */
19607
+ if (body === undefined || body === null || body === '') {
19608
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
19609
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19610
+ return callback(null, errorObj);
19611
+ }
19612
+
19613
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
19614
+ const queryParamsAvailable = {};
19615
+ const queryParams = {};
19616
+ const pathVars = [];
19617
+ const bodyVars = body;
19618
+
19619
+ // loop in template. long callback arg name to avoid identifier conflicts
19620
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
19621
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
19622
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
19623
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
19624
+ }
19625
+ });
19626
+
19627
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
19628
+ // see adapter code documentation for more information on the request object's fields
19629
+ const reqObj = {
19630
+ payload: bodyVars,
19631
+ uriPathVars: pathVars,
19632
+ uriQuery: queryParams
19633
+ };
19634
+
19635
+ try {
19636
+ // Make the call -
19637
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
19638
+ return this.requestHandlerInst.identifyRequest('URLCategories', 'putUrlCategoriesReviewDomainAddURLs', reqObj, false, (irReturnData, irReturnError) => {
19639
+ // if we received an error or their is no response on the results
19640
+ // return an error
19641
+ if (irReturnError) {
19642
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
19643
+ return callback(null, irReturnError);
19644
+ }
19645
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
19646
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['putUrlCategoriesReviewDomainAddURLs'], null, null, null);
19647
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19648
+ return callback(null, errorObj);
19649
+ }
19650
+
19651
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
19652
+ // return the response
19653
+ return callback(irReturnData, null);
19654
+ });
19655
+ } catch (ex) {
19656
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
19657
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
19658
+ return callback(null, errorObj);
19659
+ }
19660
+ }
19481
19661
  }
19482
19662
 
19483
19663
  module.exports = Zscaler;
@@ -167,6 +167,46 @@
167
167
  "mockFile": "mockdatafiles/postUrlLookup-default.json"
168
168
  }
169
169
  ]
170
+ },
171
+ {
172
+ "name": "postUrlCategoriesReviewDomain",
173
+ "protocol": "REST",
174
+ "method": "POST",
175
+ "entitypath": "{base_path}/{version}/urlCategories/review/domains?{query}",
176
+ "requestSchema": "schema.json",
177
+ "responseSchema": "schema.json",
178
+ "timeout": 0,
179
+ "sendEmpty": false,
180
+ "requestDatatype": "JSON",
181
+ "responseDatatype": "JSON",
182
+ "headers": {},
183
+ "responseObjects": [
184
+ {
185
+ "type": "default",
186
+ "key": "",
187
+ "mockFile": ""
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "name": "putUrlCategoriesReviewDomainAddURLs",
193
+ "protocol": "REST",
194
+ "method": "PUT",
195
+ "entitypath": "{base_path}/{version}/urlCategories/review/domains?{query}",
196
+ "requestSchema": "schema.json",
197
+ "responseSchema": "schema.json",
198
+ "timeout": 0,
199
+ "sendEmpty": false,
200
+ "requestDatatype": "JSON",
201
+ "responseDatatype": "JSON",
202
+ "headers": {},
203
+ "responseObjects": [
204
+ {
205
+ "type": "default",
206
+ "key": "",
207
+ "mockFile": ""
208
+ }
209
+ ]
170
210
  }
171
211
  ]
172
212
  }
@@ -17,7 +17,9 @@
17
17
  "getUrlCategoriescategoryId",
18
18
  "putUrlCategoriescategoryId",
19
19
  "deleteUrlCategoriescategoryId",
20
- "postUrlLookup"
20
+ "postUrlLookup",
21
+ "postUrlCategoriesReviewDomain",
22
+ "putUrlCategoriesReviewDomainAddURLs"
21
23
  ],
22
24
  "external_name": "ph_request_type"
23
25
  }
package/metadata.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "adapter-zscaler",
3
3
  "webName": "Adapter for Integration to Zscaler",
4
+ "supportLevel": "community",
4
5
  "vendor": "Zscaler",
5
6
  "product": "Zscaler",
7
+ "techAlliance": false,
6
8
  "osVersion": [],
7
9
  "apiVersions": [],
8
10
  "iapVersions": [
@@ -46,7 +48,7 @@
46
48
  "storeLink": "",
47
49
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-zscaler",
48
50
  "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-zscaler",
49
- "docLink": "https://docs.itential.com/opensource/docs/zscaler",
51
+ "docLink": "https://gitlab.com/itentialopensource/adapters/adapter-zscaler/-/blob/master/README.md?ref_type=heads",
50
52
  "demoLinks": [
51
53
  {
52
54
  "title": "SD-WAN & Multi-Cloud Network Automation with Itential (ONUG)",
@@ -64,7 +66,7 @@
64
66
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
65
67
  "webLink": "https://www.itential.com/adapters/zscaler/",
66
68
  "vendorLink": "https://www.zscaler.com/",
67
- "productLink": "https://www.zscaler.com/products/zscaler-internet-access",
69
+ "productLink": "https://www.zscaler.com/products-and-solutions/zscaler-internet-access",
68
70
  "apiLinks": [
69
71
  {
70
72
  "title": "Zscaler Internet Access (ZIA)",
@@ -77,12 +79,8 @@
77
79
  "public": true
78
80
  }
79
81
  ],
80
- "workshopLinks": [
81
- []
82
- ],
83
- "workshopHomePage": [
84
- "https://www.itential.com/get-started/"
85
- ]
82
+ "workshopLinks": [],
83
+ "workshopHomePage": "https://www.itential.com/get-started/"
86
84
  },
87
85
  "assets": [],
88
86
  "relatedItems": {
@@ -92,7 +90,5 @@
92
90
  "workflowProjects": [],
93
91
  "transformationProjects": [],
94
92
  "exampleProjects": []
95
- },
96
- "supportLevel": "community",
97
- "techAlliance": false
93
+ }
98
94
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-zscaler",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "description": "This adapter integrates with system Zscaler",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.19",
7
+ "engineVersion": "1.68.2",
8
8
  "adapterType": "http",
9
9
  "scripts": {
10
10
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -52,7 +52,7 @@
52
52
  "author": "Itential",
53
53
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-zscaler#readme",
54
54
  "dependencies": {
55
- "@itentialopensource/adapter-utils": "^5.6.0",
55
+ "@itentialopensource/adapter-utils": "^5.8.0",
56
56
  "acorn": "^8.12.1",
57
57
  "ajv": "^8.17.1",
58
58
  "axios": "^1.7.4",
@@ -67,7 +67,7 @@
67
67
  "prompts": "^2.4.2",
68
68
  "readline-sync": "^1.4.10",
69
69
  "semver": "^7.6.3",
70
- "winston": "^3.13.1"
70
+ "winston": "^3.14.2"
71
71
  },
72
72
  "devDependencies": {
73
73
  "chai": "^4.3.7",
package/pronghorn.json CHANGED
@@ -2016,6 +2016,40 @@
2016
2016
  },
2017
2017
  "task": true
2018
2018
  },
2019
+ {
2020
+ "name": "getUrlCategoriesWithOptions",
2021
+ "summary": "Gets information about all or custom URL categories with query data",
2022
+ "description": "Gets information about all or custom URL categories with query data",
2023
+ "input": [
2024
+ {
2025
+ "name": "queryData",
2026
+ "type": "object",
2027
+ "info": "Query data: includeOnlyUrlKeywordCounts, customOnly",
2028
+ "required": false,
2029
+ "schema": {
2030
+ "title": "queryData",
2031
+ "type": "object"
2032
+ }
2033
+ }
2034
+ ],
2035
+ "output": {
2036
+ "name": "result",
2037
+ "type": "object",
2038
+ "description": "A JSON Object containing status, code and the result",
2039
+ "schema": {
2040
+ "title": "result",
2041
+ "type": "object"
2042
+ }
2043
+ },
2044
+ "roles": [
2045
+ "admin"
2046
+ ],
2047
+ "route": {
2048
+ "verb": "POST",
2049
+ "path": "/getUrlCategoriesWithOptions"
2050
+ },
2051
+ "task": true
2052
+ },
2019
2053
  {
2020
2054
  "name": "postUrlCategories",
2021
2055
  "summary": "Adds a new custom URL category",
@@ -20232,6 +20266,74 @@
20232
20266
  "path": "/getLocationGroups"
20233
20267
  },
20234
20268
  "task": true
20269
+ },
20270
+ {
20271
+ "name": "postUrlCategoriesReviewDomain",
20272
+ "summary": "URL Categories - Review Domain",
20273
+ "description": "URL Categories - Review Domain",
20274
+ "input": [
20275
+ {
20276
+ "name": "body",
20277
+ "type": "array",
20278
+ "info": "The list of URLs that must be matched against the entries present in existing custom URL categories",
20279
+ "required": true,
20280
+ "schema": {
20281
+ "title": "body",
20282
+ "type": "array"
20283
+ }
20284
+ }
20285
+ ],
20286
+ "output": {
20287
+ "name": "result",
20288
+ "type": "object",
20289
+ "description": "A JSON Object containing status, code and the result",
20290
+ "schema": {
20291
+ "title": "result",
20292
+ "type": "object"
20293
+ }
20294
+ },
20295
+ "roles": [
20296
+ "admin"
20297
+ ],
20298
+ "route": {
20299
+ "verb": "POST",
20300
+ "path": "/postUrlCategoriesReviewDomain"
20301
+ },
20302
+ "task": true
20303
+ },
20304
+ {
20305
+ "name": "putUrlCategoriesReviewDomainAddURLs",
20306
+ "summary": "URL Categories - Review Domain - Add URLs",
20307
+ "description": "URL Categories - Review Domain - Add URLs",
20308
+ "input": [
20309
+ {
20310
+ "name": "body",
20311
+ "type": "array",
20312
+ "info": "Information about the URLs (of Subdomain type) and the respective custom categories to which they must be added.",
20313
+ "required": true,
20314
+ "schema": {
20315
+ "title": "body",
20316
+ "type": "array"
20317
+ }
20318
+ }
20319
+ ],
20320
+ "output": {
20321
+ "name": "result",
20322
+ "type": "object",
20323
+ "description": "A JSON Object containing status, code and the result",
20324
+ "schema": {
20325
+ "title": "result",
20326
+ "type": "object"
20327
+ }
20328
+ },
20329
+ "roles": [
20330
+ "admin"
20331
+ ],
20332
+ "route": {
20333
+ "verb": "POST",
20334
+ "path": "/putUrlCategoriesReviewDomainAddURLs"
20335
+ },
20336
+ "task": true
20235
20337
  }
20236
20338
  ]
20237
20339
  }
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.10.5",
3
- "configLines": 22098,
2
+ "version": "0.10.7",
3
+ "configLines": 22200,
4
4
  "scriptLines": 1783,
5
- "codeLines": 20937,
6
- "testLines": 14634,
7
- "testCases": 745,
8
- "totalCodeLines": 37354,
9
- "wfTasks": 268
5
+ "codeLines": 21117,
6
+ "testLines": 14797,
7
+ "testCases": 753,
8
+ "totalCodeLines": 37697,
9
+ "wfTasks": 271
10
10
  }
@@ -15,9 +15,9 @@
15
15
  "protocol": "https",
16
16
  "authentication": {
17
17
  "auth_method": "request_token",
18
- "username": "exampleUsername",
19
- "password": "examplePassword",
20
- "apiKey": "exampleApiKey",
18
+ "username": "username",
19
+ "password": "password",
20
+ "apiKey": "token",
21
21
  "token": "",
22
22
  "token_timeout": 180000,
23
23
  "token_cache": "local",
@@ -134,7 +134,7 @@
134
134
  "ostypePrefix": "meraki-",
135
135
  "port": "{port}",
136
136
  "ipaddress": "{ip_addr}",
137
- "serial" : "{serial}"
137
+ "serial": "{serial}"
138
138
  }
139
139
  }
140
140
  ],
@@ -160,7 +160,7 @@
160
160
  "ostypePrefix": "meraki-",
161
161
  "port": "{port}",
162
162
  "ipaddress": "{ip_addr}",
163
- "serial" : "{serial}",
163
+ "serial": "{serial}",
164
164
  "id": "{myid}"
165
165
  }
166
166
  }
@@ -244,7 +244,7 @@
244
244
  "ostypePrefix": "meraki-",
245
245
  "port": "{port}",
246
246
  "ipaddress": "{ip_addr}",
247
- "serial" : "{serial}",
247
+ "serial": "{serial}",
248
248
  "id": "{myid}"
249
249
  }
250
250
  }
@@ -36,13 +36,17 @@ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
36
36
  // these variables can be changed to run in integrated mode so easier to set them here
37
37
  // always check these in with bogus data!!!
38
38
  samProps.stub = true;
39
- samProps.host = 'replace.hostorip.here';
40
- samProps.authentication.username = 'username';
41
- samProps.authentication.password = 'password';
42
- samProps.protocol = 'http';
43
- samProps.port = 80;
44
- samProps.ssl.enabled = false;
45
- samProps.ssl.accept_invalid_cert = false;
39
+
40
+ // uncomment if connecting
41
+ // samProps.host = 'replace.hostorip.here';
42
+ // samProps.authentication.username = 'username';
43
+ // samProps.authentication.password = 'password';
44
+ // samProps.authentication.token = 'password';
45
+ // samProps.protocol = 'http';
46
+ // samProps.port = 80;
47
+ // samProps.ssl.enabled = false;
48
+ // samProps.ssl.accept_invalid_cert = false;
49
+
46
50
  if (samProps.request.attempt_timeout < 30000) {
47
51
  samProps.request.attempt_timeout = 30000;
48
52
  }
@@ -1433,6 +1437,35 @@ describe('[integration] Zscaler Adapter Test', () => {
1433
1437
  }).timeout(attemptTimeout);
1434
1438
  });
1435
1439
 
1440
+ describe('#getUrlCategoriesWithOptions - errors', () => {
1441
+ it('should work if integrated or standalone with mockdata', (done) => {
1442
+ try {
1443
+ a.getUrlCategoriesWithOptions(null, (data, error) => {
1444
+ try {
1445
+ runCommonAsserts(data, error);
1446
+
1447
+ if (stub) {
1448
+ assert.equal('object', typeof data.response[0]);
1449
+ assert.equal('object', typeof data.response[1]);
1450
+ assert.equal('object', typeof data.response[2]);
1451
+ assert.equal('object', typeof data.response[3]);
1452
+ } else {
1453
+ runCommonAsserts(data, error);
1454
+ }
1455
+
1456
+ done();
1457
+ } catch (err) {
1458
+ log.error(`Test Failure: ${err}`);
1459
+ done(err);
1460
+ }
1461
+ });
1462
+ } catch (error) {
1463
+ log.error(`Adapter Exception: ${error}`);
1464
+ done(error);
1465
+ }
1466
+ }).timeout(attemptTimeout);
1467
+ });
1468
+
1436
1469
  describe('#postUrlCategories - errors', () => {
1437
1470
  it('should work if integrated or standalone with mockdata', (done) => {
1438
1471
  try {
@@ -7057,5 +7090,61 @@ describe('[integration] Zscaler Adapter Test', () => {
7057
7090
  }
7058
7091
  }).timeout(attemptTimeout);
7059
7092
  });
7093
+
7094
+ const uRLCategoriespostUrlCategoriesReviewDomainBodyParam = [
7095
+ {}
7096
+ ];
7097
+ describe('#postUrlCategoriesReviewDomain - errors', () => {
7098
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7099
+ try {
7100
+ a.postUrlCategoriesReviewDomain(uRLCategoriespostUrlCategoriesReviewDomainBodyParam, (data, error) => {
7101
+ try {
7102
+ if (stub) {
7103
+ const displayE = 'Error 400 received on request';
7104
+ runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
7105
+ } else {
7106
+ runCommonAsserts(data, error);
7107
+ }
7108
+ saveMockData('URLCategories', 'postUrlCategoriesReviewDomain', 'default', data);
7109
+ done();
7110
+ } catch (err) {
7111
+ log.error(`Test Failure: ${err}`);
7112
+ done(err);
7113
+ }
7114
+ });
7115
+ } catch (error) {
7116
+ log.error(`Adapter Exception: ${error}`);
7117
+ done(error);
7118
+ }
7119
+ }).timeout(attemptTimeout);
7120
+ });
7121
+
7122
+ const uRLCategoriesputUrlCategoriesReviewDomainAddURLsBodyParam = [
7123
+ {}
7124
+ ];
7125
+ describe('#putUrlCategoriesReviewDomainAddURLs - errors', () => {
7126
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
7127
+ try {
7128
+ a.putUrlCategoriesReviewDomainAddURLs(uRLCategoriesputUrlCategoriesReviewDomainAddURLsBodyParam, (data, error) => {
7129
+ try {
7130
+ if (stub) {
7131
+ const displayE = 'Error 400 received on request';
7132
+ runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
7133
+ } else {
7134
+ runCommonAsserts(data, error);
7135
+ }
7136
+ saveMockData('URLCategories', 'putUrlCategoriesReviewDomainAddURLs', 'default', data);
7137
+ done();
7138
+ } catch (err) {
7139
+ log.error(`Test Failure: ${err}`);
7140
+ done(err);
7141
+ }
7142
+ });
7143
+ } catch (error) {
7144
+ log.error(`Adapter Exception: ${error}`);
7145
+ done(error);
7146
+ }
7147
+ }).timeout(attemptTimeout);
7148
+ });
7060
7149
  });
7061
7150
  });
@@ -36,13 +36,17 @@ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
36
36
  // these variables can be changed to run in integrated mode so easier to set them here
37
37
  // always check these in with bogus data!!!
38
38
  samProps.stub = true;
39
- samProps.host = 'replace.hostorip.here';
40
- samProps.authentication.username = 'username';
41
- samProps.authentication.password = 'password';
42
- samProps.protocol = 'http';
43
- samProps.port = 80;
44
- samProps.ssl.enabled = false;
45
- samProps.ssl.accept_invalid_cert = false;
39
+
40
+ // uncomment if connecting
41
+ // samProps.host = 'replace.hostorip.here';
42
+ // samProps.authentication.username = 'username';
43
+ // samProps.authentication.password = 'password';
44
+ // samProps.authentication.token = 'password';
45
+ // samProps.protocol = 'http';
46
+ // samProps.port = 80;
47
+ // samProps.ssl.enabled = false;
48
+ // samProps.ssl.accept_invalid_cert = false;
49
+
46
50
  samProps.request.attempt_timeout = 1200000;
47
51
  const attemptTimeout = samProps.request.attempt_timeout;
48
52
  const { stub } = samProps;
@@ -323,7 +327,7 @@ describe('[unit] Zscaler Adapter Test', () => {
323
327
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
324
328
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
325
329
  assert.equal('^7.6.3', packageDotJson.dependencies.semver);
326
- assert.equal('^3.13.1', packageDotJson.dependencies.winston);
330
+ assert.equal('^3.14.2', packageDotJson.dependencies.winston);
327
331
  done();
328
332
  } catch (error) {
329
333
  log.error(`Test Failure: ${error}`);
@@ -561,7 +565,7 @@ describe('[unit] Zscaler Adapter Test', () => {
561
565
  log.error(`Adapter Exception: ${error}`);
562
566
  done(error);
563
567
  }
564
- });
568
+ }).timeout(attemptTimeout);
565
569
  });
566
570
 
567
571
  describe('propertiesSchema.json', () => {
@@ -2035,6 +2039,18 @@ describe('[unit] Zscaler Adapter Test', () => {
2035
2039
  }).timeout(attemptTimeout);
2036
2040
  });
2037
2041
 
2042
+ describe('#getUrlCategoriesWithOptions - errors', () => {
2043
+ it('should have a getUrlCategoriesWithOptions function', (done) => {
2044
+ try {
2045
+ assert.equal(true, typeof a.getUrlCategoriesWithOptions === 'function');
2046
+ done();
2047
+ } catch (error) {
2048
+ log.error(`Test Failure: ${error}`);
2049
+ done(error);
2050
+ }
2051
+ }).timeout(attemptTimeout);
2052
+ });
2053
+
2038
2054
  describe('#postUrlCategories - errors', () => {
2039
2055
  it('should have a postUrlCategories function', (done) => {
2040
2056
  try {
@@ -6339,5 +6355,63 @@ describe('[unit] Zscaler Adapter Test', () => {
6339
6355
  }
6340
6356
  }).timeout(attemptTimeout);
6341
6357
  });
6358
+
6359
+ describe('#postUrlCategoriesReviewDomain - errors', () => {
6360
+ it('should have a postUrlCategoriesReviewDomain function', (done) => {
6361
+ try {
6362
+ assert.equal(true, typeof a.postUrlCategoriesReviewDomain === 'function');
6363
+ done();
6364
+ } catch (error) {
6365
+ log.error(`Test Failure: ${error}`);
6366
+ done(error);
6367
+ }
6368
+ }).timeout(attemptTimeout);
6369
+ it('should error if - missing body', (done) => {
6370
+ try {
6371
+ a.postUrlCategoriesReviewDomain(null, (data, error) => {
6372
+ try {
6373
+ const displayE = 'body is required';
6374
+ runErrorAsserts(data, error, 'AD.300', 'Test-zscaler-adapter-postUrlCategoriesReviewDomain', displayE);
6375
+ done();
6376
+ } catch (err) {
6377
+ log.error(`Test Failure: ${err}`);
6378
+ done(err);
6379
+ }
6380
+ });
6381
+ } catch (error) {
6382
+ log.error(`Adapter Exception: ${error}`);
6383
+ done(error);
6384
+ }
6385
+ }).timeout(attemptTimeout);
6386
+ });
6387
+
6388
+ describe('#putUrlCategoriesReviewDomainAddURLs - errors', () => {
6389
+ it('should have a putUrlCategoriesReviewDomainAddURLs function', (done) => {
6390
+ try {
6391
+ assert.equal(true, typeof a.putUrlCategoriesReviewDomainAddURLs === 'function');
6392
+ done();
6393
+ } catch (error) {
6394
+ log.error(`Test Failure: ${error}`);
6395
+ done(error);
6396
+ }
6397
+ }).timeout(attemptTimeout);
6398
+ it('should error if - missing body', (done) => {
6399
+ try {
6400
+ a.putUrlCategoriesReviewDomainAddURLs(null, (data, error) => {
6401
+ try {
6402
+ const displayE = 'body is required';
6403
+ runErrorAsserts(data, error, 'AD.300', 'Test-zscaler-adapter-putUrlCategoriesReviewDomainAddURLs', displayE);
6404
+ done();
6405
+ } catch (err) {
6406
+ log.error(`Test Failure: ${err}`);
6407
+ done(err);
6408
+ }
6409
+ });
6410
+ } catch (error) {
6411
+ log.error(`Adapter Exception: ${error}`);
6412
+ done(error);
6413
+ }
6414
+ }).timeout(attemptTimeout);
6415
+ });
6342
6416
  });
6343
6417
  });
@@ -1,9 +0,0 @@
1
- {
2
- "ComplianceEntries": [
3
- {
4
- "name": "Compliance Summary",
5
- "numInvalidProjects": 0,
6
- "numValidProjects": 0
7
- }
8
- ]
9
- }
@@ -1,5 +0,0 @@
1
- ---------------------------------------------------------------------------------------------
2
- **** Project Compliance Summary ****
3
- 0 project(s) are not valid
4
- 0 project(s) are valid
5
- ---------------------------------------------------------------------------------------------