API: send Login actions (#27249)

* API: first version to send events about login actions

* API: improve login actions events

* Login: update auth test with new behavior

* Login: update auth test for auth module

* Login OAuth: improve functions structure

* API: make struct public to use for saml

* API: add send login log tests for grafana and ldap login

* API: remove log from tests

* Login API: fix test linting

* Update pkg/api/login_oauth.go

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

* Login API: refactor using defer

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
Agnès Toulet
2020-09-04 14:54:59 +02:00
committed by GitHub
parent a54df0c3cd
commit a9daaadd50
7 changed files with 295 additions and 37 deletions

View File

@ -65,6 +65,15 @@ type DeleteAuthInfoCommand struct {
UserAuth *UserAuth
}
type SendLoginLogCommand struct {
ReqContext *ReqContext
LogAction string
User *User
ExternalUser *ExternalUserInfo
HTTPStatus int
Error error
}
// ----------------------
// QUERIES
@ -74,6 +83,7 @@ type LoginUserQuery struct {
Password string
User *User
IpAddress string
AuthModule string
}
type GetUserByAuthInfoQuery struct {