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

[v2] ssh keypassphrase port from v3 #2232

Merged
merged 5 commits into from
Aug 13, 2024
Merged

[v2] ssh keypassphrase port from v3 #2232

merged 5 commits into from
Aug 13, 2024

Conversation

jace-roell
Copy link
Contributor

What It Does
Resolved bug that resulted in user not being prompted for a key passphrase if it is located in the secure credential array of the ssh profile. (port from v3)

Review Checklist
I certify that I have:

@jace-roell jace-roell self-assigned this Aug 12, 2024
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.24%. Comparing base (d17867d) to head (fea58e9).

Files Patch % Lines
packages/zosuss/src/SshBaseHandler.ts 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2232      +/-   ##
==========================================
+ Coverage   91.15%   91.24%   +0.09%     
==========================================
  Files         638      638              
  Lines       19102    19142      +40     
  Branches     3926     3941      +15     
==========================================
+ Hits        17413    17467      +54     
+ Misses       1688     1674      -14     
  Partials        1        1              

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

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.

Looks pretty good, thanks for porting the changes @jace-roell! Left a few comments

packages/zosuss/src/SshBaseHandler.ts Outdated Show resolved Hide resolved
packages/zosuss/src/SshBaseHandler.ts Outdated Show resolved Hide resolved
Signed-off-by: jace-roell <[email protected]>
Copy link
Member

@traeok traeok 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 Jace for porting this over - I left a suggestion about a SonarCloud issue.

@jace-roell jace-roell requested a review from traeok August 12, 2024 20:17
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.

According to Zowe docs, the order of precedence for SSH commands is SSH key, then user & password:
image

When testing this PR locally if I've stored values for user and password in my base profile, and have an SSH profile that defines privateKey and contains keyPassphrase in the secure array, then I get prompted for a value for keyPassphrase as expected. But if I remove user and password from my base profile and leave keyPassphrase, then issue an SSH command, I am prompted for user and password which should not be needed.

I see the same behavior in Zowe V3, so not sure if this is actually an issue, and if so whether we want to handle it separately outside of this PR? 😋

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 @jace-roell!

Sorry for the false alarm - after further discussion realized that the command behaves as expected, and my test environment was tainted by a global config file.

Copy link

sonarcloud bot commented Aug 13, 2024

@awharn awharn merged commit 2f977b7 into master Aug 13, 2024
19 checks passed
@awharn awharn deleted the ssh-keypassphrase-port branch August 13, 2024 14:31
@awharn awharn added the release-current Indicates that there is no new functionality being delivered label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-current Indicates that there is no new functionality being delivered
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

User not prompted for keyPassphrase if in secure array of ssh profile
5 participants