adhelper

package
v0.0.0-...-33a070e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CNre = regexp.MustCompile(`[Cc][Nn]=([A-Za-z0-9]+)(?:,[Oo][Uu]=[A-Za-z0-9-]+)*(?:,[Dd][Cc]=[A-Za-z0-9-]+)*`)

In theory this should match any AD Canonical Name (CN) with a submatch of just the non-canonical name.

Functions

func GetADDeptMembers

func GetADDeptMembers(ldapOpts *LdapOpts, deptName string) ([]string, error)

func GetADGroupMembers

func GetADGroupMembers(ldapOpts *LdapOpts, groupname string) ([]string, error)

Returns a slice containing the usernames of members of an AD group.

func RunADSearch

func RunADSearch(opts *LdapOpts, searchExpression string, returnFields []string) (*ldap.SearchResult, error)

Types

type LdapOpts

type LdapOpts struct {
	ServerUrl string `yaml:"server_url"`
	Username  string `yaml:"bind_username"`
	Password  string `yaml:"bind_password"`
	BaseDN    string `yaml:"base_dn"`
	Insecure  bool   `yaml:"allow_insecure"`
	CertFile  string `yaml:"cert_file"`
}

Jump to

Keyboard shortcuts

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