ldap.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. // LdapServer LDAP 服务配置表
  3. type LdapServer struct {
  4. Id int `orm:"pk;auto" json:"id"`
  5. // 用户账号,唯一标识, Uid
  6. Uid string `orm:"size(100)" json:"uid"`
  7. Name string `orm:"size(255)" json:"name"`
  8. Key string `orm:"unique" json:"key"`
  9. Url string `json:"url"`
  10. Active bool `json:"active"` // 是否激活可用
  11. UserName string `json:"userName"` // 直接存储JSON数据,数组格式,多个
  12. Password string `json:"password"`
  13. BaseDN string `orm:"size(255);column(base_dn)" json:"baseDN"`
  14. Filter string `orm:"size(255)" json:"filter"`
  15. Remark string `json:"remark"`
  16. }
  17. // LdapUser User 用户表
  18. // https://blog.csdn.net/wzjking0929/article/details/81153206
  19. type LdapUser struct {
  20. Id int `orm:"pk;auto" json:"id"`
  21. // 用户账号,唯一标识, Uid
  22. Uid string `orm:"unique" json:"uid"`
  23. Account string `json:"account"` // 即DN,eg. cn=test,dc=xxxx,dc=cn
  24. UserName string `json:"userName"`
  25. Mail string `json:"mail"`
  26. DN string `orm:"column(db)" json:"dn"`
  27. Attributes string `orm:"null;type(text)" json:"attributes"` // 直接存储JSON数据,数组格式,多个
  28. SignType string `json:"signType"` // 密码加密方式
  29. Password string `json:"password"`
  30. Remark string `json:"remark"`
  31. ServerKey string `json:"serverKey"`
  32. }