Skip to content

Commit 522645a

Browse files
committed
Merge branch 'wrc-label-fix' into 'main'
WRC label fix See merge request weblogic-cloud/weblogic-toolkit-ui!304
2 parents ad589d9 + 1a5e9aa commit 522645a

File tree

189 files changed

+15493
-30328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+15493
-30328
lines changed

THIRD_PARTY_LICENSES.txt

Lines changed: 616 additions & 1130 deletions
Large diffs are not rendered by default.

documentation/1.7/content/release/release-1.6.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = "Release Notes 1.6.0"
2+
title = "Release 1.6.0"
33
date = 2022-11-03T12:48:00-05:00
44
weight = 90
55
pre = "<b> </b>"

documentation/1.7/content/release/release-1.6.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
title = "Release 1.6.3"
33
date = 2022-11-03T12:48:00-05:00
4-
weight = 88
4+
weight = 87
55
pre = "<b> </b>"
66
+++
77

electron/.eslintrc.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

electron/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
/Library
1010
/.env
1111
/app/webui.json
12+
/app/locales/en/*.missing.json
1213
/coverage

electron/app/js/credentialEncryptor.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
* Copyright (c) 2021, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
6-
const crypto = require('crypto');
6+
const {
7+
createCipheriv,
8+
createDecipheriv,
9+
pbkdf2Sync,
10+
randomBytes
11+
} = require('node:crypto');
712
const zlib = require('zlib');
813

914
const _ivLength = 16;
@@ -20,11 +25,11 @@ class CredentialEncryptor {
2025
}
2126

2227
getEncryptedText(clearText) {
23-
const salt = crypto.randomBytes(_saltLength);
28+
const salt = randomBytes(_saltLength);
2429
const derivedKey = this._getDerivedKey(salt);
2530

26-
const iv = crypto.randomBytes(_ivLength);
27-
const cipher = crypto.createCipheriv(_encryptionAlgorithm, derivedKey, iv);
31+
const iv = randomBytes(_ivLength);
32+
const cipher = createCipheriv(_encryptionAlgorithm, derivedKey, iv);
2833
const encrypted = Buffer.concat([ cipher.update(clearText, 'utf8'), cipher.final() ]);
2934
let authTag = cipher.getAuthTag();
3035

@@ -39,7 +44,7 @@ class CredentialEncryptor {
3944
const salt = Buffer.from(data.salt, 'base64');
4045
const derivedKey = this._getDerivedKey(salt);
4146

42-
const decipher = crypto.createDecipheriv(_encryptionAlgorithm, derivedKey, iv);
47+
const decipher = createDecipheriv(_encryptionAlgorithm, derivedKey, iv);
4348
decipher.setAuthTag(authTag);
4449
const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
4550
return decrypted.toString('utf8');
@@ -48,7 +53,7 @@ class CredentialEncryptor {
4853
_getDerivedKey(salt) {
4954
// derive key with password and salt
5055
// keylength adheres to the "ECRYPT-CSA Recommendations" on "www.keylength.com"
51-
return crypto.pbkdf2Sync(this.passphrase, salt, _iterations, _keyLength, _digestAlgorithm);
56+
return pbkdf2Sync(this.passphrase, salt, _iterations, _keyLength, _digestAlgorithm);
5257
}
5358

5459
_packCipherData(authTag, content, iv, salt) {

electron/app/js/credentialManager.js

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
const CredentialEncryptor = require('./credentialEncryptor');
@@ -9,7 +9,6 @@ const { getLogger } = require('./wktLogging');
99

1010
const DECRYPTION_FAILED_STRING = 'Unsupported state or unable to authenticate data';
1111

12-
/* global Buffer */
1312
class CredentialManager {
1413
constructor(credentialStorePolicy) {
1514
this.credentialStorePolicy = credentialStorePolicy;
@@ -57,63 +56,17 @@ class CredentialManager {
5756
refObj.reference = { };
5857
}
5958
const cipherText = refObj.reference[refObj.field];
60-
refObj.reference[refObj.field] = await this.manager.loadCredential(jsonPath, cipherText);
59+
if (cipherText) {
60+
refObj.reference[refObj.field] = await this.manager.loadCredential(jsonPath, cipherText);
61+
} else {
62+
logger.debug('Failed to load credential from %s so skipping it', jsonPath);
63+
}
6164
}
6265
}
6366
return Promise.resolve(loadedProject);
6467
}
6568
}
6669

