rob05c commented on a change in pull request #2010: Go login
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2010#discussion_r187747195
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/config/config.go
 ##########
 @@ -226,3 +250,22 @@ func ParseConfig(cfg Config) (Config, error) {
 
        return cfg, nil
 }
+
+func GetLDAPConfig(LDAPConfPath string) (bool, *ConfigLDAP, error) {
+       LDAPConfBytes, err := ioutil.ReadFile(LDAPConfPath)
+       if err != nil {
+
+               return false, nil, fmt.Errorf("reading LDAP conf '%v': %v", 
LDAPConfPath, err)
+       }
+       LDAPconf, err := getLDAPConf(string(LDAPConfBytes))
+       if err != nil {
+               return false, LDAPconf, fmt.Errorf("parsing LDAP conf '%v': 
%v", LDAPConfBytes, err)
+       }
+       return true, LDAPconf, nil
+}
+
+func getLDAPConf(s string) (*ConfigLDAP, error) {
+       ldapConf := ConfigLDAP{}
 
 Review comment:
   The LDAP timeout should have a reasonable default. It's defaulting to 0 now, 
and my LDAP (which is probably misconfigured) is hanging indefinitely. I'd 
suggest something like 10 seconds, if it isn't set in the config.
   
   Should be accomplished by changing this to
   ```
   const DefaultLDAPTimeout = time.Duration(60 * time.Second)
   ldapConf := ConfigLDAP{LDAPTimeoutSecs: DefaultLDAPTimeout / time.Second}
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to