gldap

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 21 Imported by: 9

README

gldap

Go Reference Coverage Go Report Card


gldap is a framework for building LDAP services. Among other things, it defines abstractions for:

  • Server: supports both LDAP and LDAPS (TLS) protocols as well as the StartTLS requests.
  • Request: represents an LDAP request (bind, search, extended, etc) along with the inbound request message.
  • ResponseWriter: allows you to compose request responses.
  • Mux: an ldap request multiplexer. It matches the inbound request against a list of registered route handlers.
  • HandlerFunc: handlers provided to the Mux which serve individual ldap requests.

Example:

package main

import (
	"context"
	"log"
	"os"
	"os/signal"
	"syscall"

	"github.com/jimlambrt/gldap"
)

func main() {
	// create a new server
	s, err := gldap.NewServer()
	if err != nil {
		log.Fatalf("unable to create server: %s", err.Error())
	}

	// create a router and add a bind handler
	r, err := gldap.NewMux()
	if err != nil {
		log.Fatalf("unable to create router: %s", err.Error())
	}
	r.Bind(bindHandler)
	r.Search(searchHandler)
	s.Router(r)
	go s.Run(":10389") // listen on port 10389

	// stop server gracefully when ctrl-c, sigint or sigterm occurs
	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
	defer stop()
	select {
	case <-ctx.Done():
		log.Printf("\nstopping directory")
		s.Stop()
	}
}