67-
class CredentialStoreManager extends CredentialManager {
68-
constructor(projectGuid) {
69-
super('native');
70-
const CredentialStore = require('./credentialStore');
71-
72-
this.projectGuid = projectGuid;
73-
this.credentialStore = new CredentialStore();
74-
super.credentialManager = this;
75-
}
76-
77-
get credentialStoreType() {
78-
return super.credentialStoreType;
79-
}
80-
81-
async storeCredentials(project) {
82-
return super.storeCredentials(project);
83-
}
84-
85-
async loadCredentials(project) {
86-
return super.loadCredentials(project);
87-
}
88-
89-
async storeCredential(jsonPath, clearText) {
90-
return new Promise((resolve, reject) => {
91-
if (clearText) {
92-
this.credentialStore.storeCredential(this._getCredentialName(jsonPath), clearText)
93-
.then(() => resolve())
94-
.catch(err => reject(new Error(`Failed to save credential for ${jsonPath}: ${err}`)));
95-
} else {
96-
this.credentialStore.deleteCredential(this._getCredentialName(jsonPath))
97-
.then(() => resolve())
98-
.catch(err => reject(new Error(`Failed to delete empty credential for ${jsonPath}: ${err}`)));
99-
}
100-
});
101-
}
102-
103-
// eslint-disable-next-line no-unused-vars
104-
async loadCredential(jsonPath, cipherText) {
105-
return new Promise((resolve, reject) => {
106-
this.credentialStore.getCredential(this._getCredentialName(jsonPath))
107-
.then(clearText => resolve(clearText))
108-
.catch(err => reject(new Error(`Failed to load credential for ${jsonPath}: ${err}`)));
109-
});
110-
}
111-
112-
_getCredentialName(jsonPath) {
113-
return Buffer.from(`${this.projectGuid}:${jsonPath}`, 'utf8').toString('base64');
114-
}
115-
}
116-
11770
class EncryptedCredentialManager extends CredentialManager {
11871
static BAD_PASSPHRASE_KEY = 'Incorrect passphrase';
11972

@@ -199,6 +152,5 @@ class CredentialNoStoreManager extends CredentialManager {
199152

200153
module.exports = {
201154
CredentialNoStoreManager,
202-
CredentialStoreManager,
203155
EncryptedCredentialManager
204156
};

electron/app/js/credentialStore.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2021, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
6+
// eslint-disable-next-line no-redeclare
67
const { name } = require('../../package.json');
78
const { getLogger } = require('./wktLogging');
89

electron/app/js/fsUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ function getExecutableFilePath(exeName, mode) {
209209
let resolvedPath;
210210
try {
211211
resolvedPath = which.sync(exeName);
212-
} catch (err) {
212+
} catch {
213213
// not found...
214214
if (osUtils.isMac() && mode === 'exe') {
215215
try {
216216
resolvedPath = which.sync(exeName, { path: '/usr/local/bin' });
217-
} catch (nestedErr) {
217+
} catch {
218218
// still not found...
219219
}
220220
}

electron/app/js/githubUtils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
'use strict';
77

88
const { HttpsProxyAgent } = require('https-proxy-agent');
9+
10+
// Node.js now has a built-in fetch implementation but it does not appear to
11+
// support proxies so let's stick with node-fetch for now...
12+
//
13+
// eslint-disable-next-line no-redeclare
914
const fetch = require('node-fetch');
1015

1116
// WARNING: This file contains functions that are called by build scripts

0 commit comments

Comments
 (0)