ci: bump golangci/golangci-lint-action from 6 to 7 (#13661)
* ci: bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix lint Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix v2 Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix v3 Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/ci-outpost.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ci-outpost.yml
									
									
									
									
										vendored
									
									
								
							| @ -29,7 +29,7 @@ jobs: | ||||
|       - name: Generate API | ||||
|         run: make gen-client-go | ||||
|       - name: golangci-lint | ||||
|         uses: golangci/golangci-lint-action@v6 | ||||
|         uses: golangci/golangci-lint-action@v7 | ||||
|         with: | ||||
|           version: latest | ||||
|           args: --timeout 5000s --verbose | ||||
|  | ||||
| @ -162,13 +162,14 @@ func (c *Config) parseScheme(rawVal string) string { | ||||
| 	if err != nil { | ||||
| 		return rawVal | ||||
| 	} | ||||
| 	if u.Scheme == "env" { | ||||
| 	switch u.Scheme { | ||||
| 	case "env": | ||||
| 		e, ok := os.LookupEnv(u.Host) | ||||
| 		if ok { | ||||
| 			return e | ||||
| 		} | ||||
| 		return u.RawQuery | ||||
| 	} else if u.Scheme == "file" { | ||||
| 	case "file": | ||||
| 		d, err := os.ReadFile(u.Path) | ||||
| 		if err != nil { | ||||
| 			return u.RawQuery | ||||
|  | ||||
| @ -10,7 +10,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| func TestConfigEnv(t *testing.T) { | ||||
| 	os.Setenv("AUTHENTIK_SECRET_KEY", "bar") | ||||
| 	assert.NoError(t, os.Setenv("AUTHENTIK_SECRET_KEY", "bar")) | ||||
| 	cfg = nil | ||||
| 	if err := Get().fromEnv(); err != nil { | ||||
| 		panic(err) | ||||
| @ -19,8 +19,8 @@ func TestConfigEnv(t *testing.T) { | ||||
| } | ||||
|  | ||||
| func TestConfigEnv_Scheme(t *testing.T) { | ||||
| 	os.Setenv("foo", "bar") | ||||
| 	os.Setenv("AUTHENTIK_SECRET_KEY", "env://foo") | ||||
| 	assert.NoError(t, os.Setenv("foo", "bar")) | ||||
| 	assert.NoError(t, os.Setenv("AUTHENTIK_SECRET_KEY", "env://foo")) | ||||
| 	cfg = nil | ||||
| 	if err := Get().fromEnv(); err != nil { | ||||
| 		panic(err) | ||||
| @ -33,13 +33,15 @@ func TestConfigEnv_File(t *testing.T) { | ||||
| 	if err != nil { | ||||
| 		log.Fatal(err) | ||||
| 	} | ||||
| 	defer os.Remove(file.Name()) | ||||
| 	defer func() { | ||||
| 		assert.NoError(t, os.Remove(file.Name())) | ||||
| 	}() | ||||
| 	_, err = file.Write([]byte("bar")) | ||||
| 	if err != nil { | ||||
| 		panic(err) | ||||
| 	} | ||||
|  | ||||
| 	os.Setenv("AUTHENTIK_SECRET_KEY", fmt.Sprintf("file://%s", file.Name())) | ||||
| 	assert.NoError(t, os.Setenv("AUTHENTIK_SECRET_KEY", fmt.Sprintf("file://%s", file.Name()))) | ||||
| 	cfg = nil | ||||
| 	if err := Get().fromEnv(); err != nil { | ||||
| 		panic(err) | ||||
|  | ||||
| @ -35,7 +35,7 @@ func EnableDebugServer() { | ||||
| 			if err != nil { | ||||
| 				return nil | ||||
| 			} | ||||
| 			_, err = w.Write([]byte(fmt.Sprintf("<a href='%[1]s'>%[1]s</a><br>", tpl))) | ||||
| 			_, err = fmt.Fprintf(w, "<a href='%[1]s'>%[1]s</a><br>", tpl) | ||||
| 			if err != nil { | ||||
| 				l.WithError(err).Warning("failed to write index") | ||||
| 				return nil | ||||
|  | ||||
| @ -44,10 +44,11 @@ func New(healthcheck func() bool) *GoUnicorn { | ||||
| 	signal.Notify(c, syscall.SIGHUP, syscall.SIGUSR2) | ||||
| 	go func() { | ||||
| 		for sig := range c { | ||||
| 			if sig == syscall.SIGHUP { | ||||
| 			switch sig { | ||||
| 			case syscall.SIGHUP: | ||||
| 				g.log.Info("SIGHUP received, forwarding to gunicorn") | ||||
| 				g.Reload() | ||||
| 			} else if sig == syscall.SIGUSR2 { | ||||
| 			case syscall.SIGUSR2: | ||||
| 				g.log.Info("SIGUSR2 received, restarting gunicorn") | ||||
| 				g.Restart() | ||||
| 			} | ||||
|  | ||||
| @ -148,7 +148,8 @@ func (ac *APIController) startWSHandler() { | ||||
| 			"outpost_type": ac.Server.Type(), | ||||
| 			"uuid":         ac.instanceUUID.String(), | ||||
| 		}).Set(1) | ||||
| 		if wsMsg.Instruction == WebsocketInstructionTriggerUpdate { | ||||
| 		switch wsMsg.Instruction { | ||||
| 		case WebsocketInstructionTriggerUpdate: | ||||
| 			time.Sleep(ac.reloadOffset) | ||||
| 			logger.Debug("Got update trigger...") | ||||
| 			err := ac.OnRefresh() | ||||
| @ -163,7 +164,7 @@ func (ac *APIController) startWSHandler() { | ||||
| 					"build":        constants.BUILD(""), | ||||
| 				}).SetToCurrentTime() | ||||
| 			} | ||||
| 		} else if wsMsg.Instruction == WebsocketInstructionProviderSpecific { | ||||
| 		case WebsocketInstructionProviderSpecific: | ||||
| 			for _, h := range ac.wsHandlers { | ||||
| 				h(context.Background(), wsMsg.Args) | ||||
| 			} | ||||
|  | ||||
| @ -66,7 +66,12 @@ func (ls *LDAPServer) StartLDAPServer() error { | ||||
| 		return err | ||||
| 	} | ||||
| 	proxyListener := &proxyproto.Listener{Listener: ln, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ls.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	ls.log.WithField("listen", listen).Info("Starting LDAP server") | ||||
| 	err = ls.s.Serve(proxyListener) | ||||
|  | ||||
| @ -49,7 +49,12 @@ func (ls *LDAPServer) StartLDAPTLSServer() error { | ||||
| 	} | ||||
|  | ||||
| 	proxyListener := &proxyproto.Listener{Listener: ln, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ls.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	tln := tls.NewListener(proxyListener, tlsConfig) | ||||
|  | ||||
|  | ||||
| @ -98,7 +98,7 @@ func (ms *MemorySearcher) Search(req *search.Request) (ldap.ServerSearchResult, | ||||
|  | ||||
| 	entries := make([]*ldap.Entry, 0) | ||||
|  | ||||
| 	scope := req.SearchRequest.Scope | ||||
| 	scope := req.Scope | ||||
| 	needUsers, needGroups := ms.si.GetNeededObjects(scope, req.BaseDN, req.FilterObjectClass) | ||||
|  | ||||
| 	if scope >= 0 && strings.EqualFold(req.BaseDN, baseDN) { | ||||
|  | ||||
| @ -56,7 +56,7 @@ func GetOIDCEndpoint(p api.ProxyOutpostConfig, authentikHost string, embedded bo | ||||
| 	if !embedded && hostBrowser == "" { | ||||
| 		return ep | ||||
| 	} | ||||
| 	var newHost *url.URL = aku | ||||
| 	var newHost = aku | ||||
| 	var newBrowserHost *url.URL | ||||
| 	if embedded { | ||||
| 		if authentikHost == "" { | ||||
|  | ||||
| @ -130,7 +130,12 @@ func (ps *ProxyServer) ServeHTTP() { | ||||
| 		return | ||||
| 	} | ||||
| 	proxyListener := &proxyproto.Listener{Listener: listener, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ps.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	ps.log.WithField("listen", listenAddress).Info("Starting HTTP server") | ||||
| 	ps.serve(proxyListener) | ||||
| @ -149,7 +154,12 @@ func (ps *ProxyServer) ServeHTTPS() { | ||||
| 		return | ||||
| 	} | ||||
| 	proxyListener := &proxyproto.Listener{Listener: web.TCPKeepAliveListener{TCPListener: ln.(*net.TCPListener)}, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ps.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	tlsListener := tls.NewListener(proxyListener, tlsConfig) | ||||
| 	ps.log.WithField("listen", listenAddress).Info("Starting HTTPS server") | ||||
|  | ||||
| @ -72,11 +72,13 @@ func (s *RedisStore) New(r *http.Request, name string) (*sessions.Session, error | ||||
| 	session.ID = c.Value | ||||
|  | ||||
| 	err = s.load(r.Context(), session) | ||||
| 	if err == nil { | ||||
| 		session.IsNew = false | ||||
| 	} else if err == redis.Nil { | ||||
| 		err = nil // no data stored | ||||
| 	if err != nil { | ||||
| 		if errors.Is(err, redis.Nil) { | ||||
| 			return session, nil | ||||
| 		} | ||||
| 		return session, err | ||||
| 	} | ||||
| 	session.IsNew = false | ||||
| 	return session, err | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -156,7 +156,12 @@ func (ws *WebServer) listenPlain() { | ||||
| 		return | ||||
| 	} | ||||
| 	proxyListener := &proxyproto.Listener{Listener: ln, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ws.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	ws.log.WithField("listen", config.Get().Listen.HTTP).Info("Starting HTTP server") | ||||
| 	ws.serve(proxyListener) | ||||
|  | ||||
| @ -46,7 +46,12 @@ func (ws *WebServer) listenTLS() { | ||||
| 		return | ||||
| 	} | ||||
| 	proxyListener := &proxyproto.Listener{Listener: web.TCPKeepAliveListener{TCPListener: ln.(*net.TCPListener)}, ConnPolicy: utils.GetProxyConnectionPolicy()} | ||||
| 	defer proxyListener.Close() | ||||
| 	defer func() { | ||||
| 		err := proxyListener.Close() | ||||
| 		if err != nil { | ||||
| 			ws.log.WithError(err).Warning("failed to close proxy listener") | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	tlsListener := tls.NewListener(proxyListener, tlsConfig) | ||||
| 	ws.log.WithField("listen", config.Get().Listen.HTTPS).Info("Starting HTTPS server") | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	![49699333+dependabot[bot]@users.noreply.github.com](/assets/img/avatar_default.png) dependabot[bot]
					dependabot[bot]