Skip to content

Commit 6a2d6d6

Browse files
committed
add flags for managing ldap groups
1 parent dcbf6c2 commit 6a2d6d6

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

cmd/admin_auth_ldap.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,30 @@ var (
127127
&cli.UintFlag{
128128
Name: "page-size",
129129
Usage: "Search page size.",
130+
},
131+
&cli.BoolFlag{
132+
Name: "enable-groups",
133+
Usage: "Enable LDAP groups",
134+
},
135+
&cli.StringFlag{
136+
Name: "group-search-base",
137+
Usage: "The LDAP base at which group accounts will be searched for.",
138+
},
139+
&cli.StringFlag{
140+
Name: "group-member-uid",
141+
Usage: "Group attribte containing list of users",
142+
},
143+
&cli.StringFlag{
144+
Name: "group-user-attribute",
145+
Usage: "User attribte listed in group",
146+
},
147+
&cli.StringFlag{
148+
Name: "group-filter",
149+
Usage: "Verify group membership in LDAP",
150+
},
151+
&cli.StringFlag{
152+
Name: "group-team-map",
153+
Usage: "Map LDAP groups to Organization teams",
130154
})
131155

132156
ldapSimpleAuthCLIFlags = append(commonLdapCLIFlags,
@@ -273,6 +297,24 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
273297
if c.IsSet("skip-local-2fa") {
274298
config.SkipLocalTwoFA = c.Bool("skip-local-2fa")
275299
}
300+
if c.IsSet("enable-groups") {
301+
config.GroupsEnabled = c.Bool("enable-groups")
302+
}
303+
if c.IsSet("group-search-base") {
304+
config.GroupDN = c.String("group-search-base")
305+
}
306+
if c.IsSet("group-member-uid") {
307+
config.GroupMemberUID = c.String("group-member-uid")
308+
}
309+
if c.IsSet("group-user-attribute") {
310+
config.UserUID = c.String("group-user-attribute")
311+
}
312+
if c.IsSet("group-filter") {
313+
config.GroupFilter = c.String("group-filter")
314+
}
315+
if c.IsSet("group-team-map") {
316+
config.GroupTeamMap = c.String("group-team-map")
317+
}
276318
return nil
277319
}
278320

0 commit comments

Comments
 (0)