auth

package
v0.0.1-alpha.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLDAPTimeout = errors.New("LDAP timeout")

Functions

func BasicAuthLDAP

func BasicAuthLDAP(ldapAuth *LDAPAuth, next httprouter.Handle) httprouter.Handle

BasicAuthLDAP is a middleware wrapping the target HTTP HandlerFunc. It retrieves BasicAuth credentials and authenticate against LDAP.

func SetLDAPDefaultTimeout

func SetLDAPDefaultTimeout(timeout time.Duration)

Types

type BasicAuth

type BasicAuth struct {
	// contains filtered or unexported fields
}

func NewBasicAuth

func NewBasicAuth(ctx context.Context, cfg config.AuthConfig) (BasicAuth, error)

func (*BasicAuth) Wrap

type LDAPAuth

type LDAPAuth struct {
	// contains filtered or unexported fields
}

func NewLDAPAuth

func NewLDAPAuth(ldapURL string, bindDN string, password string, baseDN string, tlsConfig *tls.Config) *LDAPAuth

func (*LDAPAuth) AuthenticateUser

func (l *LDAPAuth) AuthenticateUser(username string, password string) bool

func (*LDAPAuth) SetMaxConnectionLifetime

func (l *LDAPAuth) SetMaxConnectionLifetime(maxConnectionLifetime time.Duration)

SetMaxConnectionLifetime sets the maximum lifetime of a connection.

The maximum lifetime is the maximum amount of time a connection may be reused for. This is not a guarantee, as the connection may have been closed by the server before reaching that timer.

func (*LDAPAuth) StartAuthenticationWorkers

func (l *LDAPAuth) StartAuthenticationWorkers(ctx context.Context, workersCount int) error

StartAuthenticationWorkers starts a pool of workers that will handle the authentication requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL