Auth: reload SSO settings for HA setups (#80231)

* reload SSO settings for HA setups

* remove check for grafana HA

* add unit tests

* fetch all sso settings with one sql query

* register background service
This commit is contained in:
Mihai Doarna
2024-01-10 16:01:37 +02:00
committed by GitHub
parent 02136e5a2f
commit 772e5993b6
3 changed files with 95 additions and 0 deletions
@@ -36,6 +36,7 @@ import (
"github.com/grafana/grafana/pkg/services/serviceaccounts"
samanager "github.com/grafana/grafana/pkg/services/serviceaccounts/manager"
"github.com/grafana/grafana/pkg/services/ssosettings"
"github.com/grafana/grafana/pkg/services/ssosettings/ssosettingsimpl"
"github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/services/store/entity"
"github.com/grafana/grafana/pkg/services/store/sanitizer"
@@ -58,6 +59,7 @@ func ProvideBackgroundServiceRegistry(
keyRetriever *dynamic.KeyRetriever, dynamicAngularDetectorsProvider *angulardetectorsprovider.Dynamic,
grafanaAPIServer grafanaapiserver.Service,
anon *anonimpl.AnonDeviceService,
ssoSettings *ssosettingsimpl.SSOSettingsService,
// Need to make sure these are initialized, is there a better place to put them?
_ dashboardsnapshots.Service, _ *alerting.AlertNotificationService,
_ serviceaccounts.Service, _ *guardian.Provider,
@@ -98,6 +100,7 @@ func ProvideBackgroundServiceRegistry(
dynamicAngularDetectorsProvider,
grafanaAPIServer,
anon,
ssoSettings,
)
}