[v9.0.x] Auth: Case insensitive ids duplicate usagestats (#51240)

* merged and backport to 9.0

* implement the missing method GetDialect for sqlStore

* Add back mockstore missing methods
This commit is contained in:
Eric Leijonmarck
2022-06-28 11:03:53 +02:00
committed by GitHub
parent 6dcb1b07c0
commit 5735f6c88b
9 changed files with 130 additions and 5 deletions
+6 -1
View File
@@ -14,6 +14,7 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/usagestats"
"github.com/grafana/grafana/pkg/models"
acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
"github.com/grafana/grafana/pkg/services/login/authinfoservice"
@@ -48,7 +49,11 @@ func TestUserAPIEndpoint_userLoggedIn(t *testing.T) {
fakeNow := time.Date(2019, 2, 11, 17, 30, 40, 0, time.UTC)
secretsService := secretsManager.SetupTestService(t, database.ProvideSecretsStore(sqlStore))
authInfoStore := authinfostore.ProvideAuthInfoStore(sqlStore, secretsService)
srv := authinfoservice.ProvideAuthInfoService(&authinfoservice.OSSUserProtectionImpl{}, authInfoStore)
srv := authinfoservice.ProvideAuthInfoService(
&authinfoservice.OSSUserProtectionImpl{},
authInfoStore,
&usagestats.UsageStatsMock{},
)
hs.authInfoService = srv
createUserCmd := models.CreateUserCommand{