Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/sessions v1.4.0
github.com/labstack/echo-contrib v0.50.1
github.com/labstack/echo/v4 v4.15.2
github.com/labstack/echo/v5 v5.1.1
github.com/mitchellh/mapstructure v1.5.0
github.com/rs/zerolog v1.35.1
github.com/spf13/cobra v1.10.2
Expand All @@ -23,6 +23,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gorilla/context v1.1.2 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/labstack/echo/v4 v4.15.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sagikazarmark/locafero v0.11.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labstack/echo-contrib v0.50.1 h1:W9cZZ9viA4TDdFtm8cuA+XGFwOcnfbjJpl7VgfsRLHE=
github.com/labstack/echo-contrib v0.50.1/go.mod h1:8r/++U/Fw/QniApFnzunLanKaviPfBX7fX7/2QX0qOk=
github.com/labstack/echo/v4 v4.15.2 h1:nnh2sCzGCVYnU+wCisMPiYapEg/QVo/gcI9ePKg5/T4=
github.com/labstack/echo/v4 v4.15.2/go.mod h1:Xzp1Ns1RA2c9fY7nSgUJkpkUZGNbEIVHZbtbOMPktBI=
github.com/labstack/echo/v4 v4.15.0 h1:hoRTKWcnR5STXZFe9BmYun9AMTNeSbjHi2vtDuADJ24=
github.com/labstack/echo/v4 v4.15.0/go.mod h1:xmw1clThob0BSVRX1CRQkGQ/vjwcpOMjQZSZa9fKA/c=
github.com/labstack/echo/v5 v5.1.1 h1:4QkvKoS8ps5ch49t8b72QS9Z581ytgxhTzxuB/CBA2I=
github.com/labstack/echo/v5 v5.1.1/go.mod h1:SyvlSdObGjRXeQfCCXW/sybkZdOOQZBmpKF0bvALaeo=
github.com/labstack/gommon v0.5.0 h1:6VSQ2NOzsnEJ5W6+84E0RbcaDDmgB6NIAzWCczTEe6c=
github.com/labstack/gommon v0.5.0/go.mod h1:Rzlg7HHy1maLfzBYGg9NZcVuz1sA68HHhLjhcEllYE0=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
Expand Down
4 changes: 2 additions & 2 deletions pkg/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"github.com/google/uuid"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
"github.com/neticdk/go-token-handler/pkg/pkce"
"github.com/rs/zerolog"
"golang.org/x/oauth2"
Expand All @@ -36,11 +36,11 @@
AllowCredentials: true,
}))

g.OPTIONS("", func(c echo.Context) error { _ = c.NoContent(http.StatusNoContent); return nil })

Check failure on line 39 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use func(c echo.Context) error {…} (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in argument to g.OPTIONS
g.GET("", a.listAuth)

Check failure on line 40 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use a.listAuth (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in argument to g.GET
g.POST("", a.createAuth)

Check failure on line 41 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use a.createAuth (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in argument to g.POST
g.PUT("/:state", a.updateAuth)

Check failure on line 42 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use a.updateAuth (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in argument to g.PUT
g.DELETE("/:state", a.delete)

Check failure on line 43 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use a.delete (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in argument to g.DELETE

return a.AuthMiddleware()
}
Expand All @@ -65,8 +65,8 @@

func (a *auth) AuthMiddleware() echo.MiddlewareFunc {
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {

Check failure on line 68 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use func(c echo.Context) error {…} (value of type func(c "github.com/labstack/echo/v5".Context) error) as "github.com/labstack/echo/v5".HandlerFunc value in return statement
s, err := session.Get(CookieTokenName, c)

Check failure on line 69 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use c (variable of struct type "github.com/labstack/echo/v5".Context) as "github.com/labstack/echo/v4".Context value in argument to session.Get: "github.com/labstack/echo/v5".Context does not implement "github.com/labstack/echo/v4".Context (method Attachment has pointer receiver)
if err != nil {
_ = c.NoContent(http.StatusUnauthorized)
return fmt.Errorf("unable to get session: %w", err)
Expand Down Expand Up @@ -97,7 +97,7 @@
}
t.SetAuthHeader(c.Request())

return next(c)

Check failure on line 100 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use c (variable of struct type "github.com/labstack/echo/v5".Context) as *"github.com/labstack/echo/v5".Context value in argument to next
}
}
}
Expand Down Expand Up @@ -126,7 +126,7 @@
}

state := uuid.New().String()
s, err := session.Get(state, c)

Check failure on line 129 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use c (variable of struct type "github.com/labstack/echo/v5".Context) as "github.com/labstack/echo/v4".Context value in argument to session.Get: "github.com/labstack/echo/v5".Context does not implement "github.com/labstack/echo/v4".Context (method Attachment has pointer receiver)
if err != nil {
return err
}
Expand Down Expand Up @@ -166,7 +166,7 @@
}

state := c.Param("state")
s, err := session.Get(state, c)

Check failure on line 169 in pkg/auth/auth.go

View workflow job for this annotation

GitHub Actions / build

cannot use c (variable of struct type "github.com/labstack/echo/v5".Context) as "github.com/labstack/echo/v4".Context value in argument to session.Get: "github.com/labstack/echo/v5".Context does not implement "github.com/labstack/echo/v4".Context (method Attachment has pointer receiver)
if err != nil {
return fmt.Errorf("unable to retrieve authentication session %s: %w", state, err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/google/uuid"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
"github.com/neticdk/go-token-handler/pkg/pkce"
"github.com/stretchr/testify/assert"
"golang.org/x/oauth2"
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/coreos/go-oidc/v3/oidc"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
"github.com/mitchellh/mapstructure"
"github.com/neticdk/go-token-handler/pkg/auth"
"github.com/rs/zerolog"
Expand Down
Loading