func bindHandler(w *gldap.ResponseWriter, r *gldap.Request) {
	resp := r.NewBindResponse(
		gldap.WithResponseCode(gldap.ResultInvalidCredentials),
	)
	defer func() {
		w.Write(resp)
	}()

	m, err := r.GetSimpleBindMessage()
	if err != nil {
		log.Printf("not a simple bind message: %s", err)
		return
	}

	if m.UserName == "alice" {
		resp.SetResultCode(gldap.ResultSuccess)
		log.Println("bind success")
		return
	}

func searchHandler(w *gldap.ResponseWriter, r *gldap.Request) {
	resp := r.NewSearchDoneResponse()
	defer func() {
		w.Write(resp)
	}()
	m, err := r.GetSearchMessage()
	if err != nil {
		log.Printf("not a search message: %s", err)
		return
	}
	log.Printf("search base dn: %s", m.BaseDN)
	log.Printf("search scope: %d", m.Scope)
	log.Printf("search filter: %s", m.Filter)

	if strings.Contains(m.Filter, "uid=alice") || m.BaseDN == "uid=alice,ou=people,cn=example,dc=org" {
		entry := r.NewSearchResponseEntry(
			"uid=alice,ou=people,cn=example,dc=org",
			gldap.WithAttributes(map[string][]string{
				"objectclass": {"top", "person", "organizationalPerson", "inetOrgPerson"},
				"uid":         {"alice"},
				"cn":          {"alice eve smith"},
				"givenname":   {"alice"},
				"sn":          {"smith"},
				"ou":          {"people"},
				"description": {"friend of Rivest, Shamir and Adleman"},
				"password":    {"{SSHA}U3waGJVC7MgXYc0YQe7xv7sSePuTP8zN"},
			}),
		)
		entry.AddAttribute("email", []string{"alice@example.org"})
		w.Write(entry)
		resp.SetResultCode(gldap.ResultSuccess)
	}
	if m.BaseDN == "ou=people,cn=example,dc=org" {
		entry := r.NewSearchResponseEntry(
			"ou=people,cn=example,dc=org",
			gldap.WithAttributes(map[string][]string{
				"objectclass": {"organizationalUnit"},
				"ou":          {"people"},
			}),
		)
		w.Write(entry)
		resp.SetResultCode(gldap.ResultSuccess)
	}
	return
}

Road map

Currently supported features:
  • ldap, ldaps and mTLS connections
  • StartTLS Requests
  • Bind Requests
    • Simple Auth (user/pass)
  • Search Requests
  • Modify Requests
  • Add Requests
  • Delete Requests
  • Unbind Requests
Future features

At this point, we may wait until issues are opened before planning new features given that all the basic LDAP operations are supported.


gldap.testdirectory

Go Reference

The testdirectory package built using gldap which provides an in-memory test LDAP service with capabilities which make writing tests that depend on an LDAP service much easier.

testdirectory is also a great working example of how you can use gldap to build a custom ldap server to meet your specific needs.

Example:

// this testdirectory example demonstrates how can start a test directory for 
// your unit tests which will automatically stop when the test is complete. 
func TestExample(t *testing.T) {

	// start a test directory running ldaps on an available free port (defaults)
	// that allows anon binds (a default override)
	td := testdirectory.Start(t,
		testdirectory.WithDefaults(&testdirectory.Defaults{AllowAnonymousBind: true}),
	)
	// create some test new user entries (using defaults for ou, password, etc)
	users := testdirectory.NewUsers(t, []string{"alice", "bob"})
	// set the test directories user entries
	td.SetUsers(users...)

	// INSERT your tests here....
}

Documentation

Index

Constants

View Source
const (
	ResultSuccess                            = 0
	ResultOperationsError                    = 1
	ResultProtocolError                      = 2
	ResultTimeLimitExceeded                  = 3
	ResultSizeLimitExceeded                  = 4
	ResultCompareFalse                       = 5
	ResultCompareTrue                        = 6
	ResultAuthMethodNotSupported             = 7
	ResultStrongAuthRequired                 = 8
	ResultReferral                           = 10
	ResultAdminLimitExceeded                 = 11
	ResultUnavailableCriticalExtension       = 12
	ResultConfidentialityRequired            = 13
	ResultSaslBindInProgress                 = 14
	ResultNoSuchAttribute                    = 16
	ResultUndefinedAttributeType             = 17
	ResultInappropriateMatching              = 18
	ResultConstraintViolation                = 19
	ResultAttributeOrValueExists             = 20
	ResultInvalidAttributeSyntax             = 21
	ResultNoSuchObject                       = 32
	ResultAliasProblem                       = 33
	ResultInvalidDNSyntax                    = 34
	ResultIsLeaf                             = 35
	ResultAliasDereferencingProblem          = 36
	ResultInappropriateAuthentication        = 48
	ResultInvalidCredentials                 = 49
	ResultInsufficientAccessRights           = 50
	ResultBusy                               = 51
	ResultUnavailable                        = 52
	ResultUnwillingToPerform                 = 53
	ResultLoopDetect                         = 54
	ResultSortControlMissing                 = 60
	ResultOffsetRangeError                   = 61
	ResultNamingViolation                    = 64
	ResultObjectClassViolation               = 65
	ResultNotAllowedOnNonLeaf                = 66
	ResultNotAllowedOnRDN                    = 67
	ResultEntryAlreadyExists                 = 68
	ResultObjectClassModsProhibited          = 69
	ResultResultsTooLarge                    = 70
	ResultAffectsMultipleDSAs                = 71
	ResultVirtualListViewErrorOrControlError = 76
	ResultOther                              = 80
	ResultServerDown                         = 81
	ResultLocalError                         = 82
	ResultEncodingError                      = 83
	ResultDecodingError                      = 84
	ResultTimeout                            = 85
	ResultAuthUnknown                        = 86
	ResultFilterError                        = 87
	ResultUserCanceled                       = 88
	ResultParamError                         = 89
	ResultNoMemory                           = 90
	ResultConnectError                       = 91
	ResultNotSupported                       = 92
	ResultControlNotFound                    = 93
	ResultNoResultsReturned                  = 94
	ResultMoreResultsToReturn                = 95
	ResultClientLoop                         = 96
	ResultReferralLimitExceeded              = 97
	ResultInvalidResponse                    = 100
	ResultAmbiguousResponse                  = 101
	ResultTLSNotSupported                    = 112
	ResultIntermediateResponse               = 113
	ResultUnknownType                        = 114
	ResultCanceled                           = 118
	ResultNoSuchOperation                    = 119
	ResultTooLate                            = 120
	ResultCannotCancel                       = 121
	ResultAssertionFailed                    = 122
	ResultAuthorizationDenied                = 123
	ResultSyncRefreshRequired                = 4096
)

ldap result codes

View Source
const (
	ApplicationBindRequest           = 0
	ApplicationBindResponse          = 1
	ApplicationUnbindRequest         = 2
	ApplicationSearchRequest         = 3
	ApplicationSearchResultEntry     = 4
	ApplicationSearchResultDone      = 5
	ApplicationModifyRequest         = 6
	ApplicationModifyResponse        = 7
	ApplicationAddRequest            = 8
	ApplicationAddResponse           = 9
	ApplicationDelRequest            = 10
	ApplicationDelResponse           = 11
	ApplicationModifyDNRequest       = 12
	ApplicationModifyDNResponse      = 13
	ApplicationCompareRequest        = 14
	ApplicationCompareResponse       = 15
	ApplicationAbandonRequest        = 16
	ApplicationSearchResultReference = 19
	ApplicationExtendedRequest       = 23
	ApplicationExtendedResponse      = 24
)

ldap application codes

View Source
const (
	// ControlTypePaging - https://www.ietf.org/rfc/rfc2696.txt
	ControlTypePaging = "1.2.840.113556.1.4.319"
	// ControlTypeBeheraPasswordPolicy - https://tools.ietf.org/html/draft-behera-ldap-password-policy-10
	ControlTypeBeheraPasswordPolicy = "1.3.6.1.4.1.42.2.27.8.5.1"
	// ControlTypeVChuPasswordMustChange - https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00
	ControlTypeVChuPasswordMustChange = "2.16.840.1.113730.3.4.4"
	// ControlTypeVChuPasswordWarning - https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00
	ControlTypeVChuPasswordWarning = "2.16.840.1.113730.3.4.5"
	// ControlTypeManageDsaIT - https://tools.ietf.org/html/rfc3296
	ControlTypeManageDsaIT = "2.16.840.1.113730.3.4.2"
	// ControlTypeWhoAmI - https://tools.ietf.org/html/rfc4532
	ControlTypeWhoAmI = "1.3.6.1.4.1.4203.1.11.3"

	// ControlTypeMicrosoftNotification - https://msdn.microsoft.com/en-us/library/aa366983(v=vs.85).aspx
	ControlTypeMicrosoftNotification = "1.2.840.113556.1.4.528"
	// ControlTypeMicrosoftShowDeleted - https://msdn.microsoft.com/en-us/library/aa366989(v=vs.85).aspx
	ControlTypeMicrosoftShowDeleted = "1.2.840.113556.1.4.417"
	// ControlTypeMicrosoftServerLinkTTL - https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/f4f523a8-abc0-4b3a-a471-6b2fef135481?redirectedfrom=MSDN
	ControlTypeMicrosoftServerLinkTTL = "1.2.840.113556.1.4.2309"
)
View Source
const (
	BeheraPasswordExpired             = 0
	BeheraAccountLocked               = 1
	BeheraChangeAfterReset            = 2
	BeheraPasswordModNotAllowed       = 3
	BeheraMustSupplyOldPassword       = 4
	BeheraInsufficientPasswordQuality = 5
	BeheraPasswordTooShort            = 6
	BeheraPasswordTooYoung            = 7
	BeheraPasswordInHistory           = 8
)

Ldap Behera Password Policy Draft 10 (https://tools.ietf.org/html/draft-behera-ldap-password-policy-10)

View Source
const (
	AddAttribute       = 0
	DeleteAttribute    = 1
	ReplaceAttribute   = 2
	IncrementAttribute = 3 // (https://tools.ietf.org/html/rfc4525)
)

Change operation choices

Variables

View Source
var (
	// ErrUnknown is an unknown/undefined error
	ErrUnknown = errors.New("unknown")

	// ErrInvalidParameter is an invalid parameter error
	ErrInvalidParameter = errors.New("invalid parameter")

	// ErrInvalidState is an invalid state error
	ErrInvalidState = errors.New("invalid state")

	// ErrInternal is an internal error
	ErrInternal = errors.New("internal error")
)
View Source
var ApplicationCodeMap = map[uint8]string{
	ApplicationBindRequest:           "Bind Request",
	ApplicationBindResponse:          "Bind Response",
	ApplicationUnbindRequest:         "Unbind Request",
	ApplicationSearchRequest:         "Search Request",
	ApplicationSearchResultEntry:     "Search Result Entry",
	ApplicationSearchResultDone:      "Search Result Done",
	ApplicationModifyRequest:         "Modify Request",
	ApplicationModifyResponse:        "Modify Response",
	ApplicationAddRequest:            "Add Request",
	ApplicationAddResponse:           "Add Response",
	ApplicationDelRequest:            "Del Request",
	ApplicationDelResponse:           "Del Response",
	ApplicationModifyDNRequest:       "Modify DN Request",
	ApplicationModifyDNResponse:      "Modify DN Response",
	ApplicationCompareRequest:        "Compare Request",
	ApplicationCompareResponse:       "Compare Response",
	ApplicationAbandonRequest:        "Abandon Request",
	ApplicationSearchResultReference: "Search Result Reference",
	ApplicationExtendedRequest:       "Extended Request",
	ApplicationExtendedResponse:      "Extended Response",
}

ApplicationCodeMap contains human readable descriptions of ldap application codes

View Source
var BeheraPasswordPolicyErrorMap = map[int8]string{
	BeheraPasswordExpired:             "Password expired",
	BeheraAccountLocked:               "Account locked",
	BeheraChangeAfterReset:            "Password must be changed",
	BeheraPasswordModNotAllowed:       "Policy prevents password modification",
	BeheraMustSupplyOldPassword:       "Policy requires old password in order to change password",
	BeheraInsufficientPasswordQuality: "Password fails quality checks",
	BeheraPasswordTooShort:            "Password is too short for policy",
	BeheraPasswordTooYoung:            "Password has been changed too recently",
	BeheraPasswordInHistory:           "New password is in list of old passwords",
}

BeheraPasswordPolicyErrorMap contains human readable descriptions of Behera Password Policy error codes

View Source
var ControlTypeMap = map[string]string{
	ControlTypePaging:                 "Paging",
	ControlTypeBeheraPasswordPolicy:   "Password Policy - Behera Draft",
	ControlTypeManageDsaIT:            "Manage DSA IT",
	ControlTypeMicrosoftNotification:  "Change Notification - Microsoft",
	ControlTypeMicrosoftShowDeleted:   "Show Deleted Objects - Microsoft",
	ControlTypeMicrosoftServerLinkTTL: "Return TTL-DNs for link values with associated expiry times - Microsoft",
}

ControlTypeMap maps controls to text descriptions

View Source
var ResultCodeMap = map[uint16]string{
	ResultSuccess:                            "Success",
	ResultOperationsError:                    "Operations Error",
	ResultProtocolError:                      "Protocol Error",
	ResultTimeLimitExceeded:                  "Time Limit Exceeded",
	ResultSizeLimitExceeded:                  "Size Limit Exceeded",
	ResultCompareFalse:                       "Compare False",
	ResultCompareTrue:                        "Compare True",
	ResultAuthMethodNotSupported:             "Auth Method Not Supported",
	ResultStrongAuthRequired:                 "Strong Auth Required",
	ResultReferral:                           "Referral",
	ResultAdminLimitExceeded:                 "Admin Limit Exceeded",
	ResultUnavailableCriticalExtension:       "Unavailable Critical Extension",
	ResultConfidentialityRequired:            "Confidentiality Required",
	ResultSaslBindInProgress:                 "Sasl Bind In Progress",
	ResultNoSuchAttribute:                    "No Such Attribute",
	ResultUndefinedAttributeType:             "Undefined Attribute Type",
	ResultInappropriateMatching:              "Inappropriate Matching",
	ResultConstraintViolation:                "Constraint Violation",
	ResultAttributeOrValueExists:             "Attribute Or Value Exists",
	ResultInvalidAttributeSyntax:             "Invalid Attribute Syntax",
	ResultNoSuchObject:                       "No Such Object",
	ResultAliasProblem:                       "Alias Problem",
	ResultInvalidDNSyntax:                    "Invalid DN Syntax",
	ResultIsLeaf:                             "Is Leaf",
	ResultAliasDereferencingProblem:          "Alias Dereferencing Problem",
	ResultInappropriateAuthentication:        "Inappropriate Authentication",
	ResultInvalidCredentials:                 "Invalid Credentials",
	ResultInsufficientAccessRights:           "Insufficient Access Rights",
	ResultBusy:                               "Busy",
	ResultUnavailable:                        "Unavailable",
	ResultUnwillingToPerform:                 "Unwilling To Perform",
	ResultLoopDetect:                         "Loop Detect",
	ResultSortControlMissing:                 "Sort Control Missing",
	ResultOffsetRangeError:                   "Result Offset Range Error",
	ResultNamingViolation:                    "Naming Violation",
	ResultObjectClassViolation:               "Object Class Violation",
	ResultResultsTooLarge:                    "Results Too Large",
	ResultNotAllowedOnNonLeaf:                "Not Allowed On Non Leaf",
	ResultNotAllowedOnRDN:                    "Not Allowed On RDN",
	ResultEntryAlreadyExists:                 "Entry Already Exists",
	ResultObjectClassModsProhibited:          "Object Class Mods Prohibited",
	ResultAffectsMultipleDSAs:                "Affects Multiple DSAs",
	ResultVirtualListViewErrorOrControlError: "Failed because of a problem related to the virtual list view",
	ResultOther:                              "Other",
	ResultServerDown:                         "Cannot establish a connection",
	ResultLocalError:                         "An error occurred",
	ResultEncodingError:                      " encountered an error while encoding",
	ResultDecodingError:                      " encountered an error while decoding",
	ResultTimeout:                            " timeout while waiting for a response from the server",
	ResultAuthUnknown:                        "The auth method requested in a bind request is unknown",
	ResultFilterError:                        "An error occurred while encoding the given search filter",
	ResultUserCanceled:                       "The user canceled the operation",
	ResultParamError:                         "An invalid parameter was specified",
	ResultNoMemory:                           "Out of memory error",
	ResultConnectError:                       "A connection to the server could not be established",
	ResultNotSupported:                       "An attempt has been made to use a feature not supported ",
	ResultControlNotFound:                    "The controls required to perform the requested operation were not found",
	ResultNoResultsReturned:                  "No results were returned from the server",
	ResultMoreResultsToReturn:                "There are more results in the chain of results",
	ResultClientLoop:                         "A loop has been detected. For example when following referrals",
	ResultReferralLimitExceeded:              "The referral hop limit has been exceeded",
	ResultCanceled:                           "Operation was canceled",
	ResultNoSuchOperation:                    "Server has no knowledge of the operation requested for cancellation",
	ResultTooLate:                            "Too late to cancel the outstanding operation",
	ResultCannotCancel:                       "The identified operation does not support cancellation or the cancel operation cannot be performed",
	ResultAssertionFailed:                    "An assertion control given in the  operation evaluated to false causing the operation to not be performed",
	ResultSyncRefreshRequired:                "Refresh Required",
	ResultInvalidResponse:                    "Invalid Response",
	ResultAmbiguousResponse:                  "Ambiguous Response",
	ResultTLSNotSupported:                    "Tls Not Supported",
	ResultIntermediateResponse:               "Intermediate Response",
	ResultUnknownType:                        "Unknown Type",
	ResultAuthorizationDenied:                "Authorization Denied",
}

ResultCodeMap contains string descriptions for ldap result codes

Functions

func ConvertString added in v0.1.3

func ConvertString(octetString ...string) ([]string, error)

ConvertString will convert an ASN1 BER Octet string into a "native" go string. Support ber string encoding types: OctetString, GeneralString and all other types will return an error.

func SIDBytes

func SIDBytes(revision uint8, identifierAuthority uint16) ([]byte, error)

SIDBytes creates a SID from the provided revision and identifierAuthority

func SIDBytesToString

func SIDBytesToString(b []byte) (string, error)

SIDBytesToString will convert SID bytes to a string

func TestEncodeString added in v0.1.3

func TestEncodeString(t *testing.T, tag ber.Tag, s string, opt ...Option) string

func TestWithDebug

func TestWithDebug(t *testing.T) bool

TestWithDebug specifies that the test should be run under "debug" mode

Types

type AddMessage

type AddMessage struct {

	// DN identifies the entry being added
	DN string
	// Attributes list the attributes of the new entry
	Attributes []Attribute
	// Controls hold optional controls to send with the request
	Controls []Control
	// contains filtered or unexported fields
}

AddMessage is an add request message

func (AddMessage) GetID

func (m AddMessage) GetID() int64

GetID() returns the message ID

type Attribute

type Attribute struct {
	// Type is the name of the LDAP attribute
	Type string
	// Vals are the LDAP attribute values
	Vals []string
}

Attribute represents an LDAP attribute within AddMessage

type AuthChoice

type AuthChoice string

AuthChoice defines the authentication choice for bind message

const SimpleAuthChoice AuthChoice = "simple"

SimpleAuthChoice specifies a simple user/password authentication choice for the bind message

type BindResponse

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

BindResponse represents the response to a bind request

func (*BindResponse) SetControls

func (r *BindResponse) SetControls(controls ...Control)

SetControls for bind response

func (BindResponse) SetDiagnosticMessage

func (l BindResponse) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (BindResponse) SetMatchedDN

func (l BindResponse) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (BindResponse) SetResultCode

func (l BindResponse) SetResultCode(code int)

SetResultCode the result code for a response.

type Change

type Change struct {
	// Operation is the type of change to be made
	Operation int64
	// Modification is the attribute to be modified
	Modification PartialAttribute
}

Change for a ModifyMessage as defined in https://tools.ietf.org/html/rfc4511

type Control

type Control interface {
	// GetControlType returns the OID
	GetControlType() string
	// Encode returns the ber packet representation
	Encode() *ber.Packet
	// String returns a human-readable description
	String() string
}

Control defines a common interface for all ldap controls

type ControlBeheraPasswordPolicy

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

ControlBeheraPasswordPolicy implements the control described in https://tools.ietf.org/html/draft-behera-ldap-password-policy-10

func NewControlBeheraPasswordPolicy

func NewControlBeheraPasswordPolicy(opt ...Option) (*ControlBeheraPasswordPolicy, error)

NewControlBeheraPasswordPolicy returns a ControlBeheraPasswordPolicy. Options supported: WithExpire, WithGrace, WithErrorCode

func (*ControlBeheraPasswordPolicy) Encode

func (c *ControlBeheraPasswordPolicy) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlBeheraPasswordPolicy) ErrorCode

func (c *ControlBeheraPasswordPolicy) ErrorCode() (int, string)

ErrorCode is the error code and a human readable string. A value of -1 and empty string indicates it hasn't been set.

func (*ControlBeheraPasswordPolicy) Expire

func (c *ControlBeheraPasswordPolicy) Expire() int

Expire contains the number of seconds before a password will expire. A value of -1 indicates it hasn't been set.

func (*ControlBeheraPasswordPolicy) GetControlType

func (c *ControlBeheraPasswordPolicy) GetControlType() string

GetControlType returns the OID

func (*ControlBeheraPasswordPolicy) Grace

func (c *ControlBeheraPasswordPolicy) Grace() int

Grace returns the remaining number of times a user will be allowed to authenticate with an expired password. A value of -1 indicates it hasn't been set.

func (*ControlBeheraPasswordPolicy) String

func (c *ControlBeheraPasswordPolicy) String() string

String returns a human-readable description

type ControlManageDsaIT

type ControlManageDsaIT struct {
	// Criticality indicates if this control is required
	Criticality bool
}

ControlManageDsaIT implements the control described in https://tools.ietf.org/html/rfc3296

func NewControlManageDsaIT

func NewControlManageDsaIT(opt ...Option) (*ControlManageDsaIT, error)

NewControlManageDsaIT returns a ControlManageDsaIT control. Supported options: WithCriticality

func (*ControlManageDsaIT) Encode

func (c *ControlManageDsaIT) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlManageDsaIT) GetControlType

