@itentialopensource/adapter-checkpoint_management 0.2.4 → 0.3.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/.eslintignore +1 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +52 -13
- 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 +228 -420
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +2359 -37
- package/adapterBase.js +1270 -238
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +5 -5
- package/entities/APISettings/action.json +3 -3
- package/entities/AccessLayer/action.json +6 -6
- package/entities/AccessRole/action.json +6 -6
- package/entities/AccessRule/action.json +6 -6
- package/entities/AccessSection/action.json +5 -5
- package/entities/AddressRange/action.json +6 -6
- package/entities/Administrator/action.json +7 -7
- package/entities/Application/action.json +6 -6
- package/entities/ApplicationCategory/action.json +6 -6
- package/entities/ApplicationGroup/action.json +6 -6
- package/entities/DNSDomain/action.json +6 -6
- package/entities/DataCenter/action.json +4 -4
- package/entities/DataCenterObject/action.json +5 -5
- package/entities/Domain/action.json +6 -6
- package/entities/DynamicObject/action.json +6 -6
- package/entities/GlobalAssignment/action.json +7 -7
- package/entities/GlobalDomain/action.json +3 -3
- package/entities/Group/action.json +6 -6
- package/entities/GroupWithExclusion/action.json +6 -6
- package/entities/Host/action.json +6 -6
- package/entities/IPS/action.json +5 -5
- package/entities/IPSExtendedAttributes/action.json +3 -3
- package/entities/LoginMessage/action.json +3 -3
- package/entities/Misc/action.json +15 -15
- package/entities/MultiDomainServerMDS/action.json +3 -3
- package/entities/MulticastAddressRange/action.json +6 -6
- package/entities/NATRule/action.json +6 -6
- package/entities/NATSection/action.json +5 -5
- package/entities/Network/action.json +6 -6
- package/entities/OPSECApplication/action.json +6 -6
- package/entities/Placeholder/action.json +2 -2
- package/entities/Policy/action.json +3 -3
- package/entities/PolicyPackage/action.json +6 -6
- package/entities/SecurityZone/action.json +6 -6
- package/entities/ServiceDCERPC/action.json +6 -6
- package/entities/ServiceGroup/action.json +6 -6
- package/entities/ServiceICMP/action.json +6 -6
- package/entities/ServiceICMP6/action.json +6 -6
- package/entities/ServiceOther/action.json +6 -6
- package/entities/ServiceRPC/action.json +6 -6
- package/entities/ServiceSCTP/action.json +6 -6
- package/entities/ServiceTCP/action.json +6 -6
- package/entities/ServiceUDP/action.json +6 -6
- package/entities/Session/action.json +10 -10
- package/entities/SessionManagement/action.json +7 -7
- package/entities/SimpleGateway/action.json +6 -6
- package/entities/Tags/action.json +6 -6
- package/entities/ThreatEmulation/action.json +2 -2
- package/entities/ThreatException/action.json +6 -6
- package/entities/ThreatExceptionGroup/action.json +6 -6
- package/entities/ThreatIndicator/action.json +6 -6
- package/entities/ThreatLayer/action.json +6 -6
- package/entities/ThreatProfile/action.json +6 -6
- package/entities/ThreatProtection/action.json +6 -6
- package/entities/ThreatRule/action.json +6 -6
- package/entities/Time/action.json +6 -6
- package/entities/TimeGroup/action.json +6 -6
- package/entities/TrustedClient/action.json +6 -6
- package/entities/UpdatableObject/action.json +5 -5
- package/entities/UpdatableObjectsRepository/action.json +3 -3
- package/entities/VPNCommunityMeshed/action.json +6 -6
- package/entities/VPNCommunityStar/action.json +6 -6
- package/entities/Wildcard/action.json +6 -6
- package/error.json +12 -0
- package/package.json +41 -18
- package/pronghorn.json +642 -74
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +472 -4
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1614705421970.json +95 -0
- package/report/updateReport1646177180887.json +95 -0
- package/report/updateReport1653864222137.json +120 -0
- package/sampleProperties.json +113 -12
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +29 -98
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +642 -109
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +74 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.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 +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +190 -0
- package/img/adapter.jpg +0 -0
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// Set globals
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint no-unused-vars: warn */
|
|
6
|
+
/* eslint no-underscore-dangle: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
6
8
|
|
|
7
9
|
// include required items for testing & logging
|
|
8
10
|
const assert = require('assert');
|
|
@@ -13,25 +15,39 @@ const winston = require('winston');
|
|
|
13
15
|
const { expect } = require('chai');
|
|
14
16
|
const { use } = require('chai');
|
|
15
17
|
const td = require('testdouble');
|
|
18
|
+
const util = require('util');
|
|
16
19
|
|
|
17
20
|
const anything = td.matchers.anything();
|
|
18
21
|
|
|
19
22
|
// stub and attemptTimeout are used throughout the code so set them here
|
|
20
23
|
let logLevel = 'none';
|
|
21
|
-
const stub = true;
|
|
22
24
|
const isRapidFail = false;
|
|
23
25
|
const isSaveMockData = false;
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
// read in the properties from the sampleProperties files
|
|
28
|
+
let adaptdir = __dirname;
|
|
29
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
31
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
32
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
33
|
+
}
|
|
34
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
25
35
|
|
|
26
36
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
27
37
|
// always check these in with bogus data!!!
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
46
|
+
if (samProps.request.attempt_timeout < 30000) {
|
|
47
|
+
samProps.request.attempt_timeout = 30000;
|
|
48
|
+
}
|
|
49
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
50
|
+
const { stub } = samProps;
|
|
35
51
|
|
|
36
52
|
// these are the adapter properties. You generally should not need to alter
|
|
37
53
|
// any of these after they are initially set up
|
|
@@ -43,94 +59,7 @@ global.pronghornProps = {
|
|
|
43
59
|
adapters: [{
|
|
44
60
|
id: 'Test-checkpoint_management',
|
|
45
61
|
type: 'CheckpointManagement',
|
|
46
|
-
properties:
|
|
47
|
-
host,
|
|
48
|
-
port,
|
|
49
|
-
base_path: '/api',
|
|
50
|
-
version: 'v1.0',
|
|
51
|
-
cache_location: 'none',
|
|
52
|
-
encode_pathvars: true,
|
|
53
|
-
save_metric: false,
|
|
54
|
-
stub,
|
|
55
|
-
protocol,
|
|
56
|
-
authentication: {
|
|
57
|
-
auth_method: 'basic user_password',
|
|
58
|
-
username,
|
|
59
|
-
password,
|
|
60
|
-
token: '',
|
|
61
|
-
invalid_token_error: 401,
|
|
62
|
-
token_timeout: -1,
|
|
63
|
-
token_cache: 'local',
|
|
64
|
-
auth_field: 'header.headers.Authorization',
|
|
65
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
|
|
66
|
-
},
|
|
67
|
-
healthcheck: {
|
|
68
|
-
type: 'startup',
|
|
69
|
-
frequency: 60000
|
|
70
|
-
},
|
|
71
|
-
throttle: {
|
|
72
|
-
throttle_enabled: false,
|
|
73
|
-
number_pronghorns: 1,
|
|
74
|
-
sync_async: 'sync',
|
|
75
|
-
max_in_queue: 1000,
|
|
76
|
-
concurrent_max: 1,
|
|
77
|
-
expire_timeout: 0,
|
|
78
|
-
avg_runtime: 200,
|
|
79
|
-
priorities: [
|
|
80
|
-
{
|
|
81
|
-
value: 0,
|
|
82
|
-
percent: 100
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
request: {
|
|
87
|
-
number_redirects: 0,
|
|
88
|
-
number_retries: 3,
|
|
89
|
-
limit_retry_error: 0,
|
|
90
|
-
failover_codes: [],
|
|
91
|
-
attempt_timeout: attemptTimeout,
|
|
92
|
-
global_request: {
|
|
93
|
-
payload: {},
|
|
94
|
-
uriOptions: {},
|
|
95
|
-
addlHeaders: {},
|
|
96
|
-
authData: {}
|
|
97
|
-
},
|
|
98
|
-
healthcheck_on_timeout: false,
|
|
99
|
-
return_raw: true,
|
|
100
|
-
archiving: false
|
|
101
|
-
},
|
|
102
|
-
proxy: {
|
|
103
|
-
enabled: false,
|
|
104
|
-
host: '',
|
|
105
|
-
port: 1,
|
|
106
|
-
protocol: 'http'
|
|
107
|
-
},
|
|
108
|
-
ssl: {
|
|
109
|
-
ecdhCurve: '',
|
|
110
|
-
enabled: sslenable,
|
|
111
|
-
accept_invalid_cert: sslinvalid,
|
|
112
|
-
ca_file: '',
|
|
113
|
-
key_file: '',
|
|
114
|
-
cert_file: '',
|
|
115
|
-
secure_protocol: '',
|
|
116
|
-
ciphers: ''
|
|
117
|
-
},
|
|
118
|
-
mongo: {
|
|
119
|
-
host: '',
|
|
120
|
-
port: 0,
|
|
121
|
-
database: '',
|
|
122
|
-
username,
|
|
123
|
-
password: '',
|
|
124
|
-
replSet: '',
|
|
125
|
-
db_ssl: {
|
|
126
|
-
enabled: false,
|
|
127
|
-
accept_invalid_cert: false,
|
|
128
|
-
ca_file: '',
|
|
129
|
-
key_file: '',
|
|
130
|
-
cert_file: ''
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
62
|
+
properties: samProps
|
|
134
63
|
}]
|
|
135
64
|
}
|
|
136
65
|
};
|
|
@@ -305,7 +234,7 @@ function saveMockData(entityName, actionName, descriptor, responseData) {
|
|
|
305
234
|
}
|
|
306
235
|
|
|
307
236
|
// require the adapter that we are going to be using
|
|
308
|
-
const CheckpointManagement = require('../../adapter
|
|
237
|
+
const CheckpointManagement = require('../../adapter');
|
|
309
238
|
|
|
310
239
|
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
311
240
|
describe('[integration] Checkpoint_Management Adapter Test', () => {
|
|
@@ -336,6 +265,8 @@ describe('[integration] Checkpoint_Management Adapter Test', () => {
|
|
|
336
265
|
try {
|
|
337
266
|
assert.notEqual(null, a);
|
|
338
267
|
assert.notEqual(undefined, a);
|
|
268
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
269
|
+
assert.equal(checkId, a.id);
|
|
339
270
|
assert.notEqual(null, a.allProps);
|
|
340
271
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
341
272
|
assert.equal(check, a.healthcheckType);
|