13 Commits

Author SHA1 Message Date
Scott Lessans 9b1b4df300 config: fix EOL whitespace for key/value pairs and Host lines
See the description in the CHANGELOG - we were handling this
incorrectly and attaching whitespace to the end of values where that
didn't make much sense to do.
2022-03-31 10:57:24 -07:00
Kevin Burke c7f8dec5c7 fuzz_test: add fuzz tests
Also add a sample corpus.
2021-11-02 14:58:53 -07:00
Dustin Spicuzza 124166206d Support retrieving multiple values for a given keyword
IdentityFile among others supports being provided multiple times and
aggregated across, potentially, multiple files. Support that workflow
by adding GetAll and GetAllStrict alongside the current functions.
2021-03-27 13:38:21 -07:00
Kevin Burke 555f37af0a Correctly parse files without trailing newline
If the file did not have a newline character as the last character,
parseKV() would panic with an NPE. Handle the parser changes better.

Fixes #21.
2018-08-30 14:46:27 -06:00
Eugene Terentev fe204ef364 Fix DOS line endings parsing
Previously we would fail to lex lines ending with CRLF properly.
2018-03-17 10:50:38 -07:00
Sergey Lukjanov c665f6f442 Fix potential index out of range error
I had some extra spaces and junk in my ssh config and it was causing
this part of the code to fail with an out of range error.
2018-01-27 11:46:18 -08:00
Kevin Burke 7897293c53 Cleanup for public release
- Test Include string representation

- Add docs and examples
2017-05-25 08:00:10 -07:00
Kevin Burke 1c4ddb97d7 use Default() and validate() 2017-05-24 21:30:13 -07:00
Kevin Burke c20644453d add Default() and start of a validate() function 2017-05-24 10:11:10 -07:00
Kevin Burke 54fabb9a37 Implement Include directive
It's tricky because it involves recursive filesystem parsing, depth
checking and glob matching. But figured it out.

Fixes #4.
2017-05-23 20:09:31 -07:00
Kevin Burke ad36f0d71a Implement negative match
Fixes #3.
2017-04-23 16:39:17 -07:00
Kevin Burke 67c39ca6b4 Implement Get and wildcard match
Lots of changes and new API's here.

Fixes #7.
2017-04-23 11:42:22 -07:00
Kevin Burke 29f594a81c Add alpha SSH config parser
The error handling is nonexistent and there's no easy way to get
data out. But we can parse a SSH config file into a Go struct, and
roundtrip that struct back to a file that looks (roughly) the same.
2017-04-17 11:08:10 -07:00