func (c *ControlManageDsaIT) GetControlType() string

GetControlType returns the OID

func (*ControlManageDsaIT) String

func (c *ControlManageDsaIT) String() string

String returns a human-readable description

type ControlMicrosoftNotification

type ControlMicrosoftNotification struct{}

ControlMicrosoftNotification implements the control described in https://msdn.microsoft.com/en-us/library/aa366983(v=vs.85).aspx

func NewControlMicrosoftNotification

func NewControlMicrosoftNotification(_ ...Option) (*ControlMicrosoftNotification, error)

NewControlMicrosoftNotification returns a ControlMicrosoftNotification control. No options are currently supported.

func (*ControlMicrosoftNotification) Encode

Encode returns the ber packet representation

func (*ControlMicrosoftNotification) GetControlType

func (c *ControlMicrosoftNotification) GetControlType() string

GetControlType returns the OID

func (*ControlMicrosoftNotification) String

String returns a human-readable description

type ControlMicrosoftServerLinkTTL

type ControlMicrosoftServerLinkTTL struct{}

ControlMicrosoftServerLinkTTL implements the control described in https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/f4f523a8-abc0-4b3a-a471-6b2fef135481?redirectedfrom=MSDN

func NewControlMicrosoftServerLinkTTL

func NewControlMicrosoftServerLinkTTL(_ ...Option) (*ControlMicrosoftServerLinkTTL, error)

