Commit Graph
76 Commits
Author SHA1 Message Date
Sylvia Crowe 76fbf964a8 fix: match directive bypass for GetAll
The new ignoreMatchDirective flag needed to be added in one other place.
2024-10-27 15:49:18 -07:00
Sylvia Crowe 46cd93734b fix: duplicated code leftover from merge 2024-10-27 13:16:47 -07:00
Sylvia Crowe d620a2715a merge branch 'ignore-match-directive' 2024-10-27 13:14:54 -07:00
fferro 961aa82b9a cleanup 2024-07-17 12:56:54 +01:00
fferro 5a3b04bab2 cleanup 2024-07-17 10:58:41 +01:00
fferro 5a03b50199 cleanup 2024-07-17 10:57:56 +01:00
fferro d5ad69131f cleanup 2024-07-17 10:56:24 +01:00
fferro e2d4055e4e Add the possibility to ignore the Match directive 2024-07-17 10:23:07 +01:00
17e2087ebd Update IdentityFile Defaults to Match Documentation (#4)
Credit to @virtuald for the original implementation of this fix.

* Add support for retrieving all IdentityFile directives via DefaultAll

* fix: set IdentityFile defaults to match man page

The existing default IdentityFile list was incomplete and out of order.
This updates it to match the defaults listed here:
https://man7.org/linux/man-pages/man5/ssh_config.5.html

---------

Co-authored-by: Dustin Spicuzza <dustin@virtualroadside.com>
2024-03-05 20:10:34 -08:00
Sylvie CroweandGitHub cba6b6a60f Add reload config (#2)
* add function that can clear cached config files

Once the first call to `Get()`, `GetStrict()`, `GetAll()`,
or`GetAllStrict()` has been made, the contents of the config files will
be cached for all future calls to any of those functions. This can be
frustrating if the user wants to capture changes to the config file that
were made externally. This
change adds the `ClearCachedConfigs()` function to provide control over
that.

* change ClearCachedConfigs to ReloadConfigs

Clearing cached data is somewhat vague and could be more confusing to
users who are not familiar with this library. But Reloading the config
data is very straightforward. For this reason, the ability to clear the
cache has been replaced with the ability to reload.

The reload simply clears the cache and then loads the contents again.

Additionally, this contains a bug fix that ensure the loadConfigs
pointer is set to a non-null value before it is used.

* add tests for reloading ssh config files

This adds 2 tests. The first checks that ssh config data is cached and
does not update if the file changes afterward. The second checks that
the `ReloadConfigs()` function will discard the cached data and load the
current config file contents.
2024-03-05 19:38:17 -08:00
Kevin Burke 1d09c0b505 .github: set latest Go versions 2023-10-21 21:24:32 -07:00
Kevin Burke 974a52c2c0 .github: use Go 1.19 2022-11-25 07:46:23 -08:00
Kevin Burke 3c7724c1bb README.md: update donate information 2022-11-08 20:20:52 -08:00
Kevin Burke 7df8445052 go.mod: add 2022-06-15 09:39:52 -07:00
Kevin Burke a56e914e72 .github: run lint only on Go 1.18 2022-06-05 13:48:31 -07:00
Kevin Burke 5724bd1279 config: add UserSettings.ConfigFinder
Fixes #48.
2022-06-05 12:47:11 -07:00
Kevin Burke aae6f39972 1.2 2022-03-31 11:37:00 -07:00
Kevin Burke df4d8e6716 config: update version to match git tags 2022-03-31 11:36:52 -07:00
Kevin Burke f6c7111323 Makefile: add tag prefix to release command
This makes go.mod happier.
2022-03-31 10:59:35 -07:00
Scott LessansandKevin Burke 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
Carlos A BeckerandKevin Burke 91cd224c7f config: add DecodeBytes to directly read a byte array
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-03-31 09:49:09 -07:00
Kevin Burke a432d6fbae README: add more information 2022-03-31 09:31:12 -07:00
Kevin Burke 6ad71ac26e config: remove io/ioutil
It's deprecated now.
2022-03-31 09:26:24 -07:00
Kevin Burke 0970dd2cc4 .github: add latest Go versions to CI 2022-03-31 09:22:50 -07:00
Kevin Burke c7f8dec5c7 fuzz_test: add fuzz tests
Also add a sample corpus.
2021-11-02 14:58:53 -07:00