Path: blob/main/components/common-go/experiments/flags.go
2498 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package experiments56import (7"context"8"strings"9)1011const (12OIDCServiceEnabledFlag = "oidcServiceEnabled"13IdPClaimKeysFlag = "idp_claim_keys"14)1516func GetIdPClaimKeys(ctx context.Context, client Client, attributes Attributes) []string {17value := client.GetStringValue(ctx, IdPClaimKeysFlag, "undefined", attributes)18if value == "" || value == "undefined" {19return []string{}20}21return strings.Split(value, ",")22}2324func IsOIDCServiceEnabled(ctx context.Context, client Client, attributes Attributes) bool {25return client.GetBoolValue(ctx, OIDCServiceEnabledFlag, false, attributes)26}272829