From 337495fdf6ef47ac6938996578046744112e6c13 Mon Sep 17 00:00:00 2001 From: Sergei Kurnevich Date: Wed, 24 Jan 2024 13:55:39 +0100 Subject: [PATCH 01/10] Bugfix for https and http addresses merge Signed-off-by: Sergei Kurnevich --- lib/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 6360a04e..6a3f2a1b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -514,10 +514,11 @@ module.exports.getBestHostname = function(zoweConfig) { } module.exports.getListeningAddresses = function(zoweConfig) { - let addrs = getHttpsListeningAddresses(zoweConfig); + let httpsAddrsCollection = getHttpsListeningAddresses(zoweConfig); + let addrs = [...httpsAddrsCollection]; let otherAddrs = getHttpListeningAddresses(zoweConfig); otherAddrs.forEach((addr)=> { - if (addrs.indexOf(addr) == -1) { addrs.push(otherAddrs); } + if (addrs.indexOf(addr) == -1) { addrs.push(addr); } }); return addrs; } From b9db5e34c9f6774e185c10098c589fed380f36b7 Mon Sep 17 00:00:00 2001 From: Sergei Kurnevich Date: Wed, 24 Jan 2024 14:20:54 +0100 Subject: [PATCH 02/10] Changelog Signed-off-by: Sergei Kurnevich --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 823b2322..66e05049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to the Zlux Server Framework package will be documented in this file.. This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section. +## 2.15.0 +- Bugfix: App-server could not run in HTTP mode for AT-TLS setup because it was not able to merge HTTPS and HTTP addresses. (#984) + ## 2.14.0 - Bugfix: App-server could not load when multiple discovery servers were present and the app-server was unable to reach the first one specified. Now, the app-server will iterate through the list of servers until an accessible one is reached. (#522) - Bugfix: App-server would not correctly detect when it was running in a high-availability configuration environment. (#521) From f16ae3786b4576f58312d9d7157b30d81f39ad2c Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 11:54:25 -0500 Subject: [PATCH 03/10] Bump axios 0.22.0 -> 1.6.7 Signed-off-by: Timothy Gerstel --- package-lock.json | 69 ++++++++++++++++++++++++++++++++++++----------- package.json | 8 +++--- 2 files changed, 58 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index dc770e65..48c0af25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@rocketsoftware/eureka-js-client": "~4.5.6", "@rocketsoftware/express-ws": "^5.0.0", "accept-language-parser": "~1.5.0", - "axios": "~0.22.0", + "axios": "^1.6.7", "bluebird": "~3.5.1", "body-parser": "~1.20.0", "cookie-parser": "~1.4.3", @@ -433,11 +433,26 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "node_modules/axios": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.22.0.tgz", - "integrity": "sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dependencies": { - "follow-redirects": "^1.14.4" + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" } }, "node_modules/balanced-match": { @@ -1245,9 +1260,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -2215,6 +2230,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -3326,11 +3346,25 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "axios": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.22.0.tgz", - "integrity": "sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "requires": { - "follow-redirects": "^1.14.4" + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } } }, "balanced-match": { @@ -3962,9 +3996,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" }, "forever-agent": { "version": "0.6.1", @@ -4660,6 +4694,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/package.json b/package.json index 6b3ddf2e..3a832ea7 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@rocketsoftware/eureka-js-client": "~4.5.6", "@rocketsoftware/express-ws": "^5.0.0", "accept-language-parser": "~1.5.0", - "axios": "~0.22.0", + "axios": "^1.6.7", "bluebird": "~3.5.1", "body-parser": "~1.20.0", "cookie-parser": "~1.4.3", @@ -69,8 +69,8 @@ "@types/connect": "3.4.35", "@types/express": "4.17.17", "@types/express-serve-static-core": "4.17.35", - "@types/node": "~14.0.0", "@types/mime": "3.0.1", + "@types/node": "~14.0.0", "@types/qs": "6.9.3", "chai": "~4.2.0", "chai-http": "~4.2.0", @@ -78,7 +78,7 @@ "typescript": "~5.0.0" }, "optionalDependencies": { - "keyring_js": "~1.1.0", - "fsevents": "~2.3.2" + "fsevents": "~2.3.2", + "keyring_js": "~1.1.0" } } From 1b98966d6c6d61e82096780b1a261141a7733c06 Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:11:47 -0500 Subject: [PATCH 04/10] Update type of headers in ApimlResponse interface Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index 7c28bdf2..1aa5e814 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -10,10 +10,10 @@ import * as https from 'https'; import * as http from 'http'; -import axios from 'axios'; +import axios, { AxiosHeaders } from 'axios'; import { AxiosInstance } from 'axios'; -let apimlClient: AxiosInstance; +let apimlClient: AxiosResponseHeaders; export function configure(settings: ApimlStorageSettings) { apimlClient = axios.create({ @@ -56,7 +56,7 @@ interface KeyValuePair { interface ApimlResponse { statusCode: number; json?: any; - headers: http.IncomingHttpHeaders; + headers: AxiosHeaders; } export type ApimlStorageErrorCode = From 71b81c358ce4651cee8537d4970c20dbcc300183 Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:14:13 -0500 Subject: [PATCH 05/10] my mind went blank on the last commit Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index 1aa5e814..b847735e 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -10,10 +10,10 @@ import * as https from 'https'; import * as http from 'http'; -import axios, { AxiosHeaders } from 'axios'; +import axios, { AxiosResponseHeaders } from 'axios'; import { AxiosInstance } from 'axios'; -let apimlClient: AxiosResponseHeaders; +let apimlClient: AxiosInstance; export function configure(settings: ApimlStorageSettings) { apimlClient = axios.create({ @@ -56,7 +56,7 @@ interface KeyValuePair { interface ApimlResponse { statusCode: number; json?: any; - headers: AxiosHeaders; + headers: AxiosResponseHeaders; } export type ApimlStorageErrorCode = From aa4766bc1f709f3065faebe2e92cdb300f35395e Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:21:32 -0500 Subject: [PATCH 06/10] Add header instace type Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index b847735e..9a9f3874 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -10,8 +10,8 @@ import * as https from 'https'; import * as http from 'http'; -import axios, { AxiosResponseHeaders } from 'axios'; -import { AxiosInstance } from 'axios'; +import axios, { AxiosHeaders, RawAxiosRequestHeaders } from 'axios'; +import { AxiosInstance, } from 'axios'; let apimlClient: AxiosInstance; @@ -56,7 +56,7 @@ interface KeyValuePair { interface ApimlResponse { statusCode: number; json?: any; - headers: AxiosResponseHeaders; + headers: AxiosHeaders; } export type ApimlStorageErrorCode = @@ -162,7 +162,7 @@ async function apimlDoRequest(req: ApimlRequest): Promise { headers: req.headers, }); const apimlResponse: ApimlResponse = { - headers: response.headers, + headers: response.headers as RawAxiosRequestHeaders, statusCode: response.status, json: response.data }; From c94ce3dc617edc65f986138fb285bd9fa9badc92 Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:27:03 -0500 Subject: [PATCH 07/10] Test type any Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index 9a9f3874..9599170f 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -56,7 +56,7 @@ interface KeyValuePair { interface ApimlResponse { statusCode: number; json?: any; - headers: AxiosHeaders; + headers: any; } export type ApimlStorageErrorCode = @@ -162,7 +162,7 @@ async function apimlDoRequest(req: ApimlRequest): Promise { headers: req.headers, }); const apimlResponse: ApimlResponse = { - headers: response.headers as RawAxiosRequestHeaders, + headers: response.headers, statusCode: response.status, json: response.data }; From 620851e0bae9283e24eba7541c890e0a38a57fc8 Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:36:05 -0500 Subject: [PATCH 08/10] Theyre just http headers, right???? Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index 9599170f..d0498e3f 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -56,7 +56,7 @@ interface KeyValuePair { interface ApimlResponse { statusCode: number; json?: any; - headers: any; + headers: http.IncomingHttpHeaders; } export type ApimlStorageErrorCode = @@ -162,7 +162,7 @@ async function apimlDoRequest(req: ApimlRequest): Promise { headers: req.headers, }); const apimlResponse: ApimlResponse = { - headers: response.headers, + headers: response.headers as http.IncomingHttpHeaders, statusCode: response.status, json: response.data }; From cfb3d1bee4379b9fcae29d6b310362283aa2b59f Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:39:20 -0500 Subject: [PATCH 09/10] Remove unused eps Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index d0498e3f..4c57bcb1 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -10,7 +10,7 @@ import * as https from 'https'; import * as http from 'http'; -import axios, { AxiosHeaders, RawAxiosRequestHeaders } from 'axios'; +import axios from 'axios'; import { AxiosInstance, } from 'axios'; let apimlClient: AxiosInstance; From 05ff06fb0a6297c1b9fb9c25b587000c621c62cd Mon Sep 17 00:00:00 2001 From: Timothy Gerstel Date: Wed, 31 Jan 2024 12:57:03 -0500 Subject: [PATCH 10/10] Remove coma Signed-off-by: Timothy Gerstel --- lib/apimlStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apimlStorage.ts b/lib/apimlStorage.ts index 4c57bcb1..77314228 100644 --- a/lib/apimlStorage.ts +++ b/lib/apimlStorage.ts @@ -11,7 +11,7 @@ import * as https from 'https'; import * as http from 'http'; import axios from 'axios'; -import { AxiosInstance, } from 'axios'; +import { AxiosInstance } from 'axios'; let apimlClient: AxiosInstance;