Feature Toggles API: Trigger webhook call when updating (#75254)

* Feature Toggles API: Trigger webhook call when updating

* update status code error check

* lint - handle Close() error

* Rename update webhook config

* fix tests
This commit is contained in:
João Calisto
2023-09-25 19:11:24 +01:00
committed by GitHub
parent 436b0ee48a
commit 7e1b45ba31
6 changed files with 121 additions and 35 deletions

View File

@@ -5,10 +5,11 @@ import (
)
type FeatureMgmtSettings struct {
HiddenToggles map[string]struct{}
ReadOnlyToggles map[string]struct{}
AllowEditing bool
UpdateControllerUrl string
HiddenToggles map[string]struct{}
ReadOnlyToggles map[string]struct{}
AllowEditing bool
UpdateWebhook string
UpdateWebhookToken string
}
func (cfg *Cfg) readFeatureManagementConfig() {
@@ -32,5 +33,6 @@ func (cfg *Cfg) readFeatureManagementConfig() {
cfg.FeatureManagement.HiddenToggles = hiddenToggles
cfg.FeatureManagement.ReadOnlyToggles = readOnlyToggles
cfg.FeatureManagement.AllowEditing = cfg.SectionWithEnvOverrides("feature_management").Key("allow_editing").MustBool(false)
cfg.FeatureManagement.UpdateControllerUrl = cfg.SectionWithEnvOverrides("feature_management").Key("update_controller_url").MustString("")
cfg.FeatureManagement.UpdateWebhook = cfg.SectionWithEnvOverrides("feature_management").Key("update_webhook").MustString("")
cfg.FeatureManagement.UpdateWebhookToken = cfg.SectionWithEnvOverrides("feature_management").Key("update_webhook_token").MustString("")
}