Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ProviderName is the auth method reported by the LDAP credential provider. ProviderName = "ldap" DefaultUserFilter = "(uid={username})" DefaultGroupFilter = "(member={dn})" DefaultUsernameAttribute = "uid" DefaultEmailAttribute = "mail" DefaultDisplayNameAttribute = "displayName" DefaultGroupAttribute = "cn" DefaultTimeout = 10 * time.Second )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool
URL string
StartTLS bool
TLSConfig *tls.Config
Timeout time.Duration
BindDN string
BindPassword string
UserBaseDN string
UserFilter string
GroupBaseDN string
GroupFilter string
GroupAttribute string
UsernameAttribute string
EmailAttribute string
DisplayNameAttribute string
Dial DialFunc
}
Config configures the LDAP credential provider.
func ConfigFromEnv ¶
func ConfigFromEnv(vars env.Environment) Config
ConfigFromEnv converts Caesium environment config into provider config.
type Conn ¶
type Conn interface {
Bind(username, password string) error
Search(searchRequest *gldap.SearchRequest) (*gldap.SearchResult, error)
StartTLS(config *tls.Config) error
SetTimeout(timeout time.Duration)
Close() error
}
Conn is the subset of go-ldap's connection used by the provider.
type DialFunc ¶
DialFunc opens an LDAP connection. Tests can provide one to avoid a live LDAP server while still exercising bind/search flow.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements Caesium credential authentication for LDAP directories.
func New ¶
New constructs an LDAP credential provider. It does not connect to LDAP until Authenticate is called.
func (*Provider) Authenticate ¶
func (p *Provider) Authenticate(ctx context.Context, username, password string) (*authpkg.ExternalIdentity, error)
Authenticate verifies user credentials with search-then-bind and returns a normalized external identity for the shared SSO completion path.
Click to show internal directories.
Click to hide internal directories.