From c90e6cd70f71200b2e6cef7e77c713c465c6b426 Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Sat, 23 Mar 2024 16:34:54 +0100 Subject: [PATCH] Get additions file from config --- example.config.toml | 3 +++ internal/app/web/services.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example.config.toml b/example.config.toml index d204c3f..1049d72 100644 --- a/example.config.toml +++ b/example.config.toml @@ -10,6 +10,9 @@ apiKey = "key" url = "http://localhost:8081" +[additions] + file = "additions.json" + [ldap] url = "ldap.mydomain.ex:636" servername = "mydomain.ex" diff --git a/internal/app/web/services.go b/internal/app/web/services.go index 5c73473..ec463a0 100644 --- a/internal/app/web/services.go +++ b/internal/app/web/services.go @@ -111,7 +111,7 @@ func getChangeSuggestions(fromJson string, toJson string) (actions.UserActions, consumerUsers = collectUsers(consumer) // Get and process additions - providerGroups, providerUsers = pkg.AddAdditions(providerGroups, providerUsers, "additions.json") + providerGroups, providerUsers = pkg.AddAdditions(providerGroups, providerUsers, viper.GetString("additions.file")) // Check for and handle duplicates providerUsers, providerGroups = duplicates.RemoveDuplicates(providerUsers, providerGroups)