ldap

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v1.0.3

func Close(conn *ldap.Conn)

func Open added in v1.0.3

func Open(cfg *Config) (*ldap.Conn, error)

Types

type Config

type Config struct {
	URL            string `yaml:"url" envconfig:"LDAP_URL"`
	StartTLS       bool   `yaml:"startTLS" envconfig:"LDAP_STARTTLS"`
	CertValidation bool   `yaml:"certcheck" envconfig:"LDAP_CERT_VALIDATION"`
	BaseDN         string `yaml:"dn" envconfig:"LDAP_BASEDN"`
	BindUser       string `yaml:"user" envconfig:"LDAP_USER"`
	BindPass       string `yaml:"pass" envconfig:"LDAP_PASSWORD"`

	EmailAttribute       string `yaml:"attrEmail" envconfig:"LDAP_ATTR_EMAIL"`
	FirstNameAttribute   string `yaml:"attrFirstname" envconfig:"LDAP_ATTR_FIRSTNAME"`
	LastNameAttribute    string `yaml:"attrLastname" envconfig:"LDAP_ATTR_LASTNAME"`
	PhoneAttribute       string `yaml:"attrPhone" envconfig:"LDAP_ATTR_PHONE"`
	GroupMemberAttribute string `yaml:"attrGroups" envconfig:"LDAP_ATTR_GROUPS"`

	LoginFilter     string    `yaml:"loginFilter" envconfig:"LDAP_LOGIN_FILTER"` // {{login_identifier}} gets replaced with the login email address
	SyncFilter      string    `yaml:"syncFilter" envconfig:"LDAP_SYNC_FILTER"`
	SyncGroupFilter string    `yaml:"syncGroupFilter" envconfig:"LDAP_SYNC_GROUP_FILTER"`
	AdminLdapGroup  string    `yaml:"adminGroup" envconfig:"LDAP_ADMIN_GROUP"` // Members of this group receive admin rights in WG-Portal
	AdminLdapGroup_ *gldap.DN `yaml:"-"`
	EveryoneAdmin   bool      `yaml:"everyoneAdmin" envconfig:"LDAP_EVERYONE_ADMIN"`
	LdapCertConn    bool      `yaml:"ldapCertConn" envconfig:"LDAP_CERT_CONN"`
	LdapTlsCert     string    `yaml:"ldapTlsCert" envconfig:"LDAPTLS_CERT"`
	LdapTlsKey      string    `yaml:"ldapTlsKey" envconfig:"LDAPTLS_KEY"`
}

type ObjectType added in v1.0.17

type ObjectType int
const (
	Users ObjectType = iota
	Groups
)

type RawLdapData

type RawLdapData struct {
	DN            string
	Attributes    map[string]string
	RawAttributes map[string][][]byte
}

func FindAllObjects added in v1.0.17

func FindAllObjects(cfg *Config, objType ObjectType) ([]RawLdapData, error)

type Type added in v1.0.3

type Type string
const (
	TypeActiveDirectory Type = "AD"
	TypeOpenLDAP        Type = "OpenLDAP"
)

Jump to

Keyboard shortcuts

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