2019-12-06 08:15:54 +00:00
|
|
|
package authentication
|
|
|
|
|
|
|
|
import (
|
2020-03-19 04:22:46 +00:00
|
|
|
"github.com/go-ldap/ldap/v3"
|
2019-12-06 08:15:54 +00:00
|
|
|
)
|
|
|
|
|
2022-05-02 01:51:38 +00:00
|
|
|
// ProductionLDAPConnectionFactory the production implementation of an ldap connection factory.
|
|
|
|
type ProductionLDAPConnectionFactory struct{}
|
2019-12-06 08:15:54 +00:00
|
|
|
|
2022-05-02 01:51:38 +00:00
|
|
|
// NewProductionLDAPConnectionFactory create a concrete ldap connection factory.
|
|
|
|
func NewProductionLDAPConnectionFactory() *ProductionLDAPConnectionFactory {
|
|
|
|
return &ProductionLDAPConnectionFactory{}
|
2019-12-06 08:15:54 +00:00
|
|
|
}
|
|
|
|
|
2021-01-04 10:28:55 +00:00
|
|
|
// DialURL creates a connection from an LDAP URL when successful.
|
2022-05-02 01:51:38 +00:00
|
|
|
func (f *ProductionLDAPConnectionFactory) DialURL(addr string, opts ...ldap.DialOpt) (conn LDAPConnection, err error) {
|
|
|
|
return ldap.DialURL(addr, opts...)
|
2019-12-06 08:15:54 +00:00
|
|
|
}
|