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 19:45:22 +00:00
committed by GitHub
parent 183cd0843e
commit d3b6d7c45e
3 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -61,9 +61,12 @@ func NewAPIBuilder(providerType string, url *url.URL, insecure bool, caFile stri
}
func RegisterAPIService(apiregistration builder.APIRegistrar, cfg *setting.Cfg) (*APIBuilder, error) {
if !cfg.OpenFeature.APIEnabled {
return nil, nil
}
var staticEvaluator featuremgmt.StaticFlagEvaluator // No static evaluator needed for non-static provider
var err error
if cfg.OpenFeature.ProviderType == setting.StaticProviderType {
staticEvaluator, err = featuremgmt.CreateStaticEvaluator(cfg)
if err != nil {