Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use keyring module from @zowe/secrets-for-zowe-sdk to replace use of node-keytar #2405

Merged
merged 19 commits into from
Aug 15, 2023

Conversation

traeok
Copy link
Member

@traeok traeok commented Aug 1, 2023

Proposed changes

This PR:

  • implements the use of the keyring module from the new @zowe/secrets-for-zowe-sdk
  • removes old references to node-keytar in the codebase and tests
  • updates old node-keytar references to the new keyring module

Note that tests will fail until the imperative PR (linked below) is merged and published.

Release Notes

Milestone: 2.10.0

Changelog: TBD

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

@traeok traeok linked an issue Aug 1, 2023 that may be closed by this pull request
26 tasks
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02% 🎉

Comparison is base (eb32c00) 92.79% compared to head (c7e44d8) 92.81%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2405      +/-   ##
==========================================
+ Coverage   92.79%   92.81%   +0.02%     
==========================================
  Files          92       91       -1     
  Lines        9252     9251       -1     
  Branches     1919     1919              
==========================================
+ Hits         8585     8586       +1     
+ Misses        666      664       -2     
  Partials        1        1              
Files Changed Coverage Δ
...es/zowe-explorer-api/src/profiles/ProfilesCache.ts 99.57% <100.00%> (+0.42%) ⬆️
...ckages/zowe-explorer-api/src/security/KeytarApi.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/utils/ProfilesUtils.ts 91.11% <100.00%> (+0.33%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@traeok traeok marked this pull request as ready for review August 7, 2023 15:36
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM! 😋
will test later today 🥳

@adam-wolfe
Copy link
Contributor

Checked this out with VS Code Insiders and the --disable-keytar option. LGTM.

@traeok traeok requested a review from zFernand0 August 9, 2023 16:19
@zFernand0
Copy link
Member

zFernand0 commented Aug 10, 2023

for those on a headless environment, you might want to take a look at:


If that does help, make sure that your launch.json file has a valid DBUS_SESSION_BUS_ADDRESS instead of the default unix:path=/run/user/0/bus.
To get an accurate value, unlock the keyring in a terminal and echo $DBUS_SESSION_BUS_ADDRESS.

    {
      "name": "Run Zowe Explorer VS Code Extension",
      "type": "extensionHost",
      "request": "launch",
      "runtimeExecutable": "${execPath}",
      "args": ["--extensionDevelopmentPath=${workspaceFolder}/packages/zowe-explorer", "--verbose"],
      "outFiles": ["${workspaceFolder}/packages/zowe-explorer/out/**/*.js"],
      "preLaunchTask": "build dev watch",
      "smartStep": true,
      "skipFiles": ["<node_internals>/**"],
      "env": {
        "DBUS_SESSION_BUS_ADDRESS": "unix:abstract=/tmp/dbus-AsdfasdF,guid=some-long-giud"
      }
    },

In order to avoid pushing this file to the repo, I created a quick branch that may help illustrate how we could handle this going forward.
Check the changes here:

zFernand0
zFernand0 previously approved these changes Aug 10, 2023
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming these changes, I was able to share credentials between the CLI and ZE in my remote SSH (headless) environment 🥳

LGTM! 😋

@traeok
Copy link
Member Author

traeok commented Aug 10, 2023

Assuming these changes, I was able to share credentials between the CLI and ZE in my remote SSH (headless) environment 🥳

LGTM! 😋

Thanks for testing & looking into the D-bus env. variable @zFernand0! Do you mind if I cherry-pick bb9f963 into this branch? I'll leave you as the commit author, of course 😋

@zFernand0
Copy link
Member

Assuming these changes, I was able to share credentials between the CLI and ZE in my remote SSH (headless) environment 🥳
LGTM! 😋

Thanks for testing & looking into the D-bus env. variable zFernand0! Do you mind if I cherry-pick bb9f963 into this branch? I'll leave you as the commit author, of course 😋

Yeah, feel free. 😋
Thanks for considering it! 🙏🏽

zFernand0
zFernand0 previously approved these changes Aug 10, 2023
t1m0thyj
t1m0thyj previously approved these changes Aug 11, 2023
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @traeok!

image

The "Electron Helper (Plugin)" was unexpected 😄 Maybe it happened because I was running the extension in VS Code debugger? Regardless I don't think it matters because "Zowe" is in the message so it's clear what it is trying to access 👍

@traeok traeok dismissed stale reviews from t1m0thyj and zFernand0 via d76ae48 August 14, 2023 15:55
@traeok

This comment was marked as outdated.

@sonarcloud
Copy link

sonarcloud bot commented Aug 15, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
7.3% 7.3% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@zFernand0 zFernand0 merged commit b1e6406 into main Aug 15, 2023
24 of 25 checks passed
@zFernand0 zFernand0 deleted the feat/keytar-rs branch August 15, 2023 16:30
@JillieBeanSim JillieBeanSim added this to the v2.10.0 milestone Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use keyring module in @zowe/secrets-for-zowe-sdk as replacement for node-keytar
7 participants