diff --git a/.github/workflows/rust-cli-publish.yml b/.github/workflows/rust-cli-publish.yml index 5d001c3fa6..ec7325b6da 100644 --- a/.github/workflows/rust-cli-publish.yml +++ b/.github/workflows/rust-cli-publish.yml @@ -77,7 +77,7 @@ jobs: id: upload-release-asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/x86_64-unknown-linux-gnu/release/zowe-linux.tgz + run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/x86_64-unknown-linux-gnu/release/zowe-linux.tgz --repo ${{ github.repository }} build-macos: @@ -116,7 +116,7 @@ jobs: id: upload-release-asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/release/zowe-macos.tgz + run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/release/zowe-macos.tgz --repo ${{ github.repository }} build-windows: @@ -150,4 +150,4 @@ jobs: id: upload-release-asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/release/zowe-windows.tgz + run: gh release upload native-v${{ needs.release.outputs.ZOWEX_VERSION }} target/release/zowe-windows.tgz --repo ${{ github.repository }} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 50319639d0..939c7d55a1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -212,6 +212,12 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "dev": true, @@ -325,9 +331,15 @@ }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" } }, "node_modules/@babel/helper-plugin-utils": { @@ -1768,6 +1780,20 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "dev": true, @@ -1784,6 +1810,15 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "dev": true, @@ -1930,7 +1965,7 @@ "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://dotenvx.com" } }, "node_modules/@lerna-lite/cli/node_modules/y18n": { @@ -3312,6 +3347,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { @@ -5704,6 +5742,15 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/are-we-there-yet": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-4.0.2.tgz", + "integrity": "sha512-ncSWAawFhKMJDTdoAeOV+jyW1VCMj5QIAwULIBV0SSR7B/RLPPEQiknKcg/RIIZlUQrxELpsxMiTUoAQ4sIUyg==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/arg": { "version": "4.1.3", "dev": true, @@ -9678,6 +9725,18 @@ "node": ">= 0.4" } }, + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/highlight.js": { "version": "11.9.0", "dev": true, @@ -15254,6 +15313,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "dev": true, @@ -15640,6 +15708,23 @@ "node": ">= 0.4" } }, + "node_modules/set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shallow-clone": { "version": "3.0.1", "dev": true, @@ -16848,6 +16933,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/uniq": { "version": "1.0.1", "dev": true, diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index c889976875..15c6d050cd 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -83,6 +83,14 @@ LTS Breaking: Removed the following previously deprecated items: [#1981](https:/ - Major: First major version bump for V3 +## `7.23.5` + +- BugFix: Fixed default base profile missing in config generated by `zowe config auto-init` [#2084](https://github.com/zowe/zowe-cli/pull/2084) + +## `7.23.4` + +- BugFix: Updated dependencies of the daemon client for technical currency [#2076](https://github.com/zowe/zowe-cli/pull/2076) + ## `7.23.3` - BugFix: Fixed race condition in `config convert-profiles` command that may fail to delete secure values for old profiles diff --git a/packages/cli/__tests__/config/auto-init/__unit__/ApimlAutoInitHandler.unit.test.ts b/packages/cli/__tests__/config/auto-init/__unit__/ApimlAutoInitHandler.unit.test.ts index e6678114d8..eaf064effa 100644 --- a/packages/cli/__tests__/config/auto-init/__unit__/ApimlAutoInitHandler.unit.test.ts +++ b/packages/cli/__tests__/config/auto-init/__unit__/ApimlAutoInitHandler.unit.test.ts @@ -29,7 +29,10 @@ function mockConfigApi(properties: IConfig | undefined): any { }, profiles: { getProfilePathFromName: (name: string) => `profiles.${name}`, - get: jest.fn() + get: jest.fn().mockReturnValue({}) + }, + secure: { + securePropsForProfile: jest.fn().mockReturnValue([]) } }, exists: true, diff --git a/packages/cli/src/config/auto-init/ApimlAutoInitHandler.ts b/packages/cli/src/config/auto-init/ApimlAutoInitHandler.ts index 399557c85a..7192b93e80 100644 --- a/packages/cli/src/config/auto-init/ApimlAutoInitHandler.ts +++ b/packages/cli/src/config/auto-init/ApimlAutoInitHandler.ts @@ -15,7 +15,7 @@ import * as lodash from "lodash"; import { ZosmfSession } from "@zowe/zosmf-for-zowe-sdk"; import { BaseAutoInitHandler, AbstractSession, ICommandArguments, IConfig, IConfigProfile, ISession, IHandlerResponseApi, IHandlerParameters, SessConstants, ImperativeConfig, - ImperativeError, RestClientError, TextUtils + ImperativeError, RestClientError, TextUtils, Config } from "@zowe/imperative"; import { IApimlProfileInfo, IAutoInitRpt, IProfileRpt, Login, Services } from "@zowe/core-for-zowe-sdk"; @@ -118,29 +118,32 @@ export default class ApimlAutoInitHandler extends BaseAutoInitHandler { }, secure: [] }; - profileConfig.defaults[this.mProfileType] = this.mProfileType; activeBaseProfile = this.mProfileType; baseProfileCreated = true; } else { + const oldBaseProfile = this.getOldBaseProfileProps(config, activeBaseProfile); lodash.set(profileConfig, config.api.profiles.getProfilePathFromName(activeBaseProfile), { type: this.mProfileType, properties: { - ...config.api.profiles.get(activeBaseProfile), + ...oldBaseProfile.properties, host: session.ISession.hostname, port: session.ISession.port, rejectUnauthorized: session.ISession.rejectUnauthorized, }, - secure: [] + secure: oldBaseProfile.secure ?? [] }); } if (session.ISession.tokenType != null && session.ISession.tokenValue != null) { - const expandedBaseProfilePath = config.api.profiles.getProfilePathFromName(activeBaseProfile); - lodash.get(profileConfig, expandedBaseProfilePath).properties.tokenType = session.ISession.tokenType; - lodash.get(profileConfig, expandedBaseProfilePath).properties.tokenValue = session.ISession.tokenValue; - lodash.get(profileConfig, expandedBaseProfilePath).secure.push("tokenValue"); + const baseProfileConfig = lodash.get(profileConfig, config.api.profiles.getProfilePathFromName(activeBaseProfile)); + baseProfileConfig.properties.tokenType = session.ISession.tokenType; + baseProfileConfig.properties.tokenValue = session.ISession.tokenValue; + if (!baseProfileConfig.secure.includes("tokenValue")) { + baseProfileConfig.secure.push("tokenValue"); + } } + profileConfig.defaults[this.mProfileType] = activeBaseProfile; this.recordProfilesFound(profileInfos); // Report whether or not we created a base profile in this auto-init execution @@ -515,4 +518,17 @@ export default class ApimlAutoInitHandler extends BaseAutoInitHandler { } } } + + private getOldBaseProfileProps(config: Config, baseProfileName: string): IConfigProfile { + const propsToRemove = ["user", "password", "certFile", "certKeyFile"]; + const properties = config.api.profiles.get(baseProfileName); + for (const propName of propsToRemove) { + properties[propName] = undefined; + } + const secureProps = config.api.secure.securePropsForProfile(baseProfileName); + return { + properties, + secure: secureProps.filter((propName) => !propsToRemove.includes(propName)) + }; + } } diff --git a/zowex/Cargo.lock b/zowex/Cargo.lock index 2fbca56114..71be864e1f 100644 --- a/zowex/Cargo.lock +++ b/zowex/Cargo.lock @@ -372,6 +372,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rpassword" version = "7.3.1" @@ -518,7 +527,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -714,13 +723,13 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -830,7 +839,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zowe" -version = "1.2.0" +version = "1.2.1" dependencies = [ "base64", "fslock", diff --git a/zowex/Cargo.toml b/zowex/Cargo.toml index f076e7c08e..3037c1cdcf 100644 --- a/zowex/Cargo.toml +++ b/zowex/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zowe" -version = "1.2.0" +version = "1.2.1" authors = ["Zowe Project"] edition = "2018" license = "EPL-2.0" @@ -14,7 +14,7 @@ home = "0.5.9" is-terminal = "0.4.12" pathsearch = "0.2.0" rpassword = "7.3.1" -serde = { version = "1.0.197", features = ["derive"]} +serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.114" simple-error = "0.3.0" supports-color = "3.0.0"