add a new configuration section for HTTP clients

HTTP clients are used for executing hooks such as the ones used for custom
actions, external authentication and pre-login user modifications.

This allows, for example, to use self-signed certificate without defeating the
purpose of using TLS
This commit is contained in:
Nicola Murino
2020-04-26 23:29:09 +02:00
parent ebd6a11f3a
commit d377181b25
16 changed files with 138 additions and 36 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/drakkan/sftpgo/config"
"github.com/drakkan/sftpgo/dataprovider"
"github.com/drakkan/sftpgo/httpclient"
"github.com/drakkan/sftpgo/httpd"
"github.com/drakkan/sftpgo/sftpd"
)
@@ -36,6 +37,10 @@ func TestLoadConfigTest(t *testing.T) {
if config.GetSFTPDConfig().BindPort == emptySFTPDConf.BindPort {
t.Errorf("error loading SFTPD conf")
}
emptyHTTPConfig := httpclient.Config{}
if config.GetHTTPConfig().Timeout == emptyHTTPConfig.Timeout {
t.Errorf("error loading HTTP conf")
}
confName := tempConfigName + ".json"
configFilePath := filepath.Join(configDir, confName)
err = config.LoadConfig(configDir, tempConfigName)