-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathutil.js
575 lines (514 loc) · 22 KB
/
util.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/
'use strict';
if (!global.COM_RS_COMMON_LOGGER) {
const loggerFile = require('../../zlux-shared/src/logging/logger.js');
global.COM_RS_COMMON_LOGGER = new loggerFile.Logger();
global.COM_RS_COMMON_LOGGER.addDestination(global.COM_RS_COMMON_LOGGER.makeDefaultDestination(true,true,true,true,true));
}
const path = require('path');
const fs = require('fs');
const util = require('node:util');
const Promise = require('bluebird');
const ipaddr = require('ipaddr.js');
const dns = require('dns');
const dnsLookup = util.promisify(dns.lookup);
const mergeUtils = require('../utils/mergeUtils');
const forge = require('node-forge');
const loggers = {
bootstrapLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.bootstrap"),
authLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.auth"),
contentLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.static"),
childLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.child"),
utilLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.utils"),
proxyLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.proxy"),
installLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.install"),
apiml: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.apiml"),
routing: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.routing"),
network: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.network"),
langManager: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.lang"),
clusterLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.cluster"),
storeLogger: global.COM_RS_COMMON_LOGGER.makeComponentLogger("_zsf.store")
};
module.exports.loggers = loggers;
module.exports.initLoggerMessages = function initLoggerMessages(logLanguage) {
var messages;
let lang = logLanguage ? logLanguage : 'en';
try { // Attempt to get a log message for a language a user may have specified
var logFile = require(`./assets/i18n/log/messages_${lang}.json`);
messages = logFile;
if (lang != 'en') {
let logFileEN = require(`./assets/i18n/log/messages_en.json`);
messages = Object.assign(logFileEN, messages); // Merge the two, with the language-specific file
// overwriting the non-English one (so English messages get preserved even if no translations exist)
}
} catch (err) { // If we encountered an error...
console.log("ZWED0156W - 1 function initLoggerMessages - ERROR - ", err);
try {
if (messages) { // and 'messages' exist, then these messages came from a language file,
// but the EN language file lookup failed (that is why we are in this catch), so we are all done here.
}
else if (lang != 'en') { // If 'messages' does not exist, then the first 'logFile' lookup failed and put us here,
let logFileEN = require(`./assets/i18n/log/messages_en.json`); // so let's try English.
messages = logFileEN;
}
}
catch (err) { // If all else fails, create loggers without specified messages.
console.log("ZWED0157W - 2 function initLoggerMessages - ERROR - ", err);
messages = undefined;
}
}
if (messages) {
loggers.bootstrapLogger._messages = messages;
loggers.authLogger._messages = messages;
loggers.contentLogger._messages = messages;
loggers.childLogger._messages = messages;
loggers.utilLogger._messages = messages;
loggers.proxyLogger._messages = messages;
loggers.installLogger._messages = messages;
loggers.apiml._messages = messages;
loggers.routing._messages = messages;
loggers.network._messages = messages;
loggers.langManager._messages = messages;
loggers.clusterLogger._messages = messages;
loggers.storeLogger._messages = messages;
}
};
let zoweVersion = "0.0.0";
//This will read manifest.json within zowe's runtime directory, location known by zowe config.
module.exports.setZoweVersionFromManifest = function setZoweVersionFromManifest(zoweConfig) {
if (zoweConfig.zowe.runtimeDirectory) {
try {
const contents = fs.readFileSync(path.join(zoweConfig.zowe.runtimeDirectory, 'manifest.json'), {encoding: 'utf8'});
if (contents) {
const asJson = JSON.parse(contents);
if (asJson.version) {
zoweVersion = asJson.version;
} else {
loggers.utilLogger.severe('ZWED0159E');
}
}
} catch (e) {
loggers.utilLogger.severe('ZWED0159E');
}
}
}
module.exports.getZoweVersion = function getZoweVersion() {
return zoweVersion;
}
//maybe better in apiml.js but there would be a circular dependency around the logger init.
function getPrefixForService(serviceName, type, version) {
let typePath = type || 'api';
let versionPath = version || '1';
return `/${serviceName}/${typePath}/v${versionPath}`;
};
function getGatewayUrlForService(zoweConfig, includeProtocol, serviceName, type, version) {
const apimlConfig = zoweConfig.components['app-server'].node.mediationLayer.server;
return `${includeProtocol?'https://':''}${apimlConfig.gatewayHostname}:${apimlConfig.gatewayPort}${getPrefixForService(serviceName, type, version)}`;
};
module.exports.getGatewayUrlForService = getGatewayUrlForService;
module.exports.getPrefixForService = getPrefixForService;
module.exports.getAgentRequestOptions = function(zoweConfig, tlsOptions, includeCert, path) {
if (zoweConfig.components['app-server'] && zoweConfig.components['app-server'].node && zoweConfig.components['app-server'].agent && (zoweConfig.components['app-server'].agent.https || zoweConfig.components['app-server'].agent.http)) {
const agentConfig = zoweConfig.components['app-server'].agent;
const useApiml = !!(agentConfig.mediationLayer &&
agentConfig.mediationLayer.enabled &&
zoweConfig.components['app-server'].node.mediationLayer &&
zoweConfig.components['app-server'].node.mediationLayer.server);
const isHttps = !isClientAttls(zoweConfig) &&
(useApiml ||
(agentConfig.https && agentConfig.https.port) ||
(agentConfig.http && agentConfig.http.port && agentConfig.http.attls));
if (isHttps && !tlsOptions) {
console.log('return undefined, ishttps without tlsoptions');
return undefined;
}
let options;
if (useApiml) {
const apimlPrefix = getPrefixForService(agentConfig.mediationLayer.serviceName)
options = {
host: zoweConfig.components['app-server'].node.mediationLayer.server.gatewayHostname,
port: zoweConfig.components['app-server'].node.mediationLayer.server.gatewayPort,
protocol: isHttps ? 'https:' : 'http:',
rejectUnauthorized: !zoweConfig.components['app-server'].node.allowInvalidTLSProxy,
apimlPrefix: apimlPrefix,
path: path ? apimlPrefix + path : undefined,
requestProcessingOptions: {
headersToRemove: [ 'origin' ] // fixes issue with CORS in APIML
}
}
} else {
options = {
host: agentConfig.host,
port: agentConfig.https && agentConfig.https.port ? agentConfig.https.port : agentConfig.http.port,
protocol: isHttps ? 'https:' : 'http:',
rejectUnauthorized: !zoweConfig.components['app-server'].node.allowInvalidTLSProxy,
path: path
}
}
if ((typeof tlsOptions == 'object') && isHttps) {
options = Object.assign(options, tlsOptions);
delete options.key;
if (!includeCert) {
delete options.cert;
}
return options;
}
if (options.port && options.host) {
return options;
}
}
return undefined;
}
module.exports.resolveRelativePaths = function resolveRelativePaths(root, resolver, relativeTo) {
for (const key of Object.keys(root)) {
const value = root[key];
const valueType = typeof value;
if (valueType == 'object' && value) {
resolveRelativePaths(value, resolver, relativeTo);
} else if ((valueType == 'string') && value.startsWith('../')) {
const old = root[key];
root[key] = resolver(value, relativeTo);
}
}
};
module.exports.makeOptionsObject = function (defaultOptions, optionsIn) {
const o = Object.create(defaultOptions);
Object.assign(o, optionsIn);
return Object.seal(o);
};
module.exports.clone = function(obj) {
return JSON.parse(JSON.stringify(obj));
};
module.exports.deepFreeze = function deepFreeze(obj, seen) {
if (!seen) {
seen = new Map();
}
if (seen.get(obj)) {
return;
}
seen.set(obj, true);
const propNames = Object.getOwnPropertyNames(obj);
for (const name of propNames) {
const prop = obj[name];
if (typeof prop == 'object' && prop !== null) {
deepFreeze(prop, seen);
}
}
return Object.freeze(obj);
};
module.exports.readOnlyProxy = function readOnlyProxy(obj) {
return new Proxy(obj, {
get: function(target, property) {
return target[property];
}
});
};
module.exports.getOrInit = function(obj, key, dflt) {
let value = obj[key];
if (!value) {
value = obj[key] = dflt;
}
return value;
};
module.exports.readFilesToArray = function(fileList, type, pass) {
var contentArray = [];
fileList.forEach(function(filePath) {
try {
let extension = filePath.split('.').pop();
let content = fs.readFileSync(filePath);
if(extension == 'p12' || extension == 'pfx'){
let p12Der = forge.util.decode64(content.toString('base64'));
let p12Asn1 = forge.asn1.fromDer(p12Der);
let p12;
try {
p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, pass || "password");
} catch (e1) {
loggers.bootstrapLogger.warn("ZWED0173W", e1.message);
p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, "");
}
const certData = p12.getBags({bagType: forge.pki.oids.certBag})[forge.pki.oids.certBag];
const keyData = p12.getBags({bagType: forge.pki.oids.pkcs8ShroudedKeyBag})[forge.pki.oids.pkcs8ShroudedKeyBag];
if(certData != undefined && type != 1 && type != 3){ //CRLs not currently supported by node forge
for(let i = 0; i < certData.length; i++){
let certObj = certData[i];
contentArray.push(Buffer.from(forge.pki.certificateToPem(certObj.cert), 'utf8'));
}
}
if(keyData != undefined && type == 1){
for(let i = 0; i < keyData.length; i++){
const rsaPrivateKey = forge.pki.privateKeyToAsn1(keyData[i].key);
const privateKeyInfo = forge.pki.wrapRsaPrivateKey(rsaPrivateKey);
let privateKeyPem = forge.pki.privateKeyInfoToPem(privateKeyInfo);
var buf = Buffer.from(privateKeyPem, 'utf8');
contentArray.push(buf);
}
}
} else {
if(!content.toString().includes('-----BEGIN')){
let der = forge.util.decode64(content.toString('base64'));
let derAsn1 = forge.asn1.fromDer(der);
if(type == 1){
let privateKeyInfo = forge.pki.wrapRsaPrivateKey(derAsn1);
let privateKeyPem = forge.pki.privateKeyInfoToPem(privateKeyInfo);
contentArray.push(Buffer.from(privateKeyPem, 'utf8'));
} else {
let asn1Cert = forge.pki.certificateFromAsn1(derAsn1);
let pem = forge.pki.certificateToPem(asn1Cert);
contentArray.push(Buffer.from(pem, 'utf8'));
}
} else {
contentArray.push(content);
}
}
} catch (e) {
loggers.bootstrapLogger.warn("ZWED0052W", filePath, e.message); //loggers.bootstrapLogger.warn('Error when reading file='+filePath+'. Error='+e.message);
}
});
if (contentArray.length > 0) {
return contentArray;
} else {
return null;
}
};
const errorProto = {
"_objectType": "org.zowe.zlux.error",
"_metaDataVersion": "1.0.0",
"returnCode": "1",
"messageID": "ZOE000E",
"messageTemplate": "An error occurred",
"messageParameters": {},
"messageDetails": "An error occurred when processing the request"
};
module.exports.makeErrorObject = function makeError(details) {
if ((details._objectType !== undefined)
|| (details._metaDataVersion !== undefined)) {
throw new Error("ZWED0049E - Can't specify error metadata");
}
const err = {};
Object.assign(err, errorProto);
Object.assign(err, details);
return err;
}
module.exports.concatIterables = function* concatIterables() {
for (let i=0; i < arguments.length; i++) {
yield *arguments[i];
}
}
/**
* Makes sure that the invocations of an asynchronous event handler are properly
* queued. Creates an event listener that wraps the asynchronous `listenerFun`
*
* `listenerFun` should return a promise
*/
module.exports.asyncEventListener = function(listenerFun, logger) {
//the handler for the most recent event: when this is resolved,
//another event can be handled
let promise = Promise.resolve();
return function(event) {
promise = promise.then(() => {
return listenerFun(event);
}, err => {
if (logger) {
logger.warn("ZWED0053W", err); //logger.warn("Event handler failed: " + err);
}
});
}
}
module.exports.uniqueIps = Promise.coroutine(function *uniqueIps(hostnames) {
if (hostnames == null) {
loggers.network.debug("ZWED0184I"); //loggers.network.debug("uniqueIps: no addresses specified, returning 0.0.0.0");
return [ '0.0.0.0' ];
}
let set = new Set();
for (let hostname of hostnames) {
if (typeof hostname == 'string') { //really... dnsLookup would not throw on a non-string such as false
try {
const ipAddress = yield dnsLookup(hostname);
//This used to yield a string and now yields an object that contains a string within.
if (typeof ipAddress == 'string') {
set.add(ipAddress);
} else {
set.add(ipAddress.address);
}
} catch (e) {
loggers.network.warn(`ZWED0054W`, hostname); //loggers.network.warn(`Skipping invalid listener address=${hostname}`);
}
} else {
loggers.network.warn(`ZWED0055W`, hostname); //loggers.network.warn(`Skipping invalid listener address=${hostname}`);
}
}
const arr = Array.from(set)
loggers.network.debug("ZWED0185I", arr); //loggers.network.debug("uniqueIps: " + arr);
return arr;
})
module.exports.getLoopbackAddress = function getLoopbackAddress(listenerAddresses) {
if (listenerAddresses == null || listenerAddresses.length === 0) {
loggers.network.debug("ZWED0186I"); //loggers.network.debug("getLoopbackAddress: no addresses specified, "
//+ "loopback address is 127.0.0.1");
return '127.0.0.1';
}
for (let addressString of listenerAddresses) {
try {
const address = ipaddr.process(addressString);
if (address.range() == 'loopback') {
const result = address.toString();
loggers.network.debug(`ZWED0187I`, result); //loggers.network.debug(`found loopback address ${result}`);
return result;
} else if (address.toNormalizedString() == '0.0.0.0') {
loggers.network.debug("ZWED0188I"); //loggers.network.debug("getLoopbackAddress: will listen on 0.0.0.0, "
//+ "loopback address is 127.0.0.1");
return '127.0.0.1';
}
} catch (e) {
loggers.network.warn(`ZWED0056W`, addressString); //loggers.network.warn(`Couldn't process ${addressString} as IP`);
}
}
loggers.network.warn("ZWED0057W", listenerAddresses, listenerAddresses[0]);
//`Loopback calls: localhost equivalent address not found in list ${listenerAddresses}. `
//+ `Using first address (${listenerAddresses[0]}); Verify firewall will allow this.`);
return listenerAddresses[0];
}
module.exports.formatErrorStatus = function formatErrorStatus(err, descriptions) {
const description = (descriptions[err.status] || err.status) + ": ";
const keywords = [];
for (let key of Object.keys(err)) {
if (key == "status") {
continue;
}
keywords.push(`${key}: ${err[key]}`);
}
return description + keywords.join(', ');
}
function normalizePath(oldPath, relativeTo) {
let normalized = oldPath;
if (!relativeTo) { relativeTo = process.cwd();}
if (!path.isAbsolute(oldPath)) {
normalized = path.normalize(path.join(relativeTo,oldPath));
}
if (normalized.endsWith(path.sep)) {
normalized = normalized.substring(0,normalized.length-1);
}
loggers.utilLogger.debug(`ZWED0051I`, oldPath, normalized); //loggers.utilLogger.info(`Resolved path: ${oldPath} -> ${normalized}`);
return normalized;
}
module.exports.normalizePath = normalizePath;
const defaultRemoteAppTemplate = fs.readFileSync(path.join(__dirname,'default-remote-app-template.html'),"utf-8");
module.exports.getRemoteIframeTemplate = function(remoteUrl) {
return defaultRemoteAppTemplate.replace('${remoteUrl}', remoteUrl);
}
module.exports.makeRemoteUrl = function(destination, req, zoweConfig) {
const nodeConfig = zoweConfig.components['app-server'].node;
let referer = req.get('Referer');
let hostname = !referer ? '' : new URL(referer).hostname;
loggers.utilLogger.debug(`referer: ${referer}`);
let zoweExternalHost;
let zoweExternalPort;
if(destination.includes('ZOWE_EXTERNAL_HOST') || destination.includes('ZWE_EXTERNAL_HOST')) {
if( hostname > '') {
zoweExternalHost = hostname;
} else if (zoweConfig.environments.ZWE_EXTERNAL_HOST) {
zoweExternalHost = zoweConfig.environments.ZWE_EXTERNAL_HOST;
} else if (zoweConfig.environments.ZOWE_EXTERNAL_HOST) {
zoweExternalHost = zoweConfig.environments.ZOWE_EXTERNAL_HOST;
} else {
zoweExternalHost = zoweConfig.zowe.externalDomains[0];
}
}
if (destination.includes('ZWE_EXTERNAL_PORT')) {
if (zoweConfig.zowe.externalPort) {
zoweExternalPort = zoweConfig.zowe.externalPort;
} else if (zoweConfig.environments.ZWE_EXTERNAL_PORT) {
zoweExternalPort = zoweConfig.environments.ZWE_EXTERNAL_PORT;
} else if (nodeConfig.mediationLayer && nodeConfig.mediationLayer.server && nodeConfig.mediationLayer.server.gatewayPort) {
zoweExternalPort = nodeConfig.mediationLayer.server.gatewayPort;
} else if (nodeConfig.https.port) {
zoweExternalPort = nodeConfig.https.port;
} else {
zoweExternalPort = nodeConfig.http.port;
}
}
return destination
.replace('${ZOWE_EXTERNAL_HOST}', zoweExternalHost)
.replace('${ZWE_EXTERNAL_HOST}', zoweExternalHost)
.replace('${GATEWAY_PORT}', nodeConfig.mediationLayer?.server?.gatewayPort)
.replace('${ZWE_EXTERNAL_PORT}', zoweExternalPort);
}
module.exports.isPluginExternal = (plugin) => {
return plugin.dataServices && plugin.dataServices.length>0 && plugin.dataServices[0].constructor.name === 'ExternalService'
}
module.exports.timeout = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
module.exports.serverSwaggerPluginId = 'org.zowe.zlux'
module.exports.agentSwaggerPluginId = 'org.zowe.zlux.agent';
module.exports.getCookieName = (cookieIdentifier) => {
return 'connect.sid.' + cookieIdentifier;
}
const HA_INSTANCE_COUNT=Object.keys(process.env).filter(key=>!key.match(/ZWE_haInstances_.*_components_.*hostname.*/)).filter(key=>key.match(/ZWE_haInstances_.*hostname/)).length;
const isHaMode = module.exports.isHaMode = function () {
let isHaMode = (!isNaN(HA_INSTANCE_COUNT) && HA_INSTANCE_COUNT > 1);
return isHaMode;
}
module.exports.isServerHttps = function(zoweConfig) {
return Number.isInteger(zoweConfig.components['app-server'].node.https?.port);
}
function isClientAttls(zoweConfig) {
let clientGlobalAttls = zoweConfig.zowe.network?.client?.tls?.attls;
let clientLocalAttls = zoweConfig.components['app-server'].zowe?.network?.client?.tls?.attls;
let clientAttls = clientGlobalAttls || clientLocalAttls;
if ((clientGlobalAttls !== false) && (clientLocalAttls !== false) && (!clientAttls)) {
// If client attls not explicitly false OR truthy, have client follow server attls variable. it simplifies common case in which users want both.
return zoweConfig.zowe.network?.server?.tls?.attls || zoweConfig.components['app-server'].zowe?.network?.server?.tls?.attls;
} else {
return clientAttls;
}
}
module.exports.isClientAttls = isClientAttls;
module.exports.getBestPort = function(zoweConfig) {
return zoweConfig.components['app-server'].node.https?.port
? zoweConfig.components['app-server'].node.https.port
: zoweConfig.components['app-server'].node.http.port;
}
module.exports.getBestHostname = function(zoweConfig) {
return zoweConfig.zowe.externalDomains[0];
}
module.exports.getListeningAddresses = function(zoweConfig) {
let httpsAddrsCollection = getHttpsListeningAddresses(zoweConfig);
let addrs = [...httpsAddrsCollection];
let otherAddrs = getHttpListeningAddresses(zoweConfig);
otherAddrs.forEach((addr)=> {
if (addrs.indexOf(addr) == -1) { addrs.push(addr); }
});
return addrs;
}
function getHttpListeningAddresses(zoweConfig) {
return zoweConfig.components['app-server'].node.http?.ipAddresses || [];
}
module.exports.getHttpListeningAddresses = getHttpListeningAddresses;
function getHttpsListeningAddresses(zoweConfig) {
return zoweConfig.components['app-server'].node.https?.ipAddresses || [];
}
module.exports.getHttpsListeningAddresses = getHttpsListeningAddresses;
module.exports.getProductCode = function(zoweConfig) {
return zoweConfig.components['app-server'].node.productCode;
}
module.exports.getRootRedirectUrl = function(zoweConfig) {
return zoweConfig.components['app-server'].node.rootRedirectUrl;
}
function getComponentConfig(zoweConfig) {
return zoweConfig.components['app-server'];
}
module.exports.getComponentConfig = getComponentConfig;
/*
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/