@itentialopensource/adapter-opengear_lighthouse 0.1.7 → 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/TAB2.md ADDED
@@ -0,0 +1,319 @@
1
+ # Opengear Lighthouse
2
+
3
+ ## Table of Contents
4
+
5
+ - [Specific Adapter Information](#specific-adapter-information)
6
+ - [Authentication](#authentication)
7
+ - [Sample Properties](#sample-properties)
8
+ - [Swagger](#swagger)
9
+ - [Generic Adapter Information](#generic-adapter-information)
10
+
11
+ ## Specific Adapter Information
12
+ ### Authentication
13
+
14
+ This document will go through the steps for authenticating the Opengear Lighthouse adapter with Session Id Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
+
16
+ Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
17
+
18
+ #### Session Id Authentication
19
+ The Opengear Lighthouse adapter authenticates using Session Id Authentication.
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a Opengear Lighthouse server and that it is running
23
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
24
+ 3. Use the properties below for the ```properties.authentication``` field
25
+ ```json
26
+ "authentication": {
27
+ "auth_method": "request_token",
28
+ "username": "<your username>",
29
+ "password": "<your password>",
30
+ "token": "token",
31
+ "auth_field": "header.headers.Authorizaton",
32
+ "auth_field_format": "Token {token}",
33
+ "auth_logging": false
34
+ }
35
+ ```
36
+ you can leave all of the other properties in the authentication section, they will not be used when the auth_method is request_token.
37
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
38
+
39
+ #### Troubleshooting
40
+ - Make sure you copied over the correct credentials.
41
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
42
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
43
+ - Investigate the logs - in particular:
44
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
45
+ - The FULL BODY log to make sure the payload is accurate.
46
+ - The CALL RETURN log to see what the other system is telling us.
47
+ - Credentials should be ** masked ** by the adapter so make sure you verify token
48
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
49
+
50
+ ### Sample Properties
51
+
52
+ Sample Properties can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
53
+
54
+ ```json
55
+ "properties": {
56
+ "host": "localhost",
57
+ "port": 443,
58
+ "choosepath": "",
59
+ "base_path": "/api/v3.5",
60
+ "version": "",
61
+ "cache_location": "none",
62
+ "encode_pathvars": true,
63
+ "encode_queryvars": true,
64
+ "save_metric": false,
65
+ "stub": true,
66
+ "protocol": "https",
67
+ "authentication": {
68
+ "auth_method": "request_token",
69
+ "username": "username",
70
+ "password": "password",
71
+ "token": "token",
72
+ "token_timeout": 600000,
73
+ "token_cache": "local",
74
+ "invalid_token_error": 401,
75
+ "auth_field": "header.headers.Authorization",
76
+ "auth_field_format": "Token {token}",
77
+ "auth_logging": false,
78
+ "client_id": "",
79
+ "client_secret": "",
80
+ "grant_type": "",
81
+ "sensitive": [],
82
+ "multiStepAuthCalls": [
83
+ {
84
+ "name": "",
85
+ "requestFields": {},
86
+ "responseFields": {},
87
+ "successfullResponseCode": 200
88
+ }
89
+ ],
90
+ "sso": {
91
+ "protocol": "",
92
+ "host": "",
93
+ "port": 0
94
+ }
95
+ },
96
+ "healthcheck": {
97
+ "type": "none",
98
+ "frequency": 60000,
99
+ "query_object": {},
100
+ "addlHeaders": {}
101
+ },
102
+ "throttle": {
103
+ "throttle_enabled": false,
104
+ "number_pronghorns": 1,
105
+ "sync_async": "sync",
106
+ "max_in_queue": 1000,
107
+ "concurrent_max": 1,
108
+ "expire_timeout": 0,
109
+ "avg_runtime": 200,
110
+ "priorities": [
111
+ {
112
+ "value": 0,
113
+ "percent": 100
114
+ }
115
+ ]
116
+ },
117
+ "request": {
118
+ "number_redirects": 0,
119
+ "number_retries": 3,
120
+ "limit_retry_error": [
121
+ 0
122
+ ],
123
+ "failover_codes": [],
124
+ "attempt_timeout": 5000,
125
+ "global_request": {
126
+ "payload": {},
127
+ "uriOptions": {},
128
+ "addlHeaders": {},
129
+ "authData": {}
130
+ },
131
+ "healthcheck_on_timeout": true,
132
+ "return_raw": false,
133
+ "archiving": false,
134
+ "return_request": false
135
+ },
136
+ "proxy": {
137
+ "enabled": false,
138
+ "host": "",
139
+ "port": 1,
140
+ "protocol": "http",
141
+ "username": "",
142
+ "password": ""
143
+ },
144
+ "ssl": {
145
+ "ecdhCurve": "",
146
+ "enabled": false,
147
+ "accept_invalid_cert": false,
148
+ "ca_file": "",
149
+ "key_file": "",
150
+ "cert_file": "",
151
+ "secure_protocol": "",
152
+ "ciphers": ""
153
+ },
154
+ "mongo": {
155
+ "host": "",
156
+ "port": 0,
157
+ "database": "",
158
+ "username": "",
159
+ "password": "",
160
+ "replSet": "",
161
+ "db_ssl": {
162
+ "enabled": false,
163
+ "accept_invalid_cert": false,
164
+ "ca_file": "",
165
+ "key_file": "",
166
+ "cert_file": ""
167
+ }
168
+ },
169
+ "devicebroker": {
170
+ "enabled": false,
171
+ "getDevice": [
172
+ {
173
+ "path": "/not/mapped",
174
+ "method": "GET",
175
+ "query": {},
176
+ "body": {},
177
+ "headers": {},
178
+ "handleFailure": "ignore",
179
+ "requestFields": {
180
+ "insample": "{port}"
181
+ },
182
+ "responseDatakey": "",
183
+ "responseFields": {
184
+ "name": "{this}{||}{that}",
185
+ "ostype": "{osfield}",
186
+ "ostypePrefix": "meraki-",
187
+ "port": "{port}",
188
+ "ipaddress": "{ip_addr}",
189
+ "serial": "{serial}"
190
+ }
191
+ }
192
+ ],
193
+ "getDevicesFiltered": [
194
+ {
195
+ "path": "/not/mapped",
196
+ "method": "GET",
197
+ "pagination": {
198
+ "offsetVar": "",
199
+ "limitVar": "",
200
+ "incrementBy": "limit",
201
+ "requestLocation": "query"
202
+ },
203
+ "query": {},
204
+ "body": {},
205
+ "headers": {},
206
+ "handleFailure": "ignore",
207
+ "requestFields": {},
208
+ "responseDatakey": "",
209
+ "responseFields": {
210
+ "name": "{this}{||}{that}",
211
+ "ostype": "{osfield}",
212
+ "ostypePrefix": "meraki-",
213
+ "port": "{port}",
214
+ "ipaddress": "{ip_addr}",
215
+ "serial": "{serial}",
216
+ "id": "{myid}"
217
+ }
218
+ }
219
+ ],
220
+ "isAlive": [
221
+ {
222
+ "path": "/not/mapped/{devID}",
223
+ "method": "GET",
224
+ "query": {},
225
+ "body": {},
226
+ "headers": {},
227
+ "handleFailure": "ignore",
228
+ "requestFields": {
229
+ "devID": "{id}"
230
+ },
231
+ "responseDatakey": "",
232
+ "responseFields": {
233
+ "status": "return2xx",
234
+ "statusValue": "AD.200"
235
+ }
236
+ }
237
+ ],
238
+ "getConfig": [
239
+ {
240
+ "path": "/not/mapped/{devID}",
241
+ "method": "GET",
242
+ "query": {},
243
+ "body": {},
244
+ "headers": {},
245
+ "handleFailure": "ignore",
246
+ "requestFields": {
247
+ "devID": "{id}"
248
+ },
249
+ "responseDatakey": "",
250
+ "responseFields": {}
251
+ }
252
+ ],
253
+ "getCount": [
254
+ {
255
+ "path": "/not/mapped",
256
+ "method": "GET",
257
+ "query": {},
258
+ "body": {},
259
+ "headers": {},
260
+ "handleFailure": "ignore",
261
+ "requestFields": {},
262
+ "responseDatakey": "",
263
+ "responseFields": {}
264
+ }
265
+ ]
266
+ },
267
+ "cache": {
268
+ "enabled": false,
269
+ "entities": [
270
+ {
271
+ "entityType": "device",
272
+ "frequency": 3600,
273
+ "flushOnFail": false,
274
+ "limit": 10000,
275
+ "retryAttempts": 5,
276
+ "sort": true,
277
+ "populate": [
278
+ {
279
+ "path": "/not/mapped",
280
+ "method": "GET",
281
+ "pagination": {
282
+ "offsetVar": "",
283
+ "limitVar": "",
284
+ "incrementBy": "limit",
285
+ "requestLocation": "query"
286
+ },
287
+ "query": {},
288
+ "body": {},
289
+ "headers": {},
290
+ "handleFailure": "ignore",
291
+ "requestFields": {},
292
+ "responseDatakey": "",
293
+ "responseFields": {
294
+ "name": "{this}{||}{that}",
295
+ "ostype": "{osfield}",
296
+ "ostypePrefix": "meraki-",
297
+ "port": "{port}",
298
+ "ipaddress": "{ip_addr}",
299
+ "serial": "{serial}",
300
+ "id": "{myid}"
301
+ }
302
+ }
303
+ ],
304
+ "cachedTasks": [
305
+ {
306
+ "name": "",
307
+ "filterField": "",
308
+ "filterLoc": ""
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ }
314
+ }
315
+ ```
316
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/controller-orchestrator/adapter-opengear_lighthouse/-/blob/master/report/adapter-openapi.json)
317
+
318
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/controller-orchestrator/adapter-opengear_lighthouse/-/blob/master/README.md)
319
+
@@ -0,0 +1,9 @@
1
+ {
2
+ "ComplianceEntries": [
3
+ {
4
+ "name": "Compliance Summary",
5
+ "numInvalidProjects": 0,
6
+ "numValidProjects": 0
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,5 @@
1
+ ---------------------------------------------------------------------------------------------
2
+ **** Project Compliance Summary ****
3
+ 0 project(s) are not valid
4
+ 0 project(s) are valid
5
+ ---------------------------------------------------------------------------------------------
@@ -4,7 +4,7 @@
4
4
  "name": "getToken",
5
5
  "protocol": "REST",
6
6
  "method": "POST",
7
- "entitypath": "{base_path}/{version}/login",
7
+ "entitypath": "{base_path}/{version}/sessions",
8
8
  "requestSchema": "schemaTokenReq.json",
9
9
  "responseSchema": "schemaTokenResp.json",
10
10
  "timeout": 0,
@@ -46,7 +46,7 @@
46
46
  "type": "AES",
47
47
  "key": ""
48
48
  },
49
- "external_name": "token"
49
+ "external_name": "session"
50
50
  }
51
51
  },
52
52
  "definitions": {}
package/metadata.json CHANGED
@@ -36,20 +36,37 @@
36
36
  "isDeprecated": false
37
37
  },
38
38
  "brokerSince": "",
39
+ "authMethods": [
40
+ {
41
+ "type": "Session Id",
42
+ "primary": true
43
+ }
44
+ ],
39
45
  "documentation": {
40
46
  "storeLink": "",
41
47
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-opengear_lighthouse",
42
- "repoLink": "https://gitlab.com/itentialopensource/adapters/controller-orchestrator/adapter-opengear_lighthouse",
48
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-opengear_lighthouse",
43
49
  "docLink": "",
44
50
  "demoLinks": [],
45
- "trainingLinks": [],
51
+ "trainingLinks": [
52
+ {
53
+ "title": "Itential Academy",
54
+ "link": "https://www.itential.com/itential-academy/"
55
+ }
56
+ ],
46
57
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
47
58
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
48
59
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
49
60
  "webLink": "",
50
- "vendorLink": "",
51
- "productLink": "",
52
- "apiLinks": []
61
+ "vendorLink": "https://opengear.com/",
62
+ "productLink": "https://opengear.com/products/lighthouse/",
63
+ "apiLinks": [
64
+ {
65
+ "title": "Lighthouse REST API documentation",
66
+ "link": "https://ftp.opengear.com/download/lighthouse_software/all/20.Q2.0/doc/og-rest-api-specification-v3-5.html",
67
+ "public": true
68
+ }
69
+ ]
53
70
  },
54
71
  "assets": [],
55
72
  "relatedItems": {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-opengear_lighthouse",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "This adapter integrates with system described as: lighthouseRestApi.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Opengear_lighthouse",
7
7
  "wizardVersion": "2.44.7",
8
- "engineVersion": "1.67.14",
8
+ "engineVersion": "1.67.19",
9
9
  "adapterType": "http",
10
10
  "scripts": {
11
11
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -16,7 +16,6 @@
16
16
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
17
17
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
18
18
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
19
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
20
19
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
21
20
  "adapter:install": "npm i && node utils/tbScript.js install",
22
21
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -45,20 +44,20 @@
45
44
  ],
46
45
  "license": "Apache-2.0",
47
46
  "engines": {
48
- "node": ">= 8.0.0",
47
+ "node": ">= 14.0.0",
49
48
  "npm": ">= 6.0.0"
50
49
  },
51
50
  "repository": {
52
51
  "type": "git",
53
- "url": "git@gitlab.com:itentialopensource/adapters/controller-orchestrator/adapter-opengear_lighthouse.git"
52
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-opengear_lighthouse.git"
54
53
  },
55
54
  "author": "Itential",
56
- "homepage": "https://gitlab.com/itentialopensource/adapters/controller-orchestrator/adapter-opengear_lighthouse#readme",
55
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-opengear_lighthouse#readme",
57
56
  "dependencies": {
58
- "@itentialopensource/adapter-utils": "^5.3.8",
57
+ "@itentialopensource/adapter-utils": "^5.3.10",
59
58
  "acorn": "^8.10.0",
60
59
  "ajv": "^8.12.0",
61
- "axios": "^1.6.7",
60
+ "axios": "^1.6.8",
62
61
  "commander": "^11.0.0",
63
62
  "dns-lookup-promise": "^1.0.4",
64
63
  "fs-extra": "^11.1.1",
@@ -66,7 +65,6 @@
66
65
  "mocha": "^10.3.0",
67
66
  "mocha-param": "^2.0.1",
68
67
  "mongodb": "^4.16.0",
69
- "nyc": "^15.1.0",
70
68
  "ping": "^0.4.4",
71
69
  "prompts": "^2.4.2",
72
70
  "readline-sync": "^1.4.10",
@@ -945,8 +945,12 @@
945
945
  "devicebroker": {
946
946
  "type": "object",
947
947
  "properties": {
948
- "getDevice": {
949
- "type": "array",
948
+ "enabled": {
949
+ "type": "boolean",
950
+ "description": "Whether or not the device broker calls have been mapped",
951
+ "default": false
952
+ },
953
+ "getDevice": { "type": "array",
950
954
  "description": "Broker call(s) to getDevice",
951
955
  "items": {
952
956
  "type": "object",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.4",
3
- "configLines": 14457,
2
+ "version": "0.1.8",
3
+ "configLines": 14461,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 16540,
6
- "testLines": 11053,
6
+ "testLines": 11052,
7
7
  "testCases": 559,
8
- "totalCodeLines": 29376,
8
+ "totalCodeLines": 29375,
9
9
  "wfTasks": 172
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 16
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 21
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.3.10"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 78
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 344
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 647
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 5277
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 333
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 4523
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 156
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 11253
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 489
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }