mirror of https://github.com/goharbor/harbor.git
Normalize (make lowercase) the ldap group dn when onboarding
Fixes #5895 Signed-off-by: Touch Ungboriboonpisal <tungbori@zynga.com>
This commit is contained in:
parent
262de58c55
commit
e256547411
|
@ -32,6 +32,7 @@ src/portal/typings/
|
||||||
**/*npm-debug.log.*
|
**/*npm-debug.log.*
|
||||||
**/*yarn-error.log.*
|
**/*yarn-error.log.*
|
||||||
.idea/
|
.idea/
|
||||||
|
*.iml
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.project
|
.project
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
|
@ -116,6 +116,8 @@ func UpdateUserGroupName(id int, groupName string) error {
|
||||||
// This is used for ldap and uaa authentication, such the usergroup can have an ID in Harbor.
|
// This is used for ldap and uaa authentication, such the usergroup can have an ID in Harbor.
|
||||||
// the keyAttribute and combinedKeyAttribute are key columns used to check duplicate usergroup in harbor
|
// the keyAttribute and combinedKeyAttribute are key columns used to check duplicate usergroup in harbor
|
||||||
func OnBoardUserGroup(g *models.UserGroup, keyAttribute string, combinedKeyAttributes ...string) error {
|
func OnBoardUserGroup(g *models.UserGroup, keyAttribute string, combinedKeyAttributes ...string) error {
|
||||||
|
g.LdapGroupDN = utils.TrimLower(g.LdapGroupDN)
|
||||||
|
|
||||||
o := dao.GetOrmer()
|
o := dao.GetOrmer()
|
||||||
created, ID, err := o.ReadOrCreate(g, keyAttribute, combinedKeyAttributes...)
|
created, ID, err := o.ReadOrCreate(g, keyAttribute, combinedKeyAttributes...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue