Skip to content

Commit

Permalink
Zowe Suite v1.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Jun 2, 2021
2 parents 2f9c44a + 6bf6f78 commit fdac217
Show file tree
Hide file tree
Showing 27 changed files with 5,519 additions and 211 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ testem.log
.DS_Store
Thumbs.db

# VS Code settings
.vscode

# 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.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
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.

## 1.22.0

- Enhancement: Plugins can push state out to the Caching Service for high availability storage via a improved storage API, available to dataservices as `context.storage`
- Enhancement: Storage API V2 added which has parameters to specify whether plugin cache and state should be stored local to a worker, in the cluster, or remote for high availability
- Enhancement: Decrease verbosity and duplication of startup logs. Log messages omitted have been moved to debug messaging.
- Enhancement: Change missing swagger warning message to debug as it is a warning for developers, not for end users.
- Bugfix: Fix /server/agent route when using APIML
- Bugfix: Fix issue with CORS rejection when accessing zss through APIML gateway

## 1.21.0

- Bugfix: Use hostname given by zowe config in order to avoid errors from the hostname certificate matching when accessing the app server through APIML
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Contributing
============

Contributions are encouraged from anyone! Every little bit helps, and credit will always be given.
Please see the contributing guidelines in [the zlux repository](https://github.com/zowe/zlux/blob/master/CONTRIBUTING.md)
7 changes: 7 additions & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ proxy.conf.json
.DS_Store
Thumbs.db

# TS Output files
jarManager.js
javaManager.js
javaTypes.js
tomcatManager.js
apimlStorage.js
pluginStorage.js

# This program and the accompanying materials are
# made available under the terms of the Eclipse Public License v2.0 which accompanies
Expand Down
37 changes: 26 additions & 11 deletions lib/apiml.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const MEDIATION_LAYER_EUREKA_DEFAULTS = {
};


const MEDIATION_LAYER_INSTANCE_DEFAULTS = {
const MEDIATION_LAYER_INSTANCE_DEFAULTS = (zluxProto, zluxHostname, zluxPort) => { return {
instanceId: "localhost:zowe-zlux:8543",
app: "zlux",
hostName: "localhost",
Expand Down Expand Up @@ -74,9 +74,11 @@ const MEDIATION_LAYER_INSTANCE_DEFAULTS = {
'mfaas.api-info.apiVersionProperties.v1.title': 'Zowe Application Server API',
'mfaas.api-info.apiVersionProperties.v1.description': 'An API for the ZLux '
+' Proxy Server',
'mfaas.api-info.apiVersionProperties.v1.version': '1.0.0'
'mfaas.api-info.apiVersionProperties.v1.version': '1.0.0',
'mfaas.api-info.apiVersionProperties.v1.version': '1.0.0',
'apiml.apiInfo.api-v1.swaggerUrl':`${zluxProto}://${zluxHostname}:${zluxPort}/api-docs/server`
}
};
}};

function ApimlConnector({ hostName, httpPort, httpsPort, apimlHost,
apimlPort, tlsOptions, eurekaOverrides }) {
Expand Down Expand Up @@ -169,9 +171,6 @@ ApimlConnector.prototype = {
},

_makeMainInstanceProperties(overrides) {
const instance = Object.assign({}, MEDIATION_LAYER_INSTANCE_DEFAULTS);
Object.assign(instance, overrides);

const protocolObject = {
httpPort: this.httpPort,
httpsPort: this.httpsPort,
Expand Down Expand Up @@ -204,6 +203,8 @@ ApimlConnector.prototype = {
log.debug("ZWED0141I", proto, port); //log.debug("Protocol:", proto, "Port", port);
log.debug("ZWED0142I", JSON.stringify(protocolObject)); //log.debug("Protocol Object:", JSON.stringify(protocolObject));

const instance = Object.assign({}, MEDIATION_LAYER_INSTANCE_DEFAULTS(proto, this.hostName, port));
Object.assign(instance, overrides);
Object.assign(instance, {
instanceId: `${this.hostName}:zlux:${port}`,
hostName: this.hostName,
Expand Down Expand Up @@ -277,14 +278,28 @@ ApimlConnector.prototype = {
]};
log.info(`ZWED0020I`, url); //log.info(`Registering at ${url}...`);
log.debug("ZWED0145I", JSON.stringify(zluxProxyServerInstanceConfig)); //log.debug(`zluxProxyServerInstanceConfig ${JSON.stringify(zluxProxyServerInstanceConfig)}`)
const zluxServerEurekaClient = new eureka(zluxProxyServerInstanceConfig);
//zluxServerEurekaClient.logger.level('debug');
this.zluxServerEurekaClient = zluxServerEurekaClient;
const eurekaClient = new eureka(zluxProxyServerInstanceConfig);
//this library has a very simple logger that has the same function names as ours, so why not just use ours for better formatting
eurekaClient.logger = log;
let errorHandler = log.error;
let lastErrorMessage;
let hideTimingError = (...args) => {
if (args[0] == 'Problem making eureka request' || args[0] == 'Eureka request failed to endpoint') {
lastErrorMessage = args;
} else {
errorHandler(...args);
}
};
log.error = hideTimingError;
this.eurekaClient = eurekaClient;
const ipAddr = this.ipAddr;
const appServerUrl = `https://${this.apimlHost}:${this.apimlPort}/ui/v1/${zluxProxyServerInstanceConfig.instance.app}/`;
return new Promise(function (resolve, reject) {
zluxServerEurekaClient.start(function (error) {
return new Promise((resolve, reject) => {
eurekaClient.start((error) => {
//suppress expected errors (due to timing) by substituting logger temporarily, but capture last seen error and log it after restoring error logger on connect
log.error = errorHandler;
if (error) {
log.error(lastErrorMessage);
log.warn('ZWED0005W', error); //log.warn(error);
reject(error);
} else {
Expand Down
Loading

0 comments on commit fdac217

Please sign in to comment.