Merge pull request #5896 from erks/normalize_ldap_group_dn

Normalize (make lowercase) ldap_group_dn during onboarding
This commit is contained in:
James Zabala 2018-10-02 16:03:03 -04:00 committed by GitHub
commit e09a157dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ src/portal/typings/
**/*npm-debug.log.*
**/*yarn-error.log.*
.idea/
*.iml
.DS_Store
.project
.vscode/

View File

@ -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.
// the keyAttribute and combinedKeyAttribute are key columns used to check duplicate usergroup in harbor
func OnBoardUserGroup(g *models.UserGroup, keyAttribute string, combinedKeyAttributes ...string) error {
g.LdapGroupDN = utils.TrimLower(g.LdapGroupDN)
o := dao.GetOrmer()
created, ID, err := o.ReadOrCreate(g, keyAttribute, combinedKeyAttributes...)
if err != nil {