You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/auth/source
Giteabot 37d3e0ec33
Fix accidental overwriting of LDAP team memberships (#24050) (#24065)
Backport #24050 by @sillyguodong

In the `for` loop, the value of `membershipsToAdd[org]` and
`membershipsToRemove[org]` is a slice that should be appended instead of
overwritten.
Due to the current overwrite, the LDAP group sync only matches the last
group at the moment.

## Example reproduction
- an LDAP user is both a member of
`cn=admin_staff,ou=people,dc=planetexpress,dc=com` and
`cn=ship_crew,ou=people,dc=planetexpress,dc=com`.
- configuration of `Map LDAP groups to Organization teams ` in
`Authentication Sources`:
```json
{
    "cn=admin_staff,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "admin_staff",
            "test_add"
        ]
    },
    "cn=ship_crew,ou=people,dc=planetexpress,dc=com":{
        "test_organization":[
            "ship_crew"
        ]
}
```
- start `Synchronize external user data` task in the `Dashboard`.
- the user was only added for the team `test_organization.ship_crew`

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2 years ago
..
db Implement FSFE REUSE for golang files (#21840) 2 years ago
ldap Don't apply the group filter when listing LDAP group membership if it is empty (#23745) (#23788) 2 years ago
oauth2 Handle OpenID discovery URL errors a little nicer when creating/editing sources (#23397) (#23403) 2 years ago
pam Implement FSFE REUSE for golang files (#21840) 2 years ago
smtp Improve utils of slices (#22379) 2 years ago
sspi Implement FSFE REUSE for golang files (#21840) 2 years ago
source_group_sync.go Fix accidental overwriting of LDAP team memberships (#24050) (#24065) 2 years ago