From 963227f51c2d34c4235a9cb75e5e6cbe07345927 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Wed, 25 May 2022 11:36:36 +0200 Subject: [PATCH] newer gitea doesn't always return owner as the first team We cannot presume that owner will be the first team listed so we need to run through all of the teams After a lot of debugging, the old presumption that the Owner team, will be the first team and therefor we can skip the first returned team is not valid. As a consequence if you have a LDAP group with the name Owner, you will need to be carefull. Signed-off-by: Toshaan Bharvani --- gitea-group-sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitea-group-sync.go b/gitea-group-sync.go index f8698db..d2a6f57 100644 --- a/gitea-group-sync.go +++ b/gitea-group-sync.go @@ -250,7 +250,7 @@ func mainJob() { log.Printf("Skip synchronization in the Owners team") cfg.ApiKeys.BruteforceTokenKey = 0 - for j := 1; j < len(teamList); j++ { + for j := 0; j < len(teamList); j++ { // preparing request to ldap server filter := fmt.Sprintf(cfg.LdapFilter, teamList[j].Name)