@itentialopensource/adapter-nokia_altiplano 0.7.2 → 0.7.4

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/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.7.4 [10-14-2024]
3
+
4
+ * Add config for refresh token
5
+
6
+ See merge request itentialopensource/adapters/adapter-nokia_altiplano!19
7
+
8
+ ---
9
+
10
+ ## 0.7.3 [09-13-2024]
11
+
12
+ * add workshop and fix vulnerabilities
13
+
14
+ See merge request itentialopensource/adapters/adapter-nokia_altiplano!16
15
+
16
+ ---
17
+
2
18
  ## 0.7.2 [08-14-2024]
3
19
 
4
20
  * Changes made at 2024.08.14_18:37PM
package/TAB2.md CHANGED
@@ -54,7 +54,7 @@ Sample Properties can be used to help you configure the adapter in the Itential
54
54
  "host": "localhost",
55
55
  "port": 443,
56
56
  "choosepath": "",
57
- "base_path": "/rest",
57
+ "base_path": "/nokia-altiplano-ac/rest",
58
58
  "version": "",
59
59
  "cache_location": "none",
60
60
  "encode_pathvars": false,
@@ -89,7 +89,14 @@ Sample Properties can be used to help you configure the adapter in the Itential
89
89
  "responseFields": {},
90
90
  "successfullResponseCode": 200
91
91
  }
92
- ]
92
+ ],
93
+ "refresh_token_request": {
94
+ "requestFields": {},
95
+ "refresh_token": {
96
+ "placement": "body",
97
+ "token_timeout": 86400000
98
+ }
99
+ }
93
100
  },
94
101
  "healthcheck": {
95
102
  "type": "none",
@@ -29,6 +29,31 @@
29
29
  }
30
30
  ]
31
31
  },
32
+ {
33
+ "name": "getRefreshToken",
34
+ "protocol": "REST",
35
+ "method": "POST",
36
+ "entitypath": "{base_path}/{version}/auth/refreshAccessToken",
37
+ "requestSchema": "refreshTokenRequest.json",
38
+ "responseSchema": "schemaTokenResp.json",
39
+ "timeout": 0,
40
+ "sendEmpty": false,
41
+ "requestDatatype": "URLENCODE",
42
+ "responseDatatype": "JSON",
43
+ "headers": {},
44
+ "sso": {
45
+ "protocol": "",
46
+ "host": "",
47
+ "port": 0
48
+ },
49
+ "responseObjects": [
50
+ {
51
+ "type": "default",
52
+ "key": "",
53
+ "mockFile": "mockdatafiles/getRefreshToken-default.json"
54
+ }
55
+ ]
56
+ },
32
57
  {
33
58
  "name": "healthcheck",
34
59
  "protocol": "REST",
@@ -0,0 +1,6 @@
1
+ {
2
+ "refreshToken":"refreshtoken1",
3
+ "token_type":"bearer",
4
+ "accessToken":"accesstoken1",
5
+ "expires_in":7200
6
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "refreshTokenRequest.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": false,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "getRefreshToken",
12
+ "enum": [
13
+ "getRefreshToken"
14
+ ],
15
+ "external_name": "ph_request_type"
16
+ },
17
+ "refreshToken": {
18
+ "type": "string",
19
+ "description": "refresh token",
20
+ "parse": false,
21
+ "encode": false,
22
+ "encrypt": {
23
+ "type": "AES",
24
+ "key": ""
25
+ },
26
+ "external_name": "refresh_token"
27
+ }
28
+ },
29
+ "definitions": {}
30
+ }
@@ -10,7 +10,8 @@
10
10
  "description": "type of request (internal to adapter)",
11
11
  "default": "getToken",
12
12
  "enum": [
13
- "getToken"
13
+ "getToken",
14
+ "getRefreshToken"
14
15
  ],
15
16
  "external_name": "ph_request_type"
16
17
  },
@@ -47,6 +48,18 @@
47
48
  "key": ""
48
49
  },
49
50
  "external_name": "accessToken"
51
+ },
52
+ "refreshToken": {
53
+ "type": "string",
54
+ "description": "refresh token returned by system",
55
+ "parse": false,
56
+ "encode": false,
57
+ "placement": "BODY",
58
+ "encrypt": {
59
+ "type": "AES",
60
+ "key": ""
61
+ },
62
+ "external_name": "refreshToken"
50
63
  }
51
64
  },
52
65
  "definitions": {}
package/metadata.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "adapter-nokia_altiplano",
3
3
  "webName": "Adapter for Integration to Nokia Altiplano",
4
+ "supportLevel": "community",
4
5
  "vendor": "Nokia",
5
6
  "product": "Altiplano",
7
+ "techAlliance": false,
6
8
  "osVersion": [],
7
9
  "apiVersions": [],
