Chore: Remove some bus from login package (login attempts) (#47310)
This commit is contained in:
@@ -12,8 +12,9 @@ type OrgListResponse []struct {
|
||||
Response error
|
||||
}
|
||||
type SQLStoreMock struct {
|
||||
LastGetAlertsQuery *models.GetAlertsQuery
|
||||
LatestUserId int64
|
||||
LastGetAlertsQuery *models.GetAlertsQuery
|
||||
LastLoginAttemptCommand *models.CreateLoginAttemptCommand
|
||||
LatestUserId int64
|
||||
|
||||
ExpectedUser *models.User
|
||||
ExpectedDatasource *models.DataSource
|
||||
@@ -40,7 +41,9 @@ type SQLStoreMock struct {
|
||||
ExpectedPersistedDashboards models.HitList
|
||||
ExpectedSignedInUser *models.SignedInUser
|
||||
ExpectedUserStars map[int64]bool
|
||||
ExpectedError error
|
||||
ExpectedLoginAttempts int64
|
||||
|
||||
ExpectedError error
|
||||
}
|
||||
|
||||
func NewSQLStoreMock() *SQLStoreMock {
|
||||
@@ -130,6 +133,12 @@ func (m SQLStoreMock) DeleteOrphanedProvisionedDashboards(ctx context.Context, c
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) CreateLoginAttempt(ctx context.Context, cmd *models.CreateLoginAttemptCommand) error {
|
||||
m.LastLoginAttemptCommand = cmd
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
func (m *SQLStoreMock) GetUserLoginAttemptCount(ctx context.Context, query *models.GetUserLoginAttemptCountQuery) error {
|
||||
query.Result = m.ExpectedLoginAttempts
|
||||
return m.ExpectedError
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user