ldapUser

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Overview

Package ldapUser provides a Service that uses LDAP for user authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger added in v0.4.1

type Logger interface {
	Debugf(format string, a ...interface{})
}

Logger defines interface for logging messages with various severity levels.

type Options

type Options struct {
	Enabled              bool
	Host                 string
	Port                 uint
	Secure               bool
	Username             string
	Password             string
	DN                   string
	DNUsers              string
	DNGroups             string
	AttributeUsername    string
	AttributeName        string
	AttributeEmail       string
	AttributeGroupID     string
	AttributeGroupMember string
	Groups               []string
	MaxConnections       int
	Timeout              time.Duration
}

Options are holds LDAP specific parameters.

type Service

type Service struct {
	user.Service
	Options
	// contains filtered or unexported fields
}

Service encapsulates an instance of user.Service and Options to wrap Authenticate method.

func NewService

func NewService(userService user.Service, logger Logger, o Options) *Service

NewService returns a new instance of Service.

func (*Service) Authenticate

func (s *Service) Authenticate(ref, password string) (u *user.User, err error)

Authenticate authenticates a user over LDAP and if authentication fails it falls back to authentication by wrapped user service. If the user did not exist in wrapped user service, it will be created.

func (Service) DataDump

func (s Service) DataDump(ifModifiedSince *time.Time) (dump *dataDump.Dump, err error)

DataDump proxies encapsulated User service's DataDump method if it implements dataDump.Interface interface.

Jump to

Keyboard shortcuts

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