user_auth.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. Groups []string
  20. OrgRoles map[int64]RoleType
  21. }
  22. // ---------------------
  23. // COMMANDS
  24. type UpsertUserCommand struct {
  25. ReqContext *ReqContext
  26. ExternalUser *ExternalUserInfo
  27. SignupAllowed bool
  28. Result *User
  29. }
  30. type SetAuthInfoCommand struct {
  31. AuthModule string
  32. AuthId string
  33. UserId int64
  34. }
  35. type DeleteAuthInfoCommand struct {
  36. UserAuth *UserAuth
  37. }
  38. // ----------------------
  39. // QUERIES
  40. type LoginUserQuery struct {
  41. ReqContext *ReqContext
  42. Username string
  43. Password string
  44. User *User
  45. IpAddress string
  46. }
  47. type GetUserByAuthInfoQuery struct {
  48. AuthModule string
  49. AuthId string
  50. UserId int64
  51. Email string
  52. Login string
  53. Result *User
  54. }
  55. type GetAuthInfoQuery struct {
  56. AuthModule string
  57. AuthId string
  58. Result *UserAuth
  59. }
  60. type SyncTeamsCommand struct {
  61. ExternalUser *ExternalUserInfo
  62. User *User
  63. }