From 7188d83f867cbc201aef4b0597ac5f868c1971f3 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Wed, 13 Jul 2022 18:26:52 -0300 Subject: [PATCH] Remove unnecessary oauth method Signed-off-by: Marcos Lilljedahl --- config/config.go | 23 +++++++++++++---------- handlers/bootstrap.go | 1 - handlers/login.go | 2 -- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/config.go b/config/config.go index 15f9f79..623d763 100644 --- a/config/config.go +++ b/config/config.go @@ -20,16 +20,20 @@ const ( AliasPortGroupRegex = "^.*pwd" + AliasGroupRegex + "(?:-?(" + PortRegex + "))?\\..*$" ) -var NameFilter = regexp.MustCompile(PWDHostPortGroupRegex) -var AliasFilter = regexp.MustCompile(AliasPortGroupRegex) +var ( + NameFilter = regexp.MustCompile(PWDHostPortGroupRegex) + AliasFilter = regexp.MustCompile(AliasPortGroupRegex) +) -var PortNumber, SessionsFile, PWDContainerName, L2ContainerName, L2Subdomain, HashKey, SSHKeyPath, L2RouterIP, CookieHashKey, CookieBlockKey string -var UseLetsEncrypt, ExternalDindVolume, NoWindows bool -var LetsEncryptCertsDir string -var MaxLoadAvg float64 -var ForceTLS bool -var SecureCookie *securecookie.SecureCookie -var AdminToken string +var ( + PortNumber, SessionsFile, PWDContainerName, L2ContainerName, L2Subdomain, HashKey, SSHKeyPath, L2RouterIP, CookieHashKey, CookieBlockKey string + UseLetsEncrypt, ExternalDindVolume, NoWindows bool + LetsEncryptCertsDir string + MaxLoadAvg float64 + ForceTLS bool + SecureCookie *securecookie.SecureCookie + AdminToken string +) // Unsafe enables a number of unsafe features when set. It is principally // intended to be used in development. For example, it allows the caller to @@ -71,5 +75,4 @@ func ParseFlags() { flag.Parse() SecureCookie = securecookie.New([]byte(CookieHashKey), []byte(CookieBlockKey)) - } diff --git a/handlers/bootstrap.go b/handlers/bootstrap.go index 70deb69..bfd676c 100644 --- a/handlers/bootstrap.go +++ b/handlers/bootstrap.go @@ -273,7 +273,6 @@ func initOauthProviders(p *types.Playground) { if p.DockerClientID != "" && p.DockerClientSecret != "" { endpoint := getDockerEndpoint(p) - oauth2.RegisterBrokenAuthHeaderProvider(fmt.Sprintf(".%s", endpoint)) conf := &oauth2.Config{ ClientID: p.DockerClientID, ClientSecret: p.DockerClientSecret, diff --git a/handlers/login.go b/handlers/login.go index a3cf7aa..d2a3862 100644 --- a/handlers/login.go +++ b/handlers/login.go @@ -208,8 +208,6 @@ func LoginCallback(rw http.ResponseWriter, req *http.Request) { return } - fmt.Printf("Lalalala %#v\n", user) - cookieData := CookieID{Id: user.Id, UserName: user.Name, UserAvatar: user.Avatar, ProviderId: user.ProviderUserId} host := "localhost"