NewControlMicrosoftServerLinkTTL returns a ControlMicrosoftServerLinkTTL control. No options are currently supported.

func (*ControlMicrosoftServerLinkTTL) Encode

Encode returns the ber packet representation

func (*ControlMicrosoftServerLinkTTL) GetControlType

func (c *ControlMicrosoftServerLinkTTL) GetControlType() string

GetControlType returns the OID

func (*ControlMicrosoftServerLinkTTL) String

String returns a human-readable description

type ControlMicrosoftShowDeleted

type ControlMicrosoftShowDeleted struct{}

ControlMicrosoftShowDeleted implements the control described in https://msdn.microsoft.com/en-us/library/aa366989(v=vs.85).aspx

func NewControlMicrosoftShowDeleted

func NewControlMicrosoftShowDeleted(_ ...Option) (*ControlMicrosoftShowDeleted, error)

NewControlMicrosoftShowDeleted returns a ControlMicrosoftShowDeleted control. No options are currently supported.

func (*ControlMicrosoftShowDeleted) Encode

func (c *ControlMicrosoftShowDeleted) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlMicrosoftShowDeleted) GetControlType

func (c *ControlMicrosoftShowDeleted) GetControlType() string

GetControlType returns the OID

func (*ControlMicrosoftShowDeleted) String

