You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

auth_form.go 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package auth
  5. import (
  6. "gitea.com/macaron/binding"
  7. "gitea.com/macaron/macaron"
  8. )
  9. // AuthenticationForm form for authentication
  10. type AuthenticationForm struct {
  11. ID int64
  12. Type int `binding:"Range(2,7)"`
  13. Name string `binding:"Required;MaxSize(30)"`
  14. Host string
  15. Port int
  16. BindDN string
  17. BindPassword string
  18. UserBase string
  19. UserDN string
  20. AttributeUsername string
  21. AttributeName string
  22. AttributeSurname string
  23. AttributeMail string
  24. AttributeSSHPublicKey string
  25. AttributesInBind bool
  26. UsePagedSearch bool
  27. SearchPageSize int
  28. Filter string
  29. AdminFilter string
  30. RestrictedFilter string
  31. AllowDeactivateAll bool
  32. IsActive bool
  33. IsSyncEnabled bool
  34. SMTPAuth string
  35. SMTPHost string
  36. SMTPPort int
  37. AllowedDomains string
  38. SecurityProtocol int `binding:"Range(0,2)"`
  39. TLS bool
  40. SkipVerify bool
  41. PAMServiceName string
  42. Oauth2Provider string
  43. Oauth2Key string
  44. Oauth2Secret string
  45. OpenIDConnectAutoDiscoveryURL string
  46. Oauth2UseCustomURL bool
  47. Oauth2TokenURL string
  48. Oauth2AuthURL string
  49. Oauth2ProfileURL string
  50. Oauth2EmailURL string
  51. SSPIAutoCreateUsers bool
  52. SSPIAutoActivateUsers bool
  53. SSPIStripDomainNames bool
  54. SSPISeparatorReplacement string `binding:"AlphaDashDot;MaxSize(5)"`
  55. SSPIDefaultLanguage string
  56. }
  57. // Validate validates fields
  58. func (f *AuthenticationForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  59. return validate(errs, ctx.Data, f, ctx.Locale)
  60. }