Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/common-go/experiments/flags.go
2498 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package experiments
6
7
import (
8
"context"
9
"strings"
10
)
11
12
const (
13
OIDCServiceEnabledFlag = "oidcServiceEnabled"
14
IdPClaimKeysFlag = "idp_claim_keys"
15
)
16
17
func GetIdPClaimKeys(ctx context.Context, client Client, attributes Attributes) []string {
18
value := client.GetStringValue(ctx, IdPClaimKeysFlag, "undefined", attributes)
19
if value == "" || value == "undefined" {
20
return []string{}
21
}
22
return strings.Split(value, ",")
23
}
24
25
func IsOIDCServiceEnabled(ctx context.Context, client Client, attributes Attributes) bool {
26
return client.GetBoolValue(ctx, OIDCServiceEnabledFlag, false, attributes)
27
}
28
29