Chore: Add user service method GetByLogin (#53204)

* Add wrapper around sqlstore method GetUserByLogin

* Use new method from user service

* Fix lint

* Fix lint 2

* fix middleware basic auth test

* Fix grafana login returning a user by login

* Remove GetUserByLogin from store interface

* Merge commit
This commit is contained in:
idafurjes
2022-08-04 13:22:43 +02:00
committed by GitHub
parent 1ec9007fe0
commit 1ecbe22751
23 changed files with 122 additions and 84 deletions
@@ -137,11 +137,6 @@ func (m *SQLStoreMock) CreateUser(ctx context.Context, cmd user.CreateUserComman
return nil, m.ExpectedError
}
func (m *SQLStoreMock) GetUserByLogin(ctx context.Context, query *models.GetUserByLoginQuery) error {
query.Result = m.ExpectedUser
return m.ExpectedError
}
func (m *SQLStoreMock) GetUserByEmail(ctx context.Context, query *models.GetUserByEmailQuery) error {
return m.ExpectedError
}
-1
View File
@@ -31,7 +31,6 @@ type Store interface {
GetUserLoginAttemptCount(ctx context.Context, query *models.GetUserLoginAttemptCountQuery) error
DeleteOldLoginAttempts(ctx context.Context, cmd *models.DeleteOldLoginAttemptsCommand) error
CreateUser(ctx context.Context, cmd user.CreateUserCommand) (*user.User, error)
GetUserByLogin(ctx context.Context, query *models.GetUserByLoginQuery) error
GetUserByEmail(ctx context.Context, query *models.GetUserByEmailQuery) error
UpdateUser(ctx context.Context, cmd *models.UpdateUserCommand) error
ChangeUserPassword(ctx context.Context, cmd *models.ChangeUserPasswordCommand) error