8
10
  "iapVersions": [
@@ -29,7 +31,7 @@
29
31
  "Determine configuration drift",
30
32
  "Golden Configuration",
31
33
  "Port/VLAN Configuration",
32
- "EVPN & VXLA",
34
+ "EVPN & VXLAN",
33
35
  "Port Turn-up",
34
36
  "Assign Network & IP",
35
37
  "Cloud Managed Networks",
@@ -49,7 +51,7 @@
49
51
  "storeLink": "",
50
52
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-nokia_altiplano",
51
53
  "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-nokia_altiplano",
52
- "docLink": "https://docs.itential.com/opensource/docs/nokia-altiplano",
54
+ "docLink": "https://gitlab.com/itentialopensource/adapters/adapter-nokia_altiplano/-/blob/master/README.md?ref_type=heads",
53
55
  "demoLinks": [],
54
56
  "trainingLinks": [
55
57
  {
@@ -81,7 +83,5 @@
81
83
  "workflowProjects": [],
82
84
  "transformationProjects": [],
83
85
  "exampleProjects": []
84
- },
85
- "supportLevel": "community",
86
- "techAlliance": false
86
+ }
87
87
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-nokia_altiplano",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "This adapter integrates with system described as: Nokia Altiplano.",
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",
@@ -54,7 +54,7 @@
54
54
  "author": "Itential",
55
55
  "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-nokia_altiplano#readme",
56
56
  "dependencies": {
57
- "@itentialopensource/adapter-utils": "^5.6.0",
57
+ "@itentialopensource/adapter-utils": "^5.9.4",
58
58
  "acorn": "^8.12.1",
59
59
  "ajv": "^8.17.1",
60
60
  "axios": "^1.7.4",
@@ -69,7 +69,7 @@
69
69
  "prompts": "^2.4.2",
70
70
  "readline-sync": "^1.4.10",
71
71
  "semver": "^7.6.3",
72
- "winston": "^3.13.1"
72
+ "winston": "^3.14.2"
73
73
  },
74
74
  "devDependencies": {
75
75
  "chai": "^4.3.7",
@@ -341,6 +341,29 @@
341
341
  }
342
342
  }
343
343
  }
344
+ },
345
+ "refresh_token_request": {
346
+ "type": "object",
347
+ "properties": {
348
+ "requestFields": {
349
+ "type": "object",
350
+ "description": "Params used in the refresh token call"
351
+ },
352
+ "refresh_token": {
353
+ "type": "object",
354
+ "description": "Refresh token fields",
355
+ "properties": {
356
+ "placement": {
357
+ "type": "string",
358
+ "description": "Where to place refresh token"
359
+ },
360
+ "token_timeout": {
361
+ "type": "integer",
362
+ "description": "How long a token is valid (in milliseconds)"
363
+ }
364
+ }
365
+ }
366
+ }
344
367
  }
345
368
  },
346
369
  "required": [
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.6.3",
3
- "configLines": 4352,
2
+ "version": "0.7.3",
3
+ "configLines": 4375,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 4202,
6
- "testLines": 4740,
7
- "testCases": 228,
8
- "totalCodeLines": 10725,
6
+ "testLines": 4724,
7
+ "testCases": 227,
8
+ "totalCodeLines": 10709,
9
9
  "wfTasks": 49
10
10
  }
@@ -5,7 +5,7 @@
5
5
  "host": "localhost",
6
6
  "port": 443,
7
7
  "choosepath": "",
8
- "base_path": "/rest",
8
+ "base_path": "/nokia-altiplano-ac/rest",
9
9
  "version": "",
10
10
  "cache_location": "none",
11
11
  "encode_pathvars": false,
@@ -40,7 +40,14 @@
40
40
  "responseFields": {},
41
41
  "successfullResponseCode": 200
42
42
  }
43
- ]
43
+ ],
44
+ "refresh_token_request": {
45
+ "requestFields": {},
46
+ "refresh_token": {
47
+ "placement": "body",
48
+ "token_timeout": 86400000
49
+ }
50
+ }
44
51
  },
45
52
  "healthcheck": {
46
53
  "type": "none",
@@ -135,7 +142,7 @@
135
142
  "ostypePrefix": "meraki-",
136
143
  "port": "{port}",
137
144
  "ipaddress": "{ip_addr}",
138
- "serial" : "{serial}"
145
+ "serial": "{serial}"
139
146
  }
140
147
  }
141
148
  ],
@@ -161,7 +168,7 @@
161
168
  "ostypePrefix": "meraki-",
162
169
  "port": "{port}",
163
170
  "ipaddress": "{ip_addr}",
164
- "serial" : "{serial}",
171
+ "serial": "{serial}",
165
172
  "id": "{myid}"
166
173
  }
167
174
  }
@@ -245,7 +252,7 @@
245
252
  "ostypePrefix": "meraki-",
246
253
  "port": "{port}",
247
254
  "ipaddress": "{ip_addr}",
248
- "serial" : "{serial}",
255
+ "serial": "{serial}",
249
256
  "id": "{myid}"
250
257
  }
251
258
  }
@@ -4,7 +4,6 @@
4
4
  /* eslint no-unused-vars: warn */
5
5
 
6
6
  const assert = require('assert');
7
- const http = require('http');
8
7
  const https = require('https');
9
8
  const mocha = require('mocha');
10
9
  const ping = require('ping');
@@ -53,29 +52,6 @@ describe('[integration] Adapter Test', () => {
53
52
  });
54
53
  });
55
54
 
56
- it('Support HTTP on port 80', (done) => {
57
- const requestOptions = {
58
- host,
59
- port: 80,
60
- method: 'HEAD'
61
- };
62
-
63
- const req = http.request(requestOptions, (res) => {
64
- try {
65
- assert.ok(res.statusCode >= 200 && res.statusCode < 400);
66
- done();
67
- } catch (error) {
68
- done(error);
69
- }
70
- });
71
-
72
- req.on('error', (err) => {
73
- done(err);
74
- });
75
-
76
- req.end();
77
- });
78
-
79
55
  it('Support HTTPS on port 443', (done) => {
80
56
  const requestOptions = {
81
57
  host,
@@ -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
  }
@@ -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] Nokia_altiplano 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] Nokia_altiplano 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', () => {
@@ -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
- ---------------------------------------------------------------------------------------------