Skip to content

Commit ed251bf

Browse files
committed
improve consistency
1 parent c9bba3d commit ed251bf

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

cmd/admin_auth_ldap.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ var (
133133
Usage: "Enable LDAP groups",
134134
},
135135
&cli.StringFlag{
136-
Name: "group-search-base",
137-
Usage: "The LDAP base at which group accounts will be searched for.",
136+
Name: "group-search-base-dn",
137+
Usage: "The LDAP base DN at which group accounts will be searched for",
138138
},
139139
&cli.StringFlag{
140-
Name: "group-member-uid",
140+
Name: "group-member-attribute",
141141
Usage: "Group attribute containing list of users",
142142
},
143143
&cli.StringFlag{
@@ -153,7 +153,7 @@ var (
153153
Usage: "Map LDAP groups to Organization teams",
154154
},
155155
&cli.BoolFlag{
156-
Name: "group-users-remove",
156+
Name: "group-team-map-removal",
157157
Usage: "Remove users from synchronized teams if user does not belong to corresponding LDAP group",
158158
})
159159

@@ -304,8 +304,8 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
304304
if c.IsSet("enable-groups") {
305305
config.GroupsEnabled = c.Bool("enable-groups")
306306
}
307-
if c.IsSet("group-search-base") {
308-
config.GroupDN = c.String("group-search-base")
307+
if c.IsSet("group-search-base-dn") {
308+
config.GroupDN = c.String("group-search-base-dn")
309309
}
310310
if c.IsSet("group-member-uid") {
311311
config.GroupMemberUID = c.String("group-member-uid")
@@ -319,8 +319,8 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
319319
if c.IsSet("group-team-map") {
320320
config.GroupTeamMap = c.String("group-team-map")
321321
}
322-
if c.IsSet("group-users-remove") {
323-
config.GroupTeamMapRemoval = c.Bool("group-users-remove")
322+
if c.IsSet("group-team-map-removal") {
323+
config.GroupTeamMapRemoval = c.Bool("group-team-map-removal")
324324
}
325325
return nil
326326
}

cmd/admin_auth_ldap_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ func TestAddLdapBindDn(t *testing.T) {
5252
"--synchronize-users",
5353
"--page-size", "99",
5454
"--enable-groups",
55-
"--group-search-base", "ou=group,dc=full-domain-bind,dc=org",
56-
"--group-member-uid", "memberUid",
55+
"--group-search-base-dn", "ou=group,dc=full-domain-bind,dc=org",
56+
"--group-member-attribute", "memberUid",
5757
"--group-user-attribute", "uid",
5858
"--group-filter", "(|(cn=gitea_users)(cn=admins))",
5959
"--group-team-map", `{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}`,
60-
"--group-users-remove",
60+
"--group-team-map-removal",
6161
},
6262
source: &auth.Source{
6363
Type: auth.LDAP,
@@ -525,12 +525,12 @@ func TestUpdateLdapBindDn(t *testing.T) {
525525
"--synchronize-users",
526526
"--page-size", "99",
527527
"--enable-groups",
528-
"--group-search-base", "ou=group,dc=full-domain-bind,dc=org",
529-
"--group-member-uid", "memberUid",
528+
"--group-search-base-dn", "ou=group,dc=full-domain-bind,dc=org",
529+
"--group-member-attribute", "memberUid",
530530
"--group-user-attribute", "uid",
531531
"--group-filter", "(|(cn=gitea_users)(cn=admins))",
532532
"--group-team-map", `{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}`,
533-
"--group-users-remove",
533+
"--group-team-map-removal",
534534
},
535535
id: 23,
536536
existingAuthSource: &auth.Source{

0 commit comments

Comments
 (0)