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
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ type Store interface {
|
||||
GetOrgById(context.Context, *models.GetOrgByIdQuery) error
|
||||
GetOrgByNameHandler(ctx context.Context, query *models.GetOrgByNameQuery) error
|
||||
CreateLoginAttempt(ctx context.Context, cmd *models.CreateLoginAttemptCommand) error
|
||||
GetUserLoginAttemptCount(ctx context.Context, query *models.GetUserLoginAttemptCountQuery) error
|
||||
DeleteOldLoginAttempts(ctx context.Context, cmd *models.DeleteOldLoginAttemptsCommand) error
|
||||
CreateUser(ctx context.Context, cmd models.CreateUserCommand) (*models.User, error)
|
||||
GetUserById(ctx context.Context, query *models.GetUserByIdQuery) error
|
||||
|
||||
Reference in New Issue
Block a user