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

Enhance pattern handling for more flexibility #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

maddes-b
Copy link

commit 698d94f (HEAD -> feature-more-flexible-matching, origin/feature-more-flexible-matching)
Author: maddes-b [email protected]
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 746d174
Author: maddes-b [email protected]
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 b2a0e81
Author: maddes-b [email protected]
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.

* Use pre-defined prefixes for debug and error messages to better distinguish log messages.
  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.
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant