mirror of
https://github.com/gotify/server.git
synced 2026-06-09 08:15:15 +08:00
add config for external authenticators
This commit is contained in:
@@ -39,9 +39,13 @@ type Configuration struct {
|
||||
Name string `default:"admin"`
|
||||
Pass string `default:"admin"`
|
||||
}
|
||||
PassStrength int `default:"10"`
|
||||
UploadedImagesDir string `default:"data/images"`
|
||||
PluginsDir string `default:"data/plugins"`
|
||||
PassStrength int `default:"10"`
|
||||
UploadedImagesDir string `default:"data/images"`
|
||||
PluginsDir string `default:"data/plugins"`
|
||||
ExternalAuthenticators []struct {
|
||||
Name string
|
||||
Path string
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns the configuration extracted from env variables or config file.
|
||||
|
||||
@@ -90,6 +90,9 @@ defaultuser:
|
||||
name: nicories
|
||||
pass: 12345
|
||||
pluginsdir: data/plugins
|
||||
externalauthenticators:
|
||||
- name: ldap
|
||||
path: auth/ldap.so
|
||||
`)
|
||||
file.Close()
|
||||
assert.Nil(t, err)
|
||||
@@ -105,6 +108,8 @@ pluginsdir: data/plugins
|
||||
assert.Equal(t, "GET,POST", conf.Server.ResponseHeaders["Access-Control-Allow-Methods"])
|
||||
assert.Equal(t, []string{".+.example.com", "otherdomain.com"}, conf.Server.Stream.AllowedOrigins)
|
||||
assert.Equal(t, "data/plugins", conf.PluginsDir)
|
||||
assert.Len(t, conf.ExternalAuthenticators, 1)
|
||||
assert.Equal(t, "ldap", conf.ExternalAuthenticators[0].Name)
|
||||
|
||||
assert.Nil(t, os.Remove("config.yml"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user