aboutsummaryrefslogtreecommitdiff
path: root/internal/auth/ldap/ldap.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/auth/ldap/ldap.go')
-rw-r--r--internal/auth/ldap/ldap.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/auth/ldap/ldap.go b/internal/auth/ldap/ldap.go
index 29d95560..d8f8458e 100644
--- a/internal/auth/ldap/ldap.go
+++ b/internal/auth/ldap/ldap.go
@@ -19,9 +19,9 @@ type SecurityProtocol int
// Note: new type must be added at the end of list to maintain compatibility.
const (
- SECURITY_PROTOCOL_UNENCRYPTED SecurityProtocol = iota
- SECURITY_PROTOCOL_LDAPS
- SECURITY_PROTOCOL_START_TLS
+ SecurityProtocolUnencrypted SecurityProtocol = iota
+ SecurityProtocolLDAPS
+ SecurityProtocolStartTLS
)
// Basic LDAP authentication service
@@ -144,7 +144,7 @@ func dial(ls *Source) (*ldap.Conn, error) {
ServerName: ls.Host,
InsecureSkipVerify: ls.SkipVerify,
}
- if ls.SecurityProtocol == SECURITY_PROTOCOL_LDAPS {
+ if ls.SecurityProtocol == SecurityProtocolLDAPS {
return ldap.DialTLS("tcp", fmt.Sprintf("%s:%d", ls.Host, ls.Port), tlsCfg)
}
@@ -153,7 +153,7 @@ func dial(ls *Source) (*ldap.Conn, error) {
return nil, fmt.Errorf("Dial: %v", err)
}
- if ls.SecurityProtocol == SECURITY_PROTOCOL_START_TLS {
+ if ls.SecurityProtocol == SecurityProtocolStartTLS {
if err = conn.StartTLS(tlsCfg); err != nil {
conn.Close()
return nil, fmt.Errorf("StartTLS: %v", err)