func (c *ControlMicrosoftShowDeleted) String() string

String returns a human-readable description

type ControlPaging

type ControlPaging struct {
	// PagingSize indicates the page size
	PagingSize uint32
	// Cookie is an opaque value returned by the server to track a paging cursor
	Cookie []byte
}

ControlPaging implements the paging control described in https://www.ietf.org/rfc/rfc2696.txt

func NewControlPaging

func NewControlPaging(pagingSize uint32, _ ...Option) (*ControlPaging, error)

NewControlPaging returns a paging control

func (*ControlPaging) Encode

func (c *ControlPaging) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlPaging) GetControlType

func (c *ControlPaging) GetControlType() string

GetControlType returns the OID

func (*ControlPaging) SetCookie

func (c *ControlPaging) SetCookie(cookie []byte)

SetCookie stores the given cookie in the paging control

func (*ControlPaging) String

func (c *ControlPaging) String() string

String returns a human-readable description

type ControlString

type ControlString struct {
	ControlType  string
	Criticality  bool
	ControlValue string
}

ControlString implements the Control interface for simple controls

func NewControlString

func NewControlString(controlType string, opt ...Option) (*ControlString, error)

NewControlString returns a generic control. Options supported: WithCriticality and WithControlValue

func (*ControlString) Encode

func (c *ControlString) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlString) GetControlType

func (c *ControlString) GetControlType() string

GetControlType returns the OID

func (*ControlString) String

func (c *ControlString) String() string

String returns a human-readable description

type ControlVChuPasswordMustChange

type ControlVChuPasswordMustChange struct {
	// MustChange indicates if the password is required to be changed
	MustChange bool
}

ControlVChuPasswordMustChange implements the control described in https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00

func (*ControlVChuPasswordMustChange) Encode

Encode returns the ber packet representation

func (*ControlVChuPasswordMustChange) GetControlType

func (c *ControlVChuPasswordMustChange) GetControlType() string

GetControlType returns the OID

func (*ControlVChuPasswordMustChange) String

String returns a human-readable description

type ControlVChuPasswordWarning

type ControlVChuPasswordWarning struct {
	// Expire indicates the time in seconds until the password expires
	Expire int64
}

ControlVChuPasswordWarning implements the control described in https://tools.ietf.org/html/draft-vchu-ldap-pwd-policy-00

func (*ControlVChuPasswordWarning) Encode

func (c *ControlVChuPasswordWarning) Encode() *ber.Packet

Encode returns the ber packet representation

func (*ControlVChuPasswordWarning) GetControlType

func (c *ControlVChuPasswordWarning) GetControlType() string

GetControlType returns the OID

func (*ControlVChuPasswordWarning) String

func (c *ControlVChuPasswordWarning) String() string

String returns a human-readable description

type DeleteMessage

type DeleteMessage struct {

	// DN identifies the entry being added
	DN string

	// Controls hold optional controls to send with the request
	Controls []Control
	// contains filtered or unexported fields
}

DeleteMessage is an delete request message

func (DeleteMessage) GetID

func (m DeleteMessage) GetID() int64

GetID() returns the message ID

type Entry

type Entry struct {
	// DN is the distinguished name of the entry
	DN string
	// Attributes are the returned attributes for the entry
	Attributes []*EntryAttribute
}

