You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/08/28 17:00:16 UTC
[GitHub] dangogh commented on a change in pull request #2756: add checks
that the parsed ldap config is complete
dangogh commented on a change in pull request #2756: add checks that the parsed ldap config is complete
URL: https://github.com/apache/trafficcontrol/pull/2756#discussion_r213394849
##########
File path: traffic_ops/traffic_ops_golang/config/config.go
##########
@@ -309,6 +311,22 @@ func GetLDAPConfig(LDAPConfPath string) (bool, *ConfigLDAP, error) {
if err != nil {
return false, LDAPconf, fmt.Errorf("parsing LDAP conf '%v': %v", LDAPConfBytes, err)
}
+ if strings.TrimSpace(LDAPconf.AdminPass) == "" {
+ return false, LDAPconf, fmt.Errorf("LDAP conf missing admin_pass field")
+ }
+ if strings.TrimSpace(LDAPconf.SearchBase) == "" {
+ return false, LDAPconf, fmt.Errorf("LDAP conf missing search_base field")
+ }
+ if strings.TrimSpace(LDAPconf.AdminDN) == "" {
+ return false, LDAPconf, fmt.Errorf("LDAP conf missing admin_dn field")
+ }
+ if strings.TrimSpace(LDAPconf.Host) == "" {
+ return false, LDAPconf, fmt.Errorf("LDAP conf missing host field")
+ }
+ if strings.TrimSpace(LDAPconf.SearchQuery) == "" {
+ return false, LDAPconf, fmt.Errorf("LDAP conf missing search_query field")
+ }
+
Review comment:
shouldn't the trimmed values be what ends up being stored in LDAPconf? Otherwise, the caller needs to also deal with any spaces...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services