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(pkg): Add secrets SDK and keyring module #1759

Merged
merged 41 commits into from
Jul 28, 2023
Merged

feat(pkg): Add secrets SDK and keyring module #1759

merged 41 commits into from
Jul 28, 2023

Conversation

traeok
Copy link
Member

@traeok traeok commented Jul 25, 2023

What It Does

This adds keytar-rs into the CLI as a new package: @zowe/secrets-for-zowe-sdk. It also removes references to the old node-keytar library as it is no longer used.

  • Added the secrets SDK as a new package to the zowe-cli monorepo
  • Added keyring module to said secrets SDK
  • Added test and publish stages for secrets SDK to prepare for publishing

How to Test

Note: The test stages will fail - 2 integration tests are failing on the daemon because Imperative is not using the Secrets SDK yet. Once the Imperative branch is merged into the codebase, CLI will pass with the new version.

Reviewers should be able to clone the repo, cd into packages/secrets, and run npm install to build from source. In addition, reviewers should be able to run npm run test in this folder to verify that all tests are passing for the keyring module.

Review Checklist
I certify that I have:

Additional Comments

Sayonara, node-keytar 👋

traeok and others added 21 commits June 26, 2023 15:27
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
kudos to @t1m0thyj for converting to matrix :)

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f5fff9e) 92.79% compared to head (13de50c) 92.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1759   +/-   ##
=======================================
  Coverage   92.79%   92.79%           
=======================================
  Files         422      422           
  Lines        7165     7165           
  Branches     1309     1309           
=======================================
  Hits         6649     6649           
  Misses        515      515           
  Partials        1        1           

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

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
.github/workflows/secrets-sdk.yml Outdated Show resolved Hide resolved
.github/workflows/secrets-sdk.yml Outdated Show resolved Hide resolved
.github/workflows/secrets-sdk.yml Outdated Show resolved Hide resolved
packages/secrets/scripts/prebuildify.sh Outdated Show resolved Hide resolved
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@t1m0thyj
Copy link
Member

t1m0thyj commented Jul 25, 2023

@traeok Is it right that we expect 2 CLI tests to be failing for now, until we can update Imperative to use the secrets SDK?

@traeok
Copy link
Member Author

traeok commented Jul 25, 2023

@traeok Is it right that we expect 2 CLI tests to be failing for now, until we can update Imperative to use the secrets SDK?

@t1m0thyj Yes - once imperative has the new secrets SDK, those integration tests should pass.

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok traeok requested a review from t1m0thyj July 27, 2023 12:37
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
packages/secrets/package.json Outdated Show resolved Hide resolved
packages/secrets/src/keyring/.gitignore Outdated Show resolved Hide resolved
packages/secrets/src/keyring/.npmignore Outdated Show resolved Hide resolved
packages/secrets/src/keyring/README.md Show resolved Hide resolved
packages/secrets/src/keyring/napi.json Outdated Show resolved Hide resolved
packages/secrets/src/keyring/src/build.rs Outdated Show resolved Hide resolved
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Copy link
Contributor

@ATorrise ATorrise left a comment

Choose a reason for hiding this comment

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

image

Hi - compiles! when building on windows, I get some unrelated output though

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@ATorrise ATorrise self-requested a review July 27, 2023 19:59
Copy link
Contributor

@ATorrise ATorrise left a comment

Choose a reason for hiding this comment

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

Those warnings went away, looks good :)

.github/workflows/secrets-sdk.yml Outdated Show resolved Hide resolved
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.

Will approve once the UTF-8 encoding issue on Windows has been addressed 😋

.github/workflows/secrets-sdk-publish.yml Show resolved Hide resolved
packages/secrets/src/keyring/README.md Show resolved Hide resolved
packages/secrets/package.json Outdated Show resolved Hide resolved

const requireFn = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
const binaryPath = requireFn.resolve(`./keyring.${getTargetName()}.node`, {
paths: [__dirname, join(__dirname, "..", "..", "prebuilds")],
Copy link
Member

Choose a reason for hiding this comment

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

It may be weird for Zowe extenders who try to webpack the Secrets SDK that the prebuilds path is hardcoded to be 2 levels up. Since this works fine for ZE, I'm ok with leaving as-is until someone requests an enhancement 😋

@traeok traeok requested a review from zFernand0 July 28, 2023 14:20
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 28, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
6.1% 6.1% Duplication

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

@traeok traeok merged commit a9f2e9b into master Jul 28, 2023
46 of 47 checks passed
@traeok traeok deleted the feat/keytar-rs branch July 28, 2023 20:09
@traeok traeok mentioned this pull request Sep 14, 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.

4 participants