From c61fe651064400cd91c90392f354a834b4672193 Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Wed, 6 Sep 2023 16:12:00 +0000 Subject: [PATCH] Fix naming of oidc config vars --- config/config.go | 8 ++++---- namespace-registry/registry.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index cb4f563ec..35774bce0 100644 --- a/config/config.go +++ b/config/config.go @@ -250,8 +250,8 @@ func InitServer() error { viper.SetDefault("XrootdMultiuser", true) viper.SetDefault("GeoIPLocation", "/var/cache/pelican/maxmind/GeoLite2-City.mmdb") viper.SetDefault("NSRegistryLocation", "/var/lib/pelican/registry.sqlite") - viper.SetDefault("OIDCClientIDFile", "/etc/pelican/oidc-client-id") - viper.SetDefault("OIDCClientSecretFile", "/etc/pelican/oidc-client-secret") + viper.SetDefault("OIDC.ClientIDFile", "/etc/pelican/oidc-client-id") + viper.SetDefault("OIDC.ClientSecretFile", "/etc/pelican/oidc-client-secret") viper.SetDefault("MonitoringData", "/var/lib/pelican/monitoring/data") } else { configBase, err := getConfigBase() @@ -268,8 +268,8 @@ func InitServer() error { viper.SetDefault("OriginUI.PasswordFile", filepath.Join(configBase, "origin-ui-passwd")) viper.SetDefault("GeoIPLocation", filepath.Join(configBase, "maxmind", "GeoLite2-City.mmdb")) viper.SetDefault("NSRegistryLocation", filepath.Join(configBase, "ns-registry.sqlite")) - viper.SetDefault("OIDCClientIDFile", filepath.Join(configBase, "oidc-client-id")) - viper.SetDefault("OIDCClientSecretFile", filepath.Join(configBase, "oidc-client-secret")) + viper.SetDefault("OIDC.ClientIDFile", filepath.Join(configBase, "oidc-client-id")) + viper.SetDefault("OIDC.ClientSecretFile", filepath.Join(configBase, "oidc-client-secret")) viper.SetDefault("MonitoringData", filepath.Join(configBase, "monitoring/data")) if userRuntimeDir := os.Getenv("XDG_RUNTIME_DIR"); userRuntimeDir != "" { diff --git a/namespace-registry/registry.go b/namespace-registry/registry.go index fdff43383..37b63b28e 100644 --- a/namespace-registry/registry.go +++ b/namespace-registry/registry.go @@ -151,7 +151,7 @@ func loadOIDC() error { } // load OIDC.ClientSecret - OIDCClientSecretFile := viper.GetString("OIDCClientSecretFile") + OIDCClientSecretFile := viper.GetString("OIDC.ClientSecretFile") OIDCClientSecretFromEnv := viper.GetString("OIDCCLIENTSECRET") if OIDCClientSecretFile != "" { contents, err := os.ReadFile(OIDCClientSecretFile)