OpenFeature: Add config setting to disable API (#108620)

* Add config option to disable ofrep api

* Apply review feedback
This commit is contained in:
Tania
2025-07-24 21:45:22 +02:00
committed by GitHub
parent 183cd0843e
commit d3b6d7c45e
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -11,6 +11,7 @@ const (
)
type OpenFeatureSettings struct {
APIEnabled bool
ProviderType string
URL *url.URL
TargetingKey string
@@ -21,6 +22,7 @@ func (cfg *Cfg) readOpenFeatureSettings() error {
cfg.OpenFeature = OpenFeatureSettings{}
config := cfg.Raw.Section("feature_toggles.openfeature")
cfg.OpenFeature.APIEnabled = config.Key("enable_api").MustBool(true)
cfg.OpenFeature.ProviderType = config.Key("provider").MustString(StaticProviderType)
cfg.OpenFeature.TargetingKey = config.Key("targetingKey").MustString(cfg.AppURL)