Auth: Case insensitive ids duplicate usagestats (#50724)

* WIP

* update for prometheus

* usagestats: tests pass for user duplicate entries

* metrics: added duplicate user entries

* usagestats: adds metrics gauge for duplicate users

* usagestats: skip test for mysql

* sql in oneplace

* only use prometheus register to not panic

* usagestats: RegisterMetricsFunc with loginstats

* fix: remove unused commited code

* refactor: move test to authinfoservice

* Update pkg/models/stats.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* removed prometheus metrics, due to sql cpu requirement

* Added: has_duplicate_user_entries and fix tests

* remove unused test

* fix: empty else statement removal

* missing argument to authinfoservice

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
Eric Leijonmarck
2022-06-22 14:16:28 +02:00
committed by GitHub
parent 5ad3d10016
commit 421f7a999a
8 changed files with 126 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
type OrgListResponse []struct {
@@ -72,6 +73,10 @@ func (m *SQLStoreMock) GetSystemStats(ctx context.Context, query *models.GetSyst
return m.ExpectedError
}
func (m *SQLStoreMock) GetDialect() migrator.Dialect {
return nil
}
func (m *SQLStoreMock) HasEditPermissionInFolders(ctx context.Context, query *models.HasEditPermissionInFoldersQuery) error {
return m.ExpectedError
}