Skip to content

Commit

Permalink
chore(auth): switch to github.com/gofrs/uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
karstenkoehler authored and bastianccm committed Mar 17, 2022
1 parent a741f30 commit 1854abc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/auth/oauth/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"flamingo.me/flamingo/v3/framework/flamingo"
"flamingo.me/flamingo/v3/framework/web"
"github.com/coreos/go-oidc/v3/oidc"
uuid "github.com/satori/go.uuid"
"github.com/gofrs/uuid"
"golang.org/x/oauth2"
)

Expand Down Expand Up @@ -357,7 +357,7 @@ func (i *openIDIdentifier) createSessionCode(request *web.Request, code string)

// Authenticate a user
func (i *openIDIdentifier) Authenticate(ctx context.Context, request *web.Request) web.Result {
state := uuid.NewV4().String()
state := uuid.Must(uuid.NewV4()).String()
i.createSessionCode(request, state)
options := make([]oauth2.AuthCodeOption, 0, len(i.authcodeOptions))
for _, o := range i.authcodeOptions {
Expand Down
4 changes: 2 additions & 2 deletions core/oauth/interfaces/login_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"flamingo.me/flamingo/v3/core/oauth/application"
"flamingo.me/flamingo/v3/framework/web"
uuid "github.com/satori/go.uuid"
"github.com/gofrs/uuid"
"golang.org/x/oauth2"
)

Expand Down Expand Up @@ -56,7 +56,7 @@ func (l *LoginController) Get(c context.Context, request *web.Request) web.Resul
redirecturl = absolute.String()
}

state := uuid.NewV4().String()
state := uuid.Must(uuid.NewV4()).String()
l.authManager.StoreAuthState(request.Session(), state)
request.Session().Store("auth.redirect", redirecturl)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/coreos/go-oidc/v3 v3.1.0
github.com/ghodss/yaml v1.0.0
github.com/go-redis/redis/v8 v8.11.4
github.com/gofrs/uuid v4.2.0+incompatible
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/google/go-cmp v0.5.6
Expand All @@ -31,7 +32,6 @@ require (
github.com/prometheus/client_golang v1.4.1 // indirect
github.com/prometheus/procfs v0.0.10 // indirect
github.com/rbcervilla/redisstore/v8 v8.1.0
github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/objx v0.2.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -368,8 +370,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/testscript v1.1.0/go.mod h1:lzMlnW8LS56mcdJoQYkrlzqOoTFCOemzt5LusJ93bDM=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
Expand Down

0 comments on commit 1854abc

Please sign in to comment.