Skip to content

Commit

Permalink
Zowe Suite v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Apr 13, 2022
2 parents a3fa932 + 09e6850 commit 6dc1756
Show file tree
Hide file tree
Showing 14 changed files with 2,917 additions and 74 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: '[Prep 2] Setup Node'
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- name: '[Prep 3] Setup jFrog CLI'
uses: jfrog/setup-jfrog-cli@v2
Expand Down Expand Up @@ -99,3 +99,4 @@ jobs:

- name: '[Prep 7] deploy'
uses: zowe-actions/zlux-builds/core/[email protected]/main

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.

## 2.0.0

- Breaking change: The list of properties sent back from the /server/environment has changed to reflect the different environment values present in Zowe v2
- Breaking change: When paired with the Zowe server infrastructure, the app-server will now automatically register and de-register plugins at startup depending on each plugin's component enabled status.
- Breaking change: Adjusted the server to respect ZSS's new cookie format in which the port or HA instance ID is a suffix of the ZSS cookie. This means the server may not work properly when paired with a v1 ZSS, and works best with v2 ZSS.
- Enhancement: Added support for reading zowe.yaml directly, as opposed to server.json.
- Enhancement: The server can now support checks on the existence and version of APIML if a plugin states a dependency on APIML in the "requirements.components" section of its plugin definition.
- Enhancement: The list of parameters for server configuration are now documented in json-schema for validation, you can find this in [the zlux repository](https://github.com/zowe/zlux/tree/v2.x/staging/schemas)

## 1.28.0

- Bugfix: keyring_js did not worked properly for finding CAs due to using an older version in package.json than needed for the listKeyring function
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ this distribution, and is available at https://www.eclipse.org/legal/epl-v20.htm
SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zowe Project.

# zlux-server-framework
This is a framework for the construction of a Zowe App Server instance. It is an HTTP, HTTPS, and Websocket server built upon NodeJS and ExpressJS. It serves static content via "Plugins", and is extensible by REST and Websocket "Dataservices" optionally present within Plugins.

The js folder contains the core bootstrapping and routing of the server, while the plugins folder contains plugins with essential dataservices.
For more information about how to make use of this server framework, such as how to build dataservices or Apps, checkout the [zLUX wiki](https://github.com/zowe/zlux/wiki)
For more information about how to make use of this server framework, such as how to build dataservices or Apps, checkout the [Developer documentation](https://docs.zowe.org/stable/extend/extend-desktop/mvd-extendingzlux)
For a ready-to-use server built on this framework, try out the [zlux-app-server](https://github.com/zowe/zlux-app-server), which includes a README on how to set it up.

### Tests
This repository contains some tests with the `/test` folder. Some tests will contain a package.json that has individual script commands to test them. Others, it is recommended to run individual tests with,
```
node <test name> <optional args>
```

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.
3 changes: 2 additions & 1 deletion lib/apiml.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const MEDIATION_LAYER_INSTANCE_DEFAULTS = (zluxProto, zluxHostname, zluxPort) =>
+' Proxy Server',
'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`
'apiml.apiInfo.api-v1.swaggerUrl':`${zluxProto}://${zluxHostname}:${zluxPort}/api-docs/server`,
'apiml.authentication.scheme': 'zoweJwt'
}
}};

Expand Down
7 changes: 3 additions & 4 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,14 @@ module.exports.getRemoteIframeTemplate = function(remoteUrl) {

module.exports.makeRemoteUrl = function(destination, req, serverConfig) {
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;
if( referer > '') {
zoweExternalHost = referer.split(':')[1].substring(2);
} else if (process.env.ZWE_EXTERNAL_HOST) {
zoweExternalHost = process.env.ZWE_EXTERNAL_HOST;
} else if (process.env.ZOWE_EXTERNAL_HOST) {
Expand Down
13 changes: 12 additions & 1 deletion lib/webauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,20 @@ module.exports = function(authManager, cookiePort, isSecurePort) {
const _doLogoutInner = Promise.coroutine(function*(req, res) {
//FIXME XSRF
const handlers = getRelevantHandlers(authManager, req.body);
const result = new LoginResult();
const result = new LoginResult();
let authServiceHandleMaps;
if (req[`${constants.APP_NAME}Data`] && req[`${constants.APP_NAME}Data`].webApp &&
req[`${constants.APP_NAME}Data`].webApp.authServiceHandleMaps) {
authServiceHandleMaps = req[`${constants.APP_NAME}Data`].webApp.authServiceHandleMaps
}

for (const handler of handlers) {
const pluginID = handler.pluginID;
if (authServiceHandleMaps) {
if (req[`${constants.APP_NAME}Data`].plugin) {
req[`${constants.APP_NAME}Data`].plugin.services = authServiceHandleMaps[pluginID];
}
}

let handlerResult;
if (handler.getCapabilities) {
Expand Down
Loading

0 comments on commit 6dc1756

Please sign in to comment.