ldap

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BindRequest           = 0
	BindResponse          = 1
	UnbindRequest         = 2
	SearchRequest         = 3
	SearchResultEntry     = 4
	SearchResultDone      = 5
	ModifyRequest         = 6
	ModifyResponse        = 7
	AddRequest            = 8
	AddResponse           = 9
	DelRequest            = 10
	DelResponse           = 11
	ModifyDNRequest       = 12
	ModifyDNResponse      = 13
	CompareRequest        = 14
	CompareResponse       = 15
	AbandonRequest        = 16
	SearchResultReference = 19
	ExtendedRequest       = 23
	ExtendedResponse      = 24
	IntermediateResponse  = 25
)

Operation codes defined in RFC 4511 BindRequest = 0

View Source
const (
	Success                      = 0
	OperationsError              = 1
	ProtocolError                = 2
	TimeLimitExceeded            = 3
	SizeLimitExceeded            = 4
	CompareFalse                 = 5
	CompareTrue                  = 6
	AuthMethodNotSupported       = 7
	StrongerAuthRequired         = 8
	Referral                     = 10
	AdminLimitExceeded           = 11
	UnavailableCriticalExtension = 12
	ConfidentialityRequired      = 13
	SaslBindInProgress           = 14
	NoSuchAttribute              = 16
	UndefinedAttributeType       = 17
	InappropriateMatching        = 18
	ConstraintViolation          = 19
	AttributeOrValueExists       = 20
	InvalidAttributeSyntax       = 21
	NoSuchObject                 = 32
	AliasProblem                 = 33
	InvalidDNSyntax              = 34
	AliasDereferencingProblem    = 36
	InappropriateAuthentication  = 48
	InvalidCredentials           = 49
	InsufficientAccessRights     = 50
	Busy                         = 51
	Unavailable                  = 52
	UnwillingToPerform           = 53
	LoopDetect                   = 54
	NamingViolation              = 64
	ObjectClassViolation         = 65
	NotAllowedOnNonLeaf          = 66
	NotAllowedOnRDN              = 67
	EntryAlreadyExists           = 68
	ObjectClassModsProhibited    = 69
	AffectsMultipleDSAs          = 71
	Other                        = 80
)

LDAP result codes defined in RFC 4511 See: https://tools.ietf.org/html/rfc4511#page-18

View Source
const (
	Simple = 0
	Sasl   = 3
)

Authentication Choices defined in RFC 4511

View Source
const (
	BaseObject   = 0
	SingleLevel  = 1
	WholeSubtree = 2
)

Scopes defined in RFC 4511

View Source
const (
	FilterAnd             = 0
	FilterOr              = 1
	FilterNot             = 2
	FilterEquality        = 3
	FilterSubstrings      = 4
	FilterGreaterOrEqual  = 5
	FilterLessOrEqual     = 6
	FilterPresent         = 7
	FilterApproxMatch     = 8
	FilterExtensibleMatch = 9
)
View Source
const Version3 = 3

Version3 - Supported LDAP Protocol version 3

View Source
const WhoamIOID = "1.3.6.1.4.1.4203.1.11.3"

WhoamIOID - OID defined for whoami in RFC 4532

Variables

This section is empty.

Functions

func GetDomain

func GetDomain(domain string) string

func HandleBind

func HandleBind(message *Message, settings types.LDAPSettings, remoteAddr string) (*ber.Packet, string, error)

HandleBind - TODO comment

func HandleExtRequest

func HandleExtRequest(message *Message, username string) (*ber.Packet, error)

HandleExtRequest - TODO comment

func HandleSearchRequest

func HandleSearchRequest(message *Message, settings types.LDAPSettings) ([]*ber.Packet, error)

HandleSearchRequest - TODO comment

func HandleUnsupportedOperation

func HandleUnsupportedOperation(message *Message) (*ber.Packet, error)

HandleUnsupportedOperation - TODO comment

func Server

func Server(wg *sync.WaitGroup, shutdownChannel chan bool, settings types.LDAPSettings)

Server - TODO comment

Types

type Message

type Message struct {
	ID                      int64
	Op                      int64
	Request                 []*ber.Packet
	Paging                  bool
	PagedResultsSize        int64
	PagedResultsCookie      string
	PagedResultsCriticality bool
}

Message - TODO comment

func DecodeMessage

func DecodeMessage(p *ber.Packet) (*Message, error)

DecodeMessage - TODO comment

type ServerError

type ServerError struct {
	Msg  string // error
	Code int64  // LDAP result codes defined in RFC 4511
}

ServerError - TODO comment

Jump to

Keyboard shortcuts

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