Entry represents an ldap entry

func NewEntry

func NewEntry(dn string, attributes map[string][]string) *Entry

NewEntry returns an Entry object with the specified distinguished name and attribute key-value pairs. The map of attributes is accessed in alphabetical order of the keys in order to ensure that, for the same input map of attributes, the output entry will contain the same order of attributes

func (*Entry) GetAttributeValues

func (e *Entry) GetAttributeValues(attribute string) []string

GetAttributeValues returns the values for the named attribute, or an empty list

func (*Entry) PrettyPrint

func (e *Entry) PrettyPrint(indent int, opt ...Option)

PrettyPrint outputs a human-readable description indenting. Supported options: WithWriter

type EntryAttribute

type EntryAttribute struct {
	// Name is the name of the attribute
	Name string
	// Values contain the string values of the attribute
	Values []string
	// ByteValues contain the raw values of the attribute
	ByteValues [][]byte
}

EntryAttribute holds a single attribute

func NewEntryAttribute

func NewEntryAttribute(name string, values []string) *EntryAttribute

NewEntryAttribute returns a new EntryAttribute with the desired key-value pair

func (*EntryAttribute) AddValue

func (e *EntryAttribute) AddValue(value ...string)

AddValue to an existing EntryAttribute

func (*EntryAttribute) PrettyPrint

func (e *EntryAttribute) PrettyPrint(indent int, opt ...Option)

PrettyPrint outputs a human-readable description with indenting. Supported options: WithWriter

type ExtendedOperationMessage

type ExtendedOperationMessage struct {

	// Name of the extended operation
	Name ExtendedOperationName
	// Value of the extended operation
	Value string
	// contains filtered or unexported fields
}

ExtendedOperationMessage is an extended operation request message

func (ExtendedOperationMessage) GetID

func (m ExtendedOperationMessage) GetID() int64

GetID() returns the message ID

type ExtendedOperationName

type ExtendedOperationName string

ExtendedOperationName is an extended operation request/response name

const (
	ExtendedOperationDisconnection   ExtendedOperationName = "1.3.6.1.4.1.1466.2003"
	ExtendedOperationCancel          ExtendedOperationName = "1.3.6.1.1.8"
	ExtendedOperationStartTLS        ExtendedOperationName = "1.3.6.1.4.1.1466.20037"
	ExtendedOperationWhoAmI          ExtendedOperationName = "1.3.6.1.4.1.4203.1.11.3"
	ExtendedOperationGetConnectionID ExtendedOperationName = "1.3.6.1.4.1.26027.1.6.2"
	ExtendedOperationPasswordModify  ExtendedOperationName = "1.3.6.1.4.1.4203.1.11.1"
	ExtendedOperationUnknown         ExtendedOperationName = "Unknown"
)

Extended operation response/request names

type ExtendedResponse

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

ExtendedResponse represents a response to an extended operation request

func (ExtendedResponse) SetDiagnosticMessage

func (l ExtendedResponse) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (ExtendedResponse) SetMatchedDN

func (l ExtendedResponse) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (*ExtendedResponse) SetResponseName

func (r *ExtendedResponse) SetResponseName(n ExtendedOperationName)

SetResponseName will set the response name for the extended operation response.

func (ExtendedResponse) SetResultCode

func (l ExtendedResponse) SetResultCode(code int)

SetResultCode the result code for a response.

type GeneralResponse

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

GeneralResponse represents a general response (non-specific to a request).

func (GeneralResponse) SetDiagnosticMessage

func (l GeneralResponse) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (GeneralResponse) SetMatchedDN

func (l GeneralResponse) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (GeneralResponse) SetResultCode

func (l GeneralResponse) SetResultCode(code int)

SetResultCode the result code for a response.

type HandlerFunc

type HandlerFunc func(*ResponseWriter, *Request)

HandlerFunc defines a function for handling an LDAP request.

type Message

type Message interface {
	// GetID returns the message ID
	GetID() int64
}

Message defines a common interface for all messages

type ModifyMessage

type ModifyMessage struct {
	DN       string
	Changes  []Change
	Controls []Control
	// contains filtered or unexported fields
}

ModifyMessage as defined in https://tools.ietf.org/html/rfc4511

func (ModifyMessage) GetID

func (m ModifyMessage) GetID() int64

GetID() returns the message ID

type ModifyResponse

type ModifyResponse struct {
	*GeneralResponse
}

ModifyResponse is a response to a modify request.

func (ModifyResponse) SetDiagnosticMessage

func (l ModifyResponse) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (ModifyResponse) SetMatchedDN

func (l ModifyResponse) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (ModifyResponse) SetResultCode

func (l ModifyResponse) SetResultCode(code int)

SetResultCode the result code for a response.

type Mux

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

Mux is an ldap request multiplexer. It matches the inbound request against a list of registered route handlers. Routes are matched in the order they're added and only one route is called per request.

func NewMux

func NewMux(opt ...Option) (*Mux, error)

NewMux creates a new multiplexer.

func (*Mux) Add

func (m *Mux) Add(addFn HandlerFunc, opt ...Option) error

Add will register a handler for add operation requests. Options supported: WithLabel

func (*Mux) Bind

func (m *Mux) Bind(bindFn HandlerFunc, opt ...Option) error

Bind will register a handler for bind requests. Options supported: WithLabel

func (*Mux) DefaultRoute

func (m *Mux) DefaultRoute(noRouteFN HandlerFunc, opt ...Option) error

DefaultRoute will register a default handler requests which have no other registered handler.

func (*Mux) Delete

func (m *Mux) Delete(modifyFn HandlerFunc, opt ...Option) error

Delete will register a handler for delete operation requests. Options supported: WithLabel

func (*Mux) ExtendedOperation

func (m *Mux) ExtendedOperation(operationFn HandlerFunc, exName ExtendedOperationName, opt ...Option) error

ExtendedOperation will register a handler for extended operation requests. Options supported: WithLabel

func (*Mux) Modify

func (m *Mux) Modify(modifyFn HandlerFunc, opt ...Option) error

Modify will register a handler for modify operation requests. Options supported: WithLabel

