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