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

SSH key passphrase support in ssh2 transport #192

Merged
merged 4 commits into from Nov 13, 2021
Merged

SSH key passphrase support in ssh2 transport #192

merged 4 commits into from Nov 13, 2021

Conversation

ghost
Copy link

@ghost ghost commented Nov 11, 2021

Description

Added support for SSH key passphrase in SSH2 transport.
No issue was opened, but got spotted while using the library.

Type of change

Please delete options that are not relevant.

  • [ x ] New feature (non-breaking change which adds functionality)
  • [ x ] This change requires a documentation update

How Has This Been Tested?

Used a similar template to the one in example/basic_usage for GenericDriver, where
specified the ssh_private_key_passphrase parameter in MY_DEVICE config.

The listening OpenSSH server was setup to accept just a SSH key protected by a password.

@codecov
Copy link

codecov bot commented Nov 11, 2021

Codecov Report

Merging #192 (fe7ada0) into develop (7af5387) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #192      +/-   ##
===========================================
- Coverage    91.04%   90.96%   -0.08%     
===========================================
  Files           58       58              
  Lines         3304     3275      -29     
===========================================
- Hits          3008     2979      -29     
  Misses         296      296              
Impacted Files Coverage Δ
scrapli/transport/plugins/ssh2/transport.py 32.57% <100.00%> (+0.51%) ⬆️
scrapli/logging.py 83.49% <0.00%> (-0.62%) ⬇️
scrapli/ssh_config.py 98.87% <0.00%> (-0.07%) ⬇️
scrapli/factory.py 95.83% <0.00%> (-0.03%) ⬇️
scrapli/channel/async_channel.py 95.65% <0.00%> (-0.02%) ⬇️
scrapli/channel/sync_channel.py 97.27% <0.00%> (-0.02%) ⬇️
scrapli/helper.py 100.00% <0.00%> (ø)
scrapli/response.py 100.00% <0.00%> (ø)
scrapli/driver/generic/base_driver.py 100.00% <0.00%> (ø)
scrapli/driver/generic/sync_driver.py 98.14% <0.00%> (ø)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7af5387...fe7ada0. Read the comment docs.

@carlmontanari
Copy link
Owner

Hey @shnurty thanks for putting this together! Looks cool -- I'll try to test it out this weekend so we can get it merged in.

Could you update to point to the develop branch please? Last thing for now: we can ignore that doc-test CI failing right now... haven't looked at that yet but it just fails sometimes :)

Carl

@ghost ghost changed the base branch from master to develop November 12, 2021 20:33
`auth_private_key_passphrase: str = '',a`
to
`auth_private_key_passphrase: str = '', a`

[added space after the comma]
@ghost
Copy link
Author

ghost commented Nov 12, 2021

Hi @carlmontanari, thanks :)
Always a pleasure to help with such interesting and useful projects.

I've target the develop branch directly from GH.
No hurry for the review: let me know if you want me to add/modify something in case.

PS: the new "commit" is for adding a space between the comma and the beginning of the next var in HTML doc.
I noticed it and it was hurting ;)

@carlmontanari
Copy link
Owner

Took this for a test drive and looks good to go, thanks for the work on this!

Carl

@carlmontanari carlmontanari merged commit b9e5907 into carlmontanari:develop Nov 13, 2021
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.

None yet

1 participant