Skip to content

Commit

Permalink
Zowe Suite v2.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored May 31, 2023
2 parents 4d7237a + 327e290 commit aa54397
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
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.9.0

- Enhancement: zowe.certificates.pem is no longer needed when using keyrings (#448)

## 2.8.0

- Enhancement: Support zowe.verifyCertificates=NONSTRICT (#468)
Expand Down
51 changes: 30 additions & 21 deletions lib/webserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ function parseSafKeyringAddress(safEntry) {
const userId = safEntry.substring(0,endUserIndex);
const endNameIndex = safEntry.indexOf('&',endUserIndex+1);
if (endNameIndex == -1 || endNameIndex == safEntry.length-1) {
return null;
return {
userId,
keyringName: safEntry.substring(endUserIndex+1,endNameIndex)
}
} else {
return {
userId,
Expand Down Expand Up @@ -275,31 +278,37 @@ WebServer.prototype = {
}
}
config.https.ipAddresses = uniqueIps;
if(keyring_js && process.env.KEYSTORE_TYPE == 'JCERACFKS') {
const keyringOwner = process.env.KEYRING_OWNER;
const keyringName = process.env.KEYRING_NAME;
let certificateList;
if (!config.https.certificateAuthorities) {
config.https.certificateAuthorities = [];
}
if(keyringOwner && keyringName) {
try {
certificateList = keyring_js.listKeyring(keyringOwner, keyringName);
} catch(e) {
bootstrapLogger.warn('ZWED0179W', keyringName, keyringOwner, e);
}
}
if(certificateList) {
for(let i = 0; i < certificateList.length; i++) {
if(certificateList[i].usage === 'CERTAUTH') {
let safKeyring = `safkeyring:////${keyringOwner}/${keyringName}&${certificateList[i].label}`;
if(config.https.certificateAuthorities.indexOf(safKeyring) === -1) {
config.https.certificateAuthorities.push(safKeyring);
let newEntries = [];
if(keyring_js && config.https.certificateAuthorities) {
for (let j = 0; j < config.https.certificateAuthorities.length; j++) {
const entry = config.https.certificateAuthorities[j];
if (!entry.startsWith('safkeyring://')) {
//keep
newEntries.push(entry);
} else {
const {owner, ringName, label} = parseSafKeyringAddress(entry);
let certificateList;
if(owner && ringName) {
try {
certificateList = keyring_js.listKeyring(owner, ringName);
} catch(e) {
bootstrapLogger.warn('ZWED0179W', ringName, owner, e);
}
}
if(certificateList) {
for(let i = 0; i < certificateList.length; i++) {
if(certificateList[i].usage === 'CERTAUTH') {
let safKeyring = `${entry}&${certificateList[i].label}`;
if(config.https.certificateAuthorities.indexOf(safKeyring) === -1) {
newEntries.push(safKeyring);
}
}
}
}
}
}
}
config.https.certificateAuthorities = newEntries;
}
return canRun;
}),
Expand Down
2 changes: 1 addition & 1 deletion plugins/sso-auth/lib/apimlHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ApimlHandler {
this.doLogin(request, sessionState, false).then(result=> {
resolve(result);
}).catch(e=> {
Promise.resolve({success: false});
resolve({success: false}); // return the object directly
});
});
} else if (request.cookies && request.cookies[TOKEN_NAME]) {
Expand Down

0 comments on commit aa54397

Please sign in to comment.