-
Notifications
You must be signed in to change notification settings - Fork 0
feat(contrib): Add a helper script for ldapsearch debugging #139
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
=======================================
Coverage 88.40% 88.40%
=======================================
Files 10 10
Lines 1785 1785
=======================================
Hits 1578 1578
Misses 207 207 Continue to review full report in Codecov by Sentry.
|
jannden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is ./contrib/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a directory with some random bonus scripts that are useful. It's pretty common in FOSS projects; often plugins and other related things not part of the main codebase make it in there, too.
f7c533f to
1756b96
Compare
| fi | ||
|
|
||
| grep_from_yaml() { | ||
| grep "$1" "$config" | cut -f 2 -d ':' | tr -d '" ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly the simple approach doesn't work very well in practice; various attributes used in DNs and filters often contain spaces and :. tr-ing and cut-ing all of them breaks.
We'd need to do a more thorough yaml parse to not run into this, sadly non-greedy matches are hard to do with just POSIX utilities.
We've needed to figure out what famedly-sync is seeing a few times while debugging in customer environments now; this is a quick solution that helps get this more easily. Short of a full command to do various searches in famedly-sync (which would basically just reimplement `ldapsearch`) I think this is a pretty good way to patch up that use case a bit.
1756b96 to
dad0687
Compare
We've needed to figure out what famedly-sync is seeing a few times while debugging in customer environments now; this is a quick solution that helps get this more easily.
Short of a full command to do various searches in famedly-sync (which would basically just reimplement
ldapsearch) I think this is a pretty good way to patch up that use case a bit.