Alerting: Fix route validation in provisioning service (#107550)
* introduce ExtraConfigsCrypto * delete getLastConfiguration and move all code into method Get * update legacy store to encrypt ExtraConfigs same way we do in MultiOrgAlertmanager * update legacy store init * delete PersistConfig * remove unnecessary unmarshalling * add better error * add tests for legacy store * add tests that cover extra config validation * add integration test for conflicting routes --------- Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
@@ -294,7 +294,7 @@ func (ps *ProvisioningServiceImpl) ProvisionAlerting(ctx context.Context) error
|
||||
ps.alertingStore,
|
||||
ps.alertingStore,
|
||||
ps.folderService,
|
||||
//ps.dashboardService,
|
||||
// ps.dashboardService,
|
||||
ps.quotaService,
|
||||
ps.SQLStore,
|
||||
int64(ps.Cfg.UnifiedAlerting.DefaultRuleEvaluationInterval.Seconds()),
|
||||
@@ -304,7 +304,7 @@ func (ps *ProvisioningServiceImpl) ProvisionAlerting(ctx context.Context) error
|
||||
notifier.NewCachedNotificationSettingsValidationService(ps.alertingStore),
|
||||
alertingauthz.NewRuleService(ps.ac),
|
||||
)
|
||||
configStore := legacy_storage.NewAlertmanagerConfigStore(ps.alertingStore)
|
||||
configStore := legacy_storage.NewAlertmanagerConfigStore(ps.alertingStore, notifier.NewExtraConfigsCrypto(ps.secretService))
|
||||
receiverSvc := notifier.NewReceiverService(
|
||||
alertingauthz.NewReceiverAccess[*ngmodels.Receiver](ps.ac, true),
|
||||
configStore,
|
||||
|
||||
Reference in New Issue
Block a user