ldap

package
v0.0.0-...-05965fc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016-2019 DutchSec (https://dutchsec.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// LDAP App Codes
	AppBindRequest           = 0
	AppBindResponse          = 1
	AppUnbindRequest         = 2
	AppSearchRequest         = 3
	AppSearchResultEntry     = 4
	AppSearchResultDone      = 5
	AppModifyRequest         = 6
	AppModifyResponse        = 7
	AppAddRequest            = 8
	AppAddResponse           = 9
	AppDelRequest            = 10
	AppDelResponse           = 11
	AppModifyDNRequest       = 12
	AppModifyDNResponse      = 13
	AppCompareRequest        = 14
	AppCompareResponse       = 15
	AppAbandonRequest        = 16
	AppSearchResultReference = 19
	AppExtendedRequest       = 23
	AppExtendedResponse      = 24

	// LDAP result codes
	ResSuccess                  = 0
	ResOperationsError          = 1
	ResProtocolError            = 2
	ResNoSuchObject             = 32
	ResInvalidCred              = 49
	ResInsufficientAccessRights = 50
	ResUnwillingToPerform       = 53
	ResOther                    = 80
)

Variables

View Source
var (
	//ErrNotASearchRequest error if it is not a search request
	ErrNotASearchRequest = errors.New("not a search request")
)

Functions

func LDAP

func LDAP(options ...services.ServicerFunc) services.Servicer

LDAP service setup

Types

type AttributeMap

type AttributeMap map[string][]string

AttributeMap holding attributes for a search result entry

type CatchAll

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

CatchAll handles the not implemented LDAP requests

type Conn

type Conn struct {
	ConnReader *bufio.Reader
	// contains filtered or unexported fields
}

func NewConn

func NewConn(c net.Conn) *Conn

func (*Conn) StartTLS

func (c *Conn) StartTLS(config *tls.Config) error

StartTLS

type DSE

type DSE struct {
	NamingContexts       []string `toml:"naming-contexts"`
	SupportedLDAPVersion []string `toml:"supported-ldap-version"`
	SupportedExtension   []string `toml:"supported-extension"`
	VendorName           []string `toml:"vendor-name"`
	VendorVersion        []string `toml:"vendor-version"`
	Description          []string `toml:"description"`
	ObjectClass          []string `toml:"objectclass"`
}

func (*DSE) Get

func (d *DSE) Get() *SearchResultEntry

Get return the rootDSE as search result

type SearchRequest

type SearchRequest struct {
	Packet       *ber.Packet
	BaseDN       string // DN under which to start searching
	Scope        int64  // baseObject(0), singleLevel(1), wholeSubtree(2)
	DerefAliases int64  // neverDerefAliases(0),derefInSearching(1),derefFindingBaseObj(2),derefAlways(3)
	SizeLimit    int64  // max number of results to return
	TimeLimit    int64  // max time in seconds to spend processing
	TypesOnly    bool   // if true client is expecting only type info
	FilterAttr   string // filter attribute name (assumed to be an equality match with just this one attribute)
	FilterValue  string // filter attribute value
}

SearchRequest a simplified ldap search request

type SearchResultEntry

type SearchResultEntry struct {
	DN    string // DN of this search result
	Attrs AttributeMap
}

SearchResultEntry a simplified ldap search response

type Server

type Server struct {
	Handlers []requestHandler

	Credentials []string `toml:"credentials"`

	*DSE
	// contains filtered or unexported fields
}

Server ldap server data

Jump to

Keyboard shortcuts

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