func (*Mux) Search

func (m *Mux) Search(searchFn HandlerFunc, opt ...Option) error

Search will register a handler for search requests. Options supported: WithLabel, WithBaseDN, WithScope

func (*Mux) Unbind added in v0.1.1

func (m *Mux) Unbind(bindFn HandlerFunc, opt ...Option) error

Unbind will register a handler for unbind requests and override the default unbind handler. Registering an unbind handler is optional and regardless of whether or not an unbind route is defined the server will stop serving requests for a connection after an unbind request is received. Options supported: WithLabel

type OnCloseHandler added in v0.1.2

type OnCloseHandler func(connectionID int)

OnCloseHandler defines a function for a "on close" callback handler. See: NewServer(...) and WithOnClose(...) option for more information

type Option

type Option func(interface{})

Option defines a common functional options type which can be used in a variadic parameter pattern.

func WithApplicationCode

func WithApplicationCode(applicationCode int) Option

WithApplicationCode specifies the ldap application code. For a list of valid codes for a list of supported application codes see: https://github.com/jimlambrt/gldap/blob/8f171b8eb659c76019719382c4daf519dd1281e6/codes.go#L159

func WithAttributes

func WithAttributes(attributes map[string][]string) Option

WithAttributes specifies optional attributes for a response entry

func WithBaseDN

func WithBaseDN(dn string) Option

WithBaseDN specifies an optional base DN to associate with a Search route

func WithControlValue

func WithControlValue(value string) Option

WithControlValue specifies the control value

func WithCriticality

func WithCriticality(criticality bool) Option

WithCriticality specifies the criticality

func WithDescription added in v0.1.3

func WithDescription(desc string) Option

WithDescription allows you to specify an optional description.

func WithDiagnosticMessage

func WithDiagnosticMessage(msg string) Option

WithDiagnosticMessage provides an optional diagnostic message for the response.

func WithDisablePanicRecovery

func WithDisablePanicRecovery() Option

WithDisablePanicRecovery will disable recovery from panics which occur when handling a request. This is helpful for debugging since you'll get the panic's callstack.

func WithErrorCode

func WithErrorCode(code uint) Option

WithErrorCode specifies the error code

func WithFilter

func WithFilter(filter string) Option

WithFilter specifies an optional filter to associate with a Search route

func WithGraceAuthNsRemaining

func WithGraceAuthNsRemaining(remaining uint) Option

WithGraceAuthNsRemaining specifies the number of grace authentication remaining.

func WithLabel

func WithLabel(l string) Option

WithLabel specifies an optional label for the route

func WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger provides the optional logger.

func WithMatchedDN

func WithMatchedDN(dn string) Option

WithMatchedDN provides an optional match DN for the response.

func WithOnClose added in v0.1.2

func WithOnClose(handler OnCloseHandler) Option

WithOnClose defines a OnCloseHandler that the server will use as a callback every time a connection to the server is closed. This allows callers to clean up resources for closed connections (using their ID to determine which one to clean up)

func WithReadTimeout

func WithReadTimeout(d time.Duration) Option

WithReadTimeout will set a read time out per connection

func WithResponseCode

func WithResponseCode(code int) Option

WithResponseCode specifies the ldap response code. For a list of valid codes see: https://github.com/go-ldap/ldap/blob/13008e4c5260d08625b65eb1f172ae909152b751/v3/error.go#L11

func WithScope

func WithScope(s Scope) Option

WithScope specifies and optional scope to associate with a Search route

func WithSecondsBeforeExpiration

func WithSecondsBeforeExpiration(seconds uint) Option

WithSecondsBeforeExpiration specifies the number of seconds before a password will expire

func WithTLSConfig

func WithTLSConfig(tc *tls.Config) Option

WithTLSConfig provides an optional tls.Config

func WithWriteTimeout

func WithWriteTimeout(d time.Duration) Option

WithWriteTimeout will set a write timeout per connection

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter allows you to specify an optional writer.

type PartialAttribute

type PartialAttribute struct {
	// Type is the type of the partial attribute
	Type string
	// Vals are the values of the partial attribute
	Vals []string
}

PartialAttribute for a ModifyMessage as defined in https://tools.ietf.org/html/rfc4511

type Password

type Password string

Password is a simple bind request password

type Request

type Request struct {
	// ID is the request number for a specific connection.  Every connection has
	// its own request counter which starts at 1.
	ID int
	// contains filtered or unexported fields
}

Request represents an ldap request

func (*Request) ConnectionID added in v0.1.2

func (r *Request) ConnectionID() int

ConnectionID returns the request's connection ID which enables you to know "who" (i.e. which connection) made a request. Using the connection ID you can do things like ensure a connection performing a search operation has successfully authenticated (a.k.a. performed a successful bind operation).

func (*Request) GetAddMessage

func (r *Request) GetAddMessage() (*AddMessage, error)

GetAddMessage retrieves the AddMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) GetDeleteMessage

func (r *Request) GetDeleteMessage() (*DeleteMessage, error)

GetDeleteMessage retrieves the DeleteMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) GetModifyMessage

func (r *Request) GetModifyMessage() (*ModifyMessage, error)

GetModifyMessage retrieves the ModifyMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) GetSearchMessage

func (r *Request) GetSearchMessage() (*SearchMessage, error)

GetSearchMessage retrieves the SearchMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) GetSimpleBindMessage

func (r *Request) GetSimpleBindMessage() (*SimpleBindMessage, error)

GetSimpleBindMessage retrieves the SimpleBindMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) GetUnbindMessage added in v0.1.1

func (r *Request) GetUnbindMessage() (*UnbindMessage, error)

GetUnbindMessage retrieves the UnbindMessage from the request, which allows you handle the request based on the message attributes.

func (*Request) NewBindResponse

func (r *Request) NewBindResponse(opt ...Option) *BindResponse

NewBindResponse creates a new bind response. Supported options: WithResponseCode

func (*Request) NewExtendedResponse

func (r *Request) NewExtendedResponse(opt ...Option) *ExtendedResponse

