mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-25 06:35:32 +00:00
feat!: config for auth providers now use a map instead of an array
The config values for openid providers now use a map with the provider as key instead of an array. For example before:
auth:
openid:
providers:
- name: foo
clientid: ...
now becomes:
auth:
openid:
providers:
foo:
clientid: ...
This allows us to read values for openid providers from files using the same syntax as everywhere and makes the configuration more predictable. It also allows configuring providers through env variables, though it is still required to set at least one value via the config file because Vikunja won't discover the provider otherwise.
This commit is contained in:
@@ -443,6 +443,10 @@ func getConfigValueFromFile(configKey string) string {
|
||||
func readConfigValuesFromFiles() {
|
||||
keys := viper.AllKeys()
|
||||
for _, key := range keys {
|
||||
if strings.Contains(key, "auth.openid.providers") {
|
||||
// Setting openid provider values will remove everything but the value from file
|
||||
continue
|
||||
}
|
||||
// Env is evaluated manually at runtime, so we need to check this for each key
|
||||
value := getConfigValueFromFile(key + ".file")
|
||||
if value != "" {
|
||||
|
||||
Reference in New Issue
Block a user