ccontavalli / ssh-ident

Different agents and different keys for different projects, with ssh.
Other
965 stars 71 forks source link

Enhance pattern handling for more flexibility #63

Open maddes-b opened 3 years ago

maddes-b commented 3 years ago

commit 698d94f53b027a91427eff6691936d79df12b4ca (HEAD -> feature-more-flexible-matching, origin/feature-more-flexible-matching) Author: maddes-b maddes-b@users.noreply.github.com Date: Mon Jan 11 17:37:47 2021 +0000

Enhance pattern handling for more flexibility
* Transform PATTERN_KEYS into a list to avoid an unmanageable single complex regex, instead split in several simple regex
* Transform hard-coded public and private key determination into configurable pattern lists: PATTERN_PUBKEYS, PATTERN_PRIVKEYS
  * A second parameter after the regex can be used to define what part to remove for key pair matching
* PATTERN_KEYS, PATTERN_PUBKEYS, PATTERN_PRIVKEYS new only search/test against filename, and nomore their full path
* Compile regex for PATTERN_KEYS, PATTERN_PUBKEYS, PATTERN_PRIVKEYS, MATCH_PATH, MATCH_ARGV for better performance. This is done in a general way within Config.get()
* Add some debug prints for analyzing pattern matching
* Add debug print of found key pairs including hint if corresponding public or private key couldn't be found
* Enhance docstring to reflect changes
* Enhance docstring with more details to key pair handling and pattern matching
* Enhance docstring with already present features of per-identity ssh config file

commit 746d174ee42e9dd7d8a14d675ee8170b9f282635 Author: maddes-b maddes-b@users.noreply.github.com Date: Sun Jan 10 23:18:51 2021 +0000

* Add test for MATCH_ARGV against all elements in a single string.
  Allows to check combinations of values in different elements, e.g. git passes host and repository as separate parameters, useful for GitHub, GitLab, Bitbucket or similar.
* Enhance docstring to reflect the enhancement and give GitHub example.

commit b2a0e8144b2ac361f5508d8380b9b1d9661c5e55 Author: maddes-b maddes-b@users.noreply.github.com Date: Sun Jan 10 21:39:14 2021 +0000

* Add prefix support to print.
* Use pre-defined prefixes for debug and error messages to better distinguish log messages.