mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
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:
co-authored by
Emil Tullstedt
parent
5ad3d10016
commit
421f7a999a
@@ -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
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||
)
|
||||
|
||||
type Store interface {
|
||||
@@ -11,6 +12,7 @@ type Store interface {
|
||||
GetAlertNotifiersUsageStats(ctx context.Context, query *models.GetAlertNotifierUsageStatsQuery) error
|
||||
GetDataSourceStats(ctx context.Context, query *models.GetDataSourceStatsQuery) error
|
||||
GetDataSourceAccessStats(ctx context.Context, query *models.GetDataSourceAccessStatsQuery) error
|
||||
GetDialect() migrator.Dialect
|
||||
GetSystemStats(ctx context.Context, query *models.GetSystemStatsQuery) error
|
||||
GetOrgByName(name string) (*models.Org, error)
|
||||
CreateOrg(ctx context.Context, cmd *models.CreateOrgCommand) error
|
||||
|
||||
Reference in New Issue
Block a user