Huiwen db5af8934d
Get java feature flags from server (#19984)
* Get java feature flags from server

* fix build
2024-07-01 19:01:14 +02:00

28 lines
789 B
Go

// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.
package experiments
import (
"context"
"strings"
)
const (
OIDCServiceEnabledFlag = "oidcServiceEnabled"
IdPClaimKeysFlag = "idp_claim_keys"
)
func GetIdPClaimKeys(ctx context.Context, client Client, attributes Attributes) []string {
value := client.GetStringValue(ctx, IdPClaimKeysFlag, "undefined", attributes)
if value == "" || value == "undefined" {
return []string{}
}
return strings.Split(value, ",")
}
func IsOIDCServiceEnabled(ctx context.Context, client Client, attributes Attributes) bool {
return client.GetBoolValue(ctx, OIDCServiceEnabledFlag, false, attributes)
}