gpm icon indicating copy to clipboard operation
gpm copied to clipboard

request to copy / to extract ssh.rs

Open davidB opened this issue 7 years ago • 6 comments

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.

davidB avatar Apr 13 '19 16:04 davidB

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.

JMLX42 avatar May 12 '19 18:05 JMLX42

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.

davidB avatar May 13 '19 07:05 davidB

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

Please open a separate issue and provide the file.

JMLX42 avatar May 13 '19 18:05 JMLX42

@davidB any update on this?

JMLX42 avatar Mar 09 '20 22:03 JMLX42

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 avatar Mar 10 '20 08:03 davidB

Hi, I finally take time to copy+adapt your code to parse .ssh/config into git2_credential :sparkles: 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.

davidB avatar Nov 03 '20 22:11 davidB