Skip to content

Commit

Permalink
feat: Add support for children scope choice const (#480)
Browse files Browse the repository at this point in the history
* feat: Add support for children scope choice const

* Add comment to `ScopeChildren` that this scope may not be available on directory server other than OpenLDAP

* Mirror changes to v3

---------

Co-authored-by: sirzzang <sirzzan@naver.com>
Co-authored-by: Christopher Puschmann <cp@lumen.sh>
  • Loading branch information
3 people authored Jan 13, 2024
1 parent a0fbbb2 commit 9023788
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ const (
ScopeBaseObject = 0
ScopeSingleLevel = 1
ScopeWholeSubtree = 2
// ScopeChildren is an OpenLDAP extension that may not be supported by another directory server.
// See: https://github.com/openldap/openldap/blob/7c55484ee153047efd0e562fc1638c1a2525f320/include/ldap.h#L598
ScopeChildren = 3
)

// ScopeMap contains human readable descriptions of scope choices
var ScopeMap = map[int]string{
ScopeBaseObject: "Base Object",
ScopeSingleLevel: "Single Level",
ScopeWholeSubtree: "Whole Subtree",
ScopeChildren: "Children",
}

// derefAliases
Expand Down
4 changes: 4 additions & 0 deletions v3/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ const (
ScopeBaseObject = 0
ScopeSingleLevel = 1
ScopeWholeSubtree = 2
// ScopeChildren is an OpenLDAP extension that may not be supported by another directory server.
// See: https://github.com/openldap/openldap/blob/7c55484ee153047efd0e562fc1638c1a2525f320/include/ldap.h#L598
ScopeChildren = 3
)

// ScopeMap contains human readable descriptions of scope choices
var ScopeMap = map[int]string{
ScopeBaseObject: "Base Object",
ScopeSingleLevel: "Single Level",
ScopeWholeSubtree: "Whole Subtree",
ScopeChildren: "Children",
}

// derefAliases
Expand Down

0 comments on commit 9023788

Please sign in to comment.