user_auth.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package models
  2. import (
  3. "time"
  4. )
  5. type UserAuth struct {
  6. Id int64
  7. UserId int64
  8. AuthModule string
  9. AuthId string
  10. Created time.Time
  11. }
  12. type ExternalUserInfo struct {
  13. AuthModule string
  14. AuthId string
  15. UserId int64
  16. Email string
  17. Login string
  18. Name string
  19. OrgRoles map[int64]RoleType
  20. }
  21. // ---------------------
  22. // COMMANDS
  23. type UpsertUserCommand struct {
  24. ReqContext *ReqContext
  25. ExternalUser *ExternalUserInfo
  26. SignupAllowed bool
  27. Result *User
  28. }
  29. type SetAuthInfoCommand struct {
  30. AuthModule string
  31. AuthId string
  32. UserId int64
  33. }
  34. type DeleteAuthInfoCommand struct {
  35. UserAuth *UserAuth
  36. }
  37. // ----------------------
  38. // QUERIES
  39. type LoginUserQuery struct {
  40. ReqContext *ReqContext
  41. Username string
  42. Password string
  43. User *User
  44. IpAddress string
  45. }
  46. type GetUserByAuthInfoQuery struct {
  47. AuthModule string
  48. AuthId string
  49. UserId int64
  50. Email string
  51. Login string
  52. User *User
  53. UserAuth *UserAuth
  54. }
  55. type GetAuthInfoQuery struct {
  56. AuthModule string
  57. AuthId string
  58. UserAuth *UserAuth
  59. }