zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
173 stars 92 forks source link

ProfilesCache wipes any securely stored profile property when a service profile is renamed #2396

Open FrankSu1996 opened 1 year ago

FrankSu1996 commented 1 year ago

ProfilesCache will wipe any secure properties stored when the profile is renamed. Changing other properties on the profile does not result in the bug, and works as expected. It is ONLY when the name field specifically is changed.

To Reproduce

  1. Make a vscode extension that contributes it's own profile using zowe-explorer-api
  2. Update the profile properties and set any secure property using ProfileInfo.updateProperty(), making sure that the setSecure flag is true
  3. Open the team config file. Change any of the profile properties, and make sure to refresh ProfilesCache. The securely stored property should persist when retrieving via ProfilesCache.
  4. Now change the profile's name, and refresh ProfilesCache. Now, when you retrieve the profile, the securely stored property in step 2 will be wiped.

Note: This also occurs in base profiles. You can verify by storing the user/password from a successful authentication (via Rse/Zosmf profiles), then changing the name of the base profile. The user/password fields are now wiped

Expected behavior

Any securely stored properties using ProfileInfo.updateProperty() should persist even after profile renames.

Screenshots

Desktop (please complete the following information):

Additional context

OS: Windows 11 Zowe Explorer Version: we are using @zowe/zowe-explorer-api@2.8.0 autoStore: true zowe secure credentials setting enabled

github-actions[bot] commented 1 year ago

Thank you for creating a bug report. We will investigate the bug and evaluate its impact on the product. If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

zFernand0 commented 1 year ago

Hey @FrankSu1996, This behavior is consistent with how the underlying Node.js SDK works. That means the @zowe/cli will also experience the same behavior. Please keep an eye out on the following issue to get further updates:

We will revisit this once the CLI squad has made some progress on the issue mentioned above.