Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
6a728f10
Commit
6a728f10
authored
Dec 27, 2016
by
rithu john
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connector/ldap: enable groupSearch to be empty
parent
3e2d8579
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
ldap.go
connector/ldap/ldap.go
+5
-0
No files found.
connector/ldap/ldap.go
View file @
6a728f10
...
@@ -445,6 +445,11 @@ func (c *ldapConnector) Refresh(ctx context.Context, s connector.Scopes, ident c
...
@@ -445,6 +445,11 @@ func (c *ldapConnector) Refresh(ctx context.Context, s connector.Scopes, ident c
}
}
func
(
c
*
ldapConnector
)
groups
(
ctx
context
.
Context
,
user
ldap
.
Entry
)
([]
string
,
error
)
{
func
(
c
*
ldapConnector
)
groups
(
ctx
context
.
Context
,
user
ldap
.
Entry
)
([]
string
,
error
)
{
if
c
.
GroupSearch
.
BaseDN
==
""
{
c
.
logger
.
Debugf
(
"No groups returned for %q because no groups baseDN has been configured."
,
getAttr
(
user
,
c
.
UserSearch
.
NameAttr
))
return
nil
,
nil
}
filter
:=
fmt
.
Sprintf
(
"(%s=%s)"
,
c
.
GroupSearch
.
GroupAttr
,
ldap
.
EscapeFilter
(
getAttr
(
user
,
c
.
GroupSearch
.
UserAttr
)))
filter
:=
fmt
.
Sprintf
(
"(%s=%s)"
,
c
.
GroupSearch
.
GroupAttr
,
ldap
.
EscapeFilter
(
getAttr
(
user
,
c
.
GroupSearch
.
UserAttr
)))
if
c
.
GroupSearch
.
Filter
!=
""
{
if
c
.
GroupSearch
.
Filter
!=
""
{
filter
=
fmt
.
Sprintf
(
"(&%s%s)"
,
c
.
GroupSearch
.
Filter
,
filter
)
filter
=
fmt
.
Sprintf
(
"(&%s%s)"
,
c
.
GroupSearch
.
Filter
,
filter
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment