diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-04-07 10:38:36 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-07 10:38:36 -0400 |
commit | 0a2341efd208ba8a9ddd69f647b0df4286829604 (patch) | |
tree | 7ef89c6d1fd0a2fcbd48c78987b1ad95085147d9 /model | |
parent | 32bc97f8559a3a1b9c9237dbb3640f9eac6daf98 (diff) | |
download | chat-0a2341efd208ba8a9ddd69f647b0df4286829604.tar.gz chat-0a2341efd208ba8a9ddd69f647b0df4286829604.tar.bz2 chat-0a2341efd208ba8a9ddd69f647b0df4286829604.zip |
Adding TLS options to LDAP
Diffstat (limited to 'model')
-rw-r--r-- | model/config.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/model/config.go b/model/config.go index 666b2770b..29bc536dc 100644 --- a/model/config.go +++ b/model/config.go @@ -162,12 +162,13 @@ type TeamSettings struct { type LdapSettings struct { // Basic - Enable *bool - LdapServer *string - LdapPort *int - BaseDN *string - BindUsername *string - BindPassword *string + Enable *bool + LdapServer *string + LdapPort *int + ConnectionSecurity *string + BaseDN *string + BindUsername *string + BindPassword *string // Filtering UserFilter *string @@ -180,7 +181,8 @@ type LdapSettings struct { IdAttribute *string // Advanced - QueryTimeout *int + SkipCertificateVerification *bool + QueryTimeout *int } type ComplianceSettings struct { @@ -526,6 +528,10 @@ func (o *Config) IsValid() *AppError { return NewLocAppError("Config.IsValid", "model.config.is_valid.rate_sec.app_error", nil, "") } + if !(*o.LdapSettings.ConnectionSecurity == CONN_SECURITY_NONE || *o.LdapSettings.ConnectionSecurity == CONN_SECURITY_TLS || *o.LdapSettings.ConnectionSecurity == CONN_SECURITY_STARTTLS) { + return NewLocAppError("Config.IsValid", "model.config.is_valid.ldap_security.app_error", nil, "") + } + return nil } |