Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
22 lines
553 B
Go
22 lines
553 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package auth
|
|
|
|
import (
|
|
"forgejo.org/modules/json"
|
|
"forgejo.org/modules/log"
|
|
)
|
|
|
|
func UnmarshalGroupTeamMapping(raw string) (map[string]map[string][]string, error) {
|
|
groupTeamMapping := make(map[string]map[string][]string)
|
|
if raw == "" {
|
|
return groupTeamMapping, nil
|
|
}
|
|
err := json.Unmarshal([]byte(raw), &groupTeamMapping)
|
|
if err != nil {
|
|
log.Error("Failed to unmarshal group team mapping: %v", err)
|
|
return nil, err
|
|
}
|
|
return groupTeamMapping, nil
|
|
}
|