File: rpc_extra.go

package info (click to toggle)
gitlab-agent 16.11.5-1
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 7,072 kB
  • sloc: makefile: 193; sh: 55; ruby: 3
file content (17 lines) | stat: -rwxr-xr-x 395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package rpc

func (x *ImpersonationConfig) GetExtraAsMap() map[string][]string {
	extra := x.GetExtra() // nil-safe
	res := make(map[string][]string, len(extra))
	for _, kv := range extra {
		res[kv.Key] = kv.Val
	}
	return res
}

func (x *ImpersonationConfig) IsEmpty() bool {
	if x == nil {
		return true
	}
	return x.Username == "" && len(x.Groups) == 0 && x.Uid == "" && len(x.Extra) == 0
}