work on LDAP
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 15:53:21 +11:00
parent d6c082675e
commit 7a8fd8e200
4 changed files with 46 additions and 17 deletions

View File

@@ -22,7 +22,8 @@ type LdapConfig struct {
}
var systemCA *x509.CertPool
var certLoaded bool
var CertLoaded bool
var LdapEnabled bool
func GetFilePath(path string) string {
// Check for empty filename
@@ -80,7 +81,7 @@ func LoadLdapCert() {
// Add custom certificate to the system cert pool
systemCA.AddCert(crt)
certLoaded = true
CertLoaded = true
}
}
@@ -91,6 +92,8 @@ func VerifyLdapCreds(username string, password string) bool {
if ldapServer == "" {
log.Printf("VerifyLdapCreds no LDAP bind address supplied\n")
return false
} else {
LdapEnabled = true
}
ldapBaseDn := os.Getenv("LDAP_BASE_DN")