chore(deps): update golangci/golangci-lint docker tag to v1.56.2 (#2099)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2099 Co-authored-by: renovate <renovatebot@kolaente.de> Co-committed-by: renovate <renovatebot@kolaente.de>
This commit is contained in:
@ -48,7 +48,7 @@ func SetupTokenMiddleware() echo.MiddlewareFunc {
|
||||
|
||||
return false
|
||||
},
|
||||
ErrorHandler: func(c echo.Context, err error) error {
|
||||
ErrorHandler: func(_ echo.Context, err error) error {
|
||||
if err != nil {
|
||||
return echo.NewHTTPError(http.StatusUnauthorized, "missing, malformed, expired or otherwise invalid token provided").SetInternal(err)
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ func setupMetrics(a *echo.Group) {
|
||||
r := a.Group("/metrics")
|
||||
|
||||
if config.MetricsUsername.GetString() != "" && config.MetricsPassword.GetString() != "" {
|
||||
r.Use(middleware.BasicAuth(func(username, password string, c echo.Context) (bool, error) {
|
||||
r.Use(middleware.BasicAuth(func(username, password string, _ echo.Context) (bool, error) {
|
||||
if subtle.ConstantTimeCompare([]byte(username), []byte(config.MetricsUsername.GetString())) == 1 &&
|
||||
subtle.ConstantTimeCompare([]byte(password), []byte(config.MetricsPassword.GetString())) == 1 {
|
||||
return true, nil
|
||||
|
@ -203,7 +203,7 @@ func RegisterRoutes(e *echo.Echo) {
|
||||
|
||||
// API Routes
|
||||
a := e.Group("/api/v1")
|
||||
e.OnAddRouteHandler = func(host string, route echo.Route, handler echo.HandlerFunc, middleware []echo.MiddlewareFunc) {
|
||||
e.OnAddRouteHandler = func(_ string, route echo.Route, _ echo.HandlerFunc, _ []echo.MiddlewareFunc) {
|
||||
models.CollectRoutesForAPITokenUsage(route)
|
||||
}
|
||||
registerAPIRoutes(a)
|
||||
|
Reference in New Issue
Block a user