MTFF: Allow viewers access in cloud (#114607)

* Reapply "K8s: read resource configs from API Enablement for API Builders" (#114475)

This reverts commit 4130bd9cd3.

* revert part that broke things

* FF service changes are gonna come later

* MTFF: allow viewers access to MTFF by enforcing runtime_config for custom routes

* unused var

* removed now

* pass the test, include defaults

* revert sample.ini change
This commit is contained in:
Charandas
2025-12-08 17:37:10 -08:00
committed by GitHub
parent 802e208440
commit 16f5eab786
8 changed files with 181 additions and 12 deletions
+16
View File
@@ -316,6 +316,21 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
_, err = serverSect.NewKey("static_root_path", publicDir)
require.NoError(t, err)
openFeatureSect, err := cfg.NewSection("feature_toggles.openfeature")
require.NoError(t, err)
_, err = openFeatureSect.NewKey("enable_api", strconv.FormatBool(opts.OpenFeatureAPIEnabled))
require.NoError(t, err)
if !opts.OpenFeatureAPIEnabled {
_, err = openFeatureSect.NewKey("provider", "static") // in practice, APIEnabled being false goes with goff type, but trying to make tests work
require.NoError(t, err)
_, err = openFeatureSect.NewKey("targetingKey", "grafana")
require.NoError(t, err)
// so staticFlags can be provided to static provider
_, err := cfg.NewSection("feature_toggles")
require.NoError(t, err)
}
anonSect, err := cfg.NewSection("auth.anonymous")
require.NoError(t, err)
_, err = anonSect.NewKey("enabled", "true")
@@ -654,6 +669,7 @@ type GrafanaOpts struct {
DisableDBCleanup bool
DisableDataMigrations bool
SecretsManagerEnableDBMigrations bool
OpenFeatureAPIEnabled bool
// Allow creating grafana dir beforehand
Dir string