From 957e50412e1e8ed80e4e17a155b5b469c8f4f8e0 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 28 Sep 2023 13:01:36 -0400 Subject: [PATCH] separate out the OAuth host config from HostMatch (#404) --- endpoints/publicProxy/config.go | 1 + endpoints/publicProxy/http.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/publicProxy/config.go b/endpoints/publicProxy/config.go index f6ff078a..0a89cf02 100644 --- a/endpoints/publicProxy/config.go +++ b/endpoints/publicProxy/config.go @@ -18,6 +18,7 @@ type Config struct { } type OauthConfig struct { + Host string Port int RedirectUrl string HashKeyRaw string diff --git a/endpoints/publicProxy/http.go b/endpoints/publicProxy/http.go index ac53ddb4..07eb1e06 100644 --- a/endpoints/publicProxy/http.go +++ b/endpoints/publicProxy/http.go @@ -334,11 +334,10 @@ func basicAuthRequired(w http.ResponseWriter, realm string) { } func oauthLoginRequired(w http.ResponseWriter, r *http.Request, shrToken string, pcfg *Config, provider, target string, authCheckInterval time.Duration) { - http.Redirect(w, r, fmt.Sprintf("http://%s.%s:%d/%s/login?targethost=%s&checkInterval=%s", shrToken, pcfg.HostMatch, pcfg.Oauth.Port, provider, url.QueryEscape(target), authCheckInterval.String()), http.StatusFound) + http.Redirect(w, r, fmt.Sprintf("http://%s.%s:%d/%s/login?targethost=%s&checkInterval=%s", shrToken, pcfg.Oauth.Host, pcfg.Oauth.Port, provider, url.QueryEscape(target), authCheckInterval.String()), http.StatusFound) } func resolveService(hostMatch string, host string) string { - logrus.Debugf("host = '%v'", host) if hostMatch == "" || strings.Contains(host, hostMatch) { tokens := strings.Split(host, ".") if len(tokens) > 0 {