NewExtendedResponse creates a new extended response. Supported options: WithResponseCode

func (*Request) NewModifyResponse

func (r *Request) NewModifyResponse(opt ...Option) *ModifyResponse

NewModifyResponse creates a modify response Supported options: WithResponseCode, WithDiagnosticMessage, WithMatchedDN

func (*Request) NewResponse

func (r *Request) NewResponse(opt ...Option) *GeneralResponse

NewResponse creates a general response (not necessarily to any specific request because you can set WithApplicationCode). Supported options: WithResponseCode, WithApplicationCode, WithDiagnosticMessage, WithMatchedDN

func (*Request) NewSearchDoneResponse

func (r *Request) NewSearchDoneResponse(opt ...Option) *SearchResponseDone

NewSearchDoneResponse creates a new search done response. If there are no results found, then set the response code by adding the option WithResponseCode(ResultNoSuchObject)

Supported options: WithResponseCode

func (*Request) NewSearchResponseEntry

func (r *Request) NewSearchResponseEntry(entryDN string, opt ...Option) *SearchResponseEntry

NewSearchResponseEntry is a search response entry. Supported options: WithAttributes

func (*Request) StartTLS

func (r *Request) StartTLS(tlsconfig *tls.Config) error

StartTLS will start a TLS connection using the Message's existing connection

type Response

type Response interface {
	// contains filtered or unexported methods
}

Response represents a response to an ldap request

type ResponseWriter

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

ResponseWriter is an ldap request response writer which is used by a HanderFunc to write responses to client requests.

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(r Response) error

Write will write the response to the client

type Scope

type Scope int64

Scope represents the scope of a search (see: https://ldap.com/the-ldap-search-operation/)

const (
	// BaseObject (often referred to as “base”): Indicates that only the entry
	// specified as the search base should be considered. None of its
	// subordinates will be considered.
	BaseObject Scope = 0

	// SingleLevel (often referred to as “one”): Indicates that only the
	// immediate children of the entry specified as the search base should be
	// considered. The base entry itself should not be considered, nor any
	// descendants of the immediate children of the base entry.
	SingleLevel Scope = 1

	// WholeSubtree (often referred to as “sub”): Indicates that the entry
	// specified as the search base, and all of its subordinates to any depth,
	// should be considered. Note that in the special case that the search base
	// DN is the null DN, the root DSE should not be considered in a
	// wholeSubtree search.
	WholeSubtree Scope = 2
)

type SearchMessage

type SearchMessage struct {

	// BaseDN for the request
	BaseDN string
	// Scope of the request
	Scope Scope
	// DerefAliases for the request
	DerefAliases int
	// TimeLimit is the max time in seconds to spend processing
	TimeLimit int64
	// SizeLimit is the max number of results to return
	SizeLimit int64
	// TypesOnly is true if the client only expects type info
	TypesOnly bool
	// Filter for the request
	Filter string
	// Attributes requested
	Attributes []string
	// Controls requested
	Controls []Control
	// contains filtered or unexported fields
}

SearchMessage is a search request message

func (SearchMessage) GetID

func (m SearchMessage) GetID() int64

GetID() returns the message ID

type SearchResponseDone

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

SearchResponseDone represents that handling a search requests is done.

func (*SearchResponseDone) SetControls

func (r *SearchResponseDone) SetControls(controls ...Control)

SetControls for the search response

func (SearchResponseDone) SetDiagnosticMessage

func (l SearchResponseDone) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (SearchResponseDone) SetMatchedDN

func (l SearchResponseDone) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (SearchResponseDone) SetResultCode

func (l SearchResponseDone) SetResultCode(code int)

SetResultCode the result code for a response.

type SearchResponseEntry

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

SearchResponseEntry is an ldap entry that's part of search response.

func (*SearchResponseEntry) AddAttribute

func (r *SearchResponseEntry) AddAttribute(name string, values []string)

AddAttribute will an attributes to the response entry

func (SearchResponseEntry) SetDiagnosticMessage

func (l SearchResponseEntry) SetDiagnosticMessage(msg string)

SetDiagnosticMessage sets the optional diagnostic message for a response.

func (SearchResponseEntry) SetMatchedDN

func (l SearchResponseEntry) SetMatchedDN(dn string)

SetMatchedDN sets the optional matched DN for a response.

func (SearchResponseEntry) SetResultCode

func (l SearchResponseEntry) SetResultCode(code int)

SetResultCode the result code for a response.

type Server

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

Server is an ldap server that you can add a mux (multiplexer) router to and then run it to accept and process requests.

func NewServer

func NewServer(opt ...Option) (*Server, error)

NewServer creates a new ldap server

Options supported: - WithLogger allows you pass a logger with whatever hclog.Level you wish including hclog.Off to turn off all logging - WithReadTimeout will set a read time out per connection - WithWriteTimeout will set a write time out per connection - WithOnClose will define a callback the server will call every time a connection is closed

func (*Server) Ready

func (s *Server) Ready() bool

Ready will return true when the server is ready to accept connection

func (*Server) Router

func (s *Server) Router(r *Mux) error

Router sets the mux (multiplexer) router for matching inbound requests to handlers.

func (*Server) Run

func (s *Server) Run(addr string, opt ...Option) error

Run will run the server which will listen and serve requests.

Options supported: WithTLSConfig

func (*Server) Stop

func (s *Server) Stop() error

Stop a running ldap server

type SimpleBindMessage

type SimpleBindMessage struct {

	// AuthChoice for the request (SimpleAuthChoice)
	AuthChoice AuthChoice
	// UserName for the bind request
	UserName string
	// Password for the bind request
	Password Password
	// Controls are optional controls for the bind request
	Controls []Control
	// contains filtered or unexported fields
}

SimpleBindMessage is a simple bind request message

func (SimpleBindMessage) GetID

func (m SimpleBindMessage) GetID() int64

GetID() returns the message ID

type UnbindMessage added in v0.1.1

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

UnbindMessage is an unbind request message

func (UnbindMessage) GetID added in v0.1.1

func (m UnbindMessage) GetID() int64

GetID() returns the message ID

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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