-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix: Fix example configs and README.md file #2215
Conversation
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.
Change looks good, but we should make sure we also call make verify-config
in CI.
d6cd646
to
7a4e289
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2215 +/- ##
==========================================
- Coverage 92.80% 92.78% -0.02%
==========================================
Files 166 166
Lines 21798 21811 +13
==========================================
+ Hits 20230 20238 +8
- Misses 980 984 +4
- Partials 588 589 +1 ☔ View full report in Codecov by Sentry. |
95eca03
to
b3035fa
Compare
3f38664
to
3528253
Compare
|
||
return config.LDAPCredentials{}, err | ||
} | ||
|
||
if len(metaData.Keys) == 0 { | ||
log.Error().Err(zerr.ErrBadConfig). |
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.
Can you cover this case? Should be easy enough.
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.
Covered.
return config.LDAPCredentials{}, zerr.ErrBadConfig | ||
} | ||
|
||
if len(metaData.Unused) > 0 { |
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.
Can you cover this with a test case?
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.
Covered.
Signed-off-by: onidoru <[email protected]> Signed-off-by: Nikita Kotikov <[email protected]>
Signed-off-by: onidoru <[email protected]> Signed-off-by: Nikita Kotikov <[email protected]>
Signed-off-by: onidoru <[email protected]> Signed-off-by: Nikita Kotikov <[email protected]>
a7ce686
to
8a61bbc
Compare
content := []byte(`{ | ||
"bindDN":"cn=ldap-searcher,ou=Users,dc=example,dc=org", | ||
"bindPassword":"ldap-searcher-password", | ||
"extraKey": "extraValue" |
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.
For some reason the test does not cover the lines we expected. Also the comment at line 1326 should probably be removed,
defer os.Remove(tmpCredsFile.Name()) | ||
|
||
// `bindDN` key is missing | ||
content := []byte(``) |
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.
I think this case covers the error on viperInstance.UnmarshalExact(
which is good, but we still need a separate test case with a valid empty json content := []byte({}
).
What type of PR is this?
documentation
Which issue does this PR fix:
Example LDAP configs do not represent the actual state of things and are outdated.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.