ldap

package
v1.1.1-0...-f35d416 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(sugar *zap.SugaredLogger)

Types

type Config

type Config struct {
	Usr        Credential `yaml:"user"`
	Pwd        Credential `yaml:"password"`
	Servers    []string   `yaml:"servers"`
	MaxRetries int        `yaml:"conn_retries"`
}

func (Config) Password

func (c Config) Password() (pwd string, err error)

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (Config) User

func (c Config) User() (user string, err error)

type Credential

type Credential struct {
	Value  string `yaml:"value"`
	File   string `yaml:"file"`
	Base64 bool   `yaml:"base64"`
}

func (*Credential) GetCred

func (c *Credential) GetCred() (value string, err error)

type Handler

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

func NewLdapHandler

func NewLdapHandler(config Config) (lh *Handler)

func (*Handler) Connect

func (lh *Handler) Connect() (err error)

func (Handler) GetMembers

func (lh Handler) GetMembers(baseDN string, filter string) (baseGroup *Member, err error)

type Member

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

func NewMember

func NewMember(Id string) (m *Member, err error)

func (*Member) AddParent

func (m *Member) AddParent(p *Member)

func (*Member) Dn

func (m *Member) Dn() (dn string)

func (*Member) GetMType

func (m *Member) GetMType() (mt MemberType)

func (*Member) MembershipTree

func (m *Member) MembershipTree() (mss Memberships)

func (*Member) Name

func (m *Member) Name() (name string)

func (*Member) Pair

func (m *Member) Pair() (pair string)

func (*Member) SetFromId

func (m *Member) SetFromId(Id string) (err error)

SetFromId allows dn, id, and name to be set if they are not set yet, but determines it makes sense before doing so

func (*Member) SetMType

func (m *Member) SetMType(mt MemberType) (err error)

type MemberType

type MemberType int
const (
	GroupMType MemberType = iota
	UserMType
	UnknownMType
)

func GetMemberType

func GetMemberType(key string) (mt MemberType)

type Members

type Members map[string]*Member

func (Members) GetById

func (ms Members) GetById(Id string, AddWhenMissing bool) (m *Member, err error)

type Membership

type Membership struct {
	Member   *Member
	MemberOf *Member
}

type Memberships

type Memberships []Membership

Jump to

Keyboard shortcuts

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