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

request to copy / to extract ssh.rs #1

Open
davidB opened this issue Apr 13, 2019 · 6 comments
Open

request to copy / to extract ssh.rs #1

davidB opened this issue Apr 13, 2019 · 6 comments
Labels
question Further information is requested

Comments

@davidB
Copy link

davidB commented Apr 13, 2019

Hi,

I started a small crate that provide a git2's credential function git2_credentials. And you did an useful work about git's credentials.
Can I copy (and adapt) your code ssh.rs to include it into git2_credentials ?

Thanks.

@JMLX42
Copy link
Member

JMLX42 commented May 12, 2019

Can I copy (and adapt) your code ssh.rs to include it into git2_credentials ?

Yes. Please do.
Please share your progress here also if you can.

The .ssh/config parsing is crude at best and works in simple cases.
I guess that's where there is the most room for improvement.

@davidB
Copy link
Author

davidB commented May 13, 2019

Ok, I already copy/adapt a small part (ask passphrase for default id_rsa) as part of the v 0.2.0.

You're right the parsing of my .ssh/config failed.

Thanks.

@JMLX42
Copy link
Member

JMLX42 commented May 13, 2019

You're right the parsing of my .ssh/config failed.

Please open a separate issue and provide the file.

@JMLX42
Copy link
Member

JMLX42 commented Mar 9, 2020

@davidB any update on this?

@JMLX42 JMLX42 added the question Further information is requested label Mar 9, 2020
@davidB
Copy link
Author

davidB commented Mar 10, 2020

wahoo nearly one year, but no update about parsing .ssh/config :-( , I'll redo a test after work and try to provide a minimal sample that failed

@davidB
Copy link
Author

davidB commented Nov 3, 2020

Hi,
I finally take time to copy+adapt your code to parse .ssh/config into git2_credential ✨ parse the .ssh/config file to search what key file to use … · davidB/git2_credentials@28cebc4

This commit include an modified ssh_config.pest to support more case like:

  • in-sensitive case "Host" (allowed from the man page, and my own config)
  • allow empty-line at top of the file
  • allow non-empty line at bottom of the file
  • provide value (quoted and unquoted) via p.as_rule() == Rule::value_unquoted ("dquote" are removed)

I include few test, but not for all the case, I tried during my learn of pest & experimentation.

Feel free to copy back, Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants