fix(deps): update module github.com/labstack/echo/v4 to v5 (#2131)

Closes https://github.com/go-vikunja/vikunja/pull/2133

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: kolaente <k@knt.li>
This commit is contained in:
renovate[bot]
2026-01-24 20:38:32 +01:00
committed by GitHub
parent 83474b76d3
commit 9a61453e86
63 changed files with 667 additions and 617 deletions

View File

@@ -26,11 +26,11 @@ import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/auth"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
// CreateWeb is the handler to create an object
func (c *WebHandler) CreateWeb(ctx echo.Context) error {
func (c *WebHandler) CreateWeb(ctx *echo.Context) error {
// Get our model
currentStruct := c.EmptyStruct()
@@ -52,7 +52,7 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
// Get the user to pass for later checks
currentAuth, err := auth.GetAuthFromClaims(ctx)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").SetInternal(err)
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").Wrap(err)
}
// Create the db session
@@ -73,7 +73,7 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
if !canCreate {
_ = s.Rollback()
log.Warningf("Tried to create while not having the permissions for it (User: %v)", currentAuth)
return echo.NewHTTPError(http.StatusForbidden)
return echo.NewHTTPError(http.StatusForbidden, "Forbidden")
}
// Create

View File

@@ -26,7 +26,7 @@ import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/auth"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
type message struct {
@@ -34,7 +34,7 @@ type message struct {
}
// DeleteWeb is the web handler to delete something
func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
func (c *WebHandler) DeleteWeb(ctx *echo.Context) error {
// Get our model
currentStruct := c.EmptyStruct()
@@ -52,7 +52,7 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
// Check if the user has the permission to delete
currentAuth, err := auth.GetAuthFromClaims(ctx)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").Wrap(err)
}
// Create the db session
@@ -72,7 +72,7 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
if !canDelete {
_ = s.Rollback()
log.Warningf("Tried to delete while not having the permissions for it (User: %v)", currentAuth)
return echo.NewHTTPError(http.StatusForbidden)
return echo.NewHTTPError(http.StatusForbidden, "Forbidden")
}
err = currentStruct.Delete(s, currentAuth)

View File

@@ -30,17 +30,17 @@ import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/auth"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
// ReadAllWeb is the webhandler to get all objects of a type
func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
func (c *WebHandler) ReadAllWeb(ctx *echo.Context) error {
// Get our model
currentStruct := c.EmptyStruct()
currentAuth, err := auth.GetAuthFromClaims(ctx)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").SetInternal(err)
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").Wrap(err)
}
// Get the object & bind params to struct
@@ -61,7 +61,7 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
pageNumber, err := strconv.Atoi(page)
if err != nil {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusBadRequest, "Bad page requested.").SetInternal(err)
return echo.NewHTTPError(http.StatusBadRequest, "Bad page requested.").Wrap(err)
}
if pageNumber < 0 {
return echo.NewHTTPError(http.StatusBadRequest, "Page number cannot be negative.")
@@ -76,7 +76,7 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
perPageNumber, err = strconv.Atoi(perPage)
if err != nil {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusBadRequest, "Bad per page amount requested.").SetInternal(err)
return echo.NewHTTPError(http.StatusBadRequest, "Bad per page amount requested.").Wrap(err)
}
}
// Set default page count

View File

@@ -27,11 +27,11 @@ import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/auth"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
// ReadOneWeb is the webhandler to get one object
func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
func (c *WebHandler) ReadOneWeb(ctx *echo.Context) error {
// Get our model
currentStruct := c.EmptyStruct()
@@ -48,7 +48,7 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
// Check permissions
currentAuth, err := auth.GetAuthFromClaims(ctx)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").SetInternal(err)
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").Wrap(err)
}
// Create the db session

View File

@@ -26,11 +26,11 @@ import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/modules/auth"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
// UpdateWeb is the webhandler to update an object
func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
func (c *WebHandler) UpdateWeb(ctx *echo.Context) error {
// Get our model
currentStruct := c.EmptyStruct()
@@ -53,7 +53,7 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
// Check if the user has the permission to do that
currentAuth, err := auth.GetAuthFromClaims(ctx)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").SetInternal(err)
return echo.NewHTTPError(http.StatusInternalServerError, "Could not determine the current user.").Wrap(err)
}
// Create the db session
@@ -73,7 +73,7 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
if !canUpdate {
_ = s.Rollback()
log.Warningf("Tried to update while not having the permissions for it (User: %v)", currentAuth)
return echo.NewHTTPError(http.StatusForbidden)
return echo.NewHTTPError(http.StatusForbidden, "Forbidden")
}
// Do the update

View File

@@ -17,7 +17,7 @@
package web
import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
"xorm.io/xorm"
)