mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-13 08:36:45 +02:00
43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
// Copyright IBM Corp. 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package experiments
|
|
|
|
import "slices"
|
|
|
|
const (
|
|
VaultExperimentCoreAuditEventsAlpha1 = "core.audit.events.alpha1"
|
|
VaultExperimentSecretsImport = "secrets.import.alpha1"
|
|
|
|
// VaultExperimentKmipClientApi enables the experimental KMIP client
|
|
// and template API endpoints. See VAULT-41117.
|
|
VaultExperimentKmipClientApi = "kmip.client_api.alpha1"
|
|
|
|
VaultExperimentEventsAlpha1 = "events.alpha1"
|
|
)
|
|
|
|
var validExperiments = []string{
|
|
VaultExperimentEventsAlpha1,
|
|
VaultExperimentCoreAuditEventsAlpha1,
|
|
VaultExperimentSecretsImport,
|
|
VaultExperimentKmipClientApi,
|
|
}
|
|
|
|
// Unused experiments. We keep them so that we don't break users who include them in their
|
|
// flags or configs, but they no longer have any effect.
|
|
var unusedExperiments = []string{
|
|
VaultExperimentEventsAlpha1,
|
|
}
|
|
|
|
// ValidExperiments exposes the list of valid experiments without exposing a mutable
|
|
// global variable. Experiments can only be enabled when starting a server, and will
|
|
// typically enable pre-GA API functionality.
|
|
func ValidExperiments() []string {
|
|
return slices.Clone(validExperiments)
|
|
}
|
|
|
|
// IsUnused returns true if the given experiment is in the unused list.
|
|
func IsUnused(experiment string) bool {
|
|
return slices.Contains(unusedExperiments, experiment)
|
|
}
|