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
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
..
actions Refactor commit status for Actions jobs (#23786) (#24060) 2 years ago
agit Rename almost all Ctx functions (#22071) 2 years ago
asymkey Add context cache as a request level cache (#22294) 2 years ago
attachment Preserve file size when creating attachments (#23406) (#23426) 2 years ago
auth Fix accidental overwriting of LDAP team memberships (#24050) (#24065) 2 years ago
automerge Add force_merge to merge request and fix checking mergable (#23010) 2 years ago
context Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823) (#23905) 2 years ago
convert Fix SyncOnCommit always return false in API of push_mirrors (#23088) (#23100) 2 years ago
cron Add Cargo package registry (#21888) 2 years ago
externalaccount Implement FSFE REUSE for golang files (#21840) 2 years ago
forms Title can be empty when creating tag only (#23917) (#23961) 2 years ago
gitdiff Fix broken code editor diff preview (#23307) (#23320) 2 years ago
issue Webhooks: for issue close/reopen action, add commit ID that caused it (#22583) 2 years ago
lfs Check `IsActionsToken` for LFS authentication (#23841) (#23875) 2 years ago
mailer Preserve file size when creating attachments (#23406) (#23426) 2 years ago
markup Implement FSFE REUSE for golang files (#21840) 2 years ago
migrations Add loading yaml label template files (#22976) (#23232) 2 years ago
mirror Fill head commit to in payload when notifying push commits for mirroring (#23215) (#23292) 2 years ago
org Implement FSFE REUSE for golang files (#21840) 2 years ago
packages Use import of OCI structs (#22765) 2 years ago
pull [Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#23834) 2 years ago
release Delete deleted release attachments immediately from storage (#23913) (#23958) 2 years ago
repository fix submodule is nil panic (#23588) (#23601) 2 years ago
task Implement FSFE REUSE for golang files (#21840) 2 years ago
user Add context cache as a request level cache (#22294) 2 years ago
webhook Fix incorrect `HookEventType` of pull request review comments (#23650) (#23678) 2 years ago
wiki Improve utils of slices (#22379) 2 years ago