ldap

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUserFound = errors.New("no LDAP entries found for user")
)

Functions

This section is empty.

Types

type LDAP

type LDAP struct {
	Server           string   `yaml:"server"`
	BaseDN           string   `yaml:"baseDN"`
	UserDN           string   `yaml:"userDN"`
	UserSearchFilter string   `yaml:"userSearchFilter"`
	Attributes       []string `yaml:"attributes"`
}

type LDAPClient

type LDAPClient interface {
	GetUserLDAPData(ctx context.Context, userID string) (map[string]interface{}, error)
}

func InitLdap

func InitLdap(ldapConfig LDAP) (LDAPClient, error)

InitLdap initializes a connection to the LDAP server using the provided configuration.

type LDAPConn

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

func (*LDAPConn) GetBaseDN

func (l *LDAPConn) GetBaseDN() string

GetBaseDN returns the base DN for the LDAP connection.

func (*LDAPConn) GetUserDN

func (l *LDAPConn) GetUserDN() string

GetUserDN returns the user DN for the LDAP connection.

func (*LDAPConn) GetUserLDAPData

func (l *LDAPConn) GetUserLDAPData(ctx context.Context, userID string) (map[string]interface{}, error)

type LDAPConnClient

type LDAPConnClient interface {
	IsClosing() bool
	Search(*ldap.SearchRequest) (*ldap.SearchResult, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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