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.
76 lines
2.6 KiB
76 lines
2.6 KiB
11 years ago
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
4 years ago
|
package forms
|
||
11 years ago
|
|
||
|
import (
|
||
4 years ago
|
"net/http"
|
||
|
|
||
|
"code.gitea.io/gitea/modules/context"
|
||
4 years ago
|
"code.gitea.io/gitea/modules/web/middleware"
|
||
4 years ago
|
|
||
|
"gitea.com/go-chi/binding"
|
||
11 years ago
|
)
|
||
|
|
||
8 years ago
|
// AuthenticationForm form for authentication
|
||
11 years ago
|
type AuthenticationForm struct {
|
||
8 years ago
|
ID int64
|
||
5 years ago
|
Type int `binding:"Range(2,7)"`
|
||
8 years ago
|
Name string `binding:"Required;MaxSize(30)"`
|
||
|
Host string
|
||
|
Port int
|
||
|
BindDN string
|
||
|
BindPassword string
|
||
|
UserBase string
|
||
|
UserDN string
|
||
|
AttributeUsername string
|
||
|
AttributeName string
|
||
|
AttributeSurname string
|
||
|
AttributeMail string
|
||
7 years ago
|
AttributeSSHPublicKey string
|
||
8 years ago
|
AttributesInBind bool
|
||
7 years ago
|
UsePagedSearch bool
|
||
|
SearchPageSize int
|
||
8 years ago
|
Filter string
|
||
|
AdminFilter string
|
||
4 years ago
|
GroupsEnabled bool
|
||
|
GroupDN string
|
||
|
GroupFilter string
|
||
|
GroupMemberUID string
|
||
|
UserUID string
|
||
5 years ago
|
RestrictedFilter string
|
||
5 years ago
|
AllowDeactivateAll bool
|
||
8 years ago
|
IsActive bool
|
||
8 years ago
|
IsSyncEnabled bool
|
||
8 years ago
|
SMTPAuth string
|
||
|
SMTPHost string
|
||
|
SMTPPort int
|
||
|
AllowedDomains string
|
||
|
SecurityProtocol int `binding:"Range(0,2)"`
|
||
|
TLS bool
|
||
|
SkipVerify bool
|
||
|
PAMServiceName string
|
||
|
Oauth2Provider string
|
||
|
Oauth2Key string
|
||
|
Oauth2Secret string
|
||
|
OpenIDConnectAutoDiscoveryURL string
|
||
|
Oauth2UseCustomURL bool
|
||
|
Oauth2TokenURL string
|
||
|
Oauth2AuthURL string
|
||
|
Oauth2ProfileURL string
|
||
|
Oauth2EmailURL string
|
||
4 years ago
|
Oauth2IconURL string
|
||
5 years ago
|
SSPIAutoCreateUsers bool
|
||
|
SSPIAutoActivateUsers bool
|
||
|
SSPIStripDomainNames bool
|
||
|
SSPISeparatorReplacement string `binding:"AlphaDashDot;MaxSize(5)"`
|
||
|
SSPIDefaultLanguage string
|
||
11 years ago
|
}
|
||
|
|
||
8 years ago
|
// Validate validates fields
|
||
4 years ago
|
func (f *AuthenticationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
|
||
|
ctx := context.GetContext(req)
|
||
4 years ago
|
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
|
||
11 years ago
|
}
|