(username string, password string, guiCfg config.GUIConfiguration, ldapCfg config.LDAPConfiguration)
| 228 | } |
| 229 | |
| 230 | func auth(username string, password string, guiCfg config.GUIConfiguration, ldapCfg config.LDAPConfiguration) bool { |
| 231 | if guiCfg.AuthMode == config.AuthModeLDAP { |
| 232 | return authLDAP(username, password, ldapCfg) |
| 233 | } else { |
| 234 | return authStatic(username, password, guiCfg) |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | func authStatic(username string, password string, guiCfg config.GUIConfiguration) bool { |
| 239 | return guiCfg.CompareHashedPassword(password) == nil && username == guiCfg.User |
no test coverage detected