Skip to content

Commit

Permalink
deps: echox, go-github, gqlgen, oidc and update to breaking changes (#…
Browse files Browse the repository at this point in the history
…120)

* deps: upgrade echox and update for breaking change, precommit

Signed-off-by: Sarah Funkhouser <[email protected]>

* go mod tidy

Signed-off-by: Sarah Funkhouser <[email protected]>

* other upgrades

Signed-off-by: Sarah Funkhouser <[email protected]>

* update deprecated functions

Signed-off-by: Sarah Funkhouser <[email protected]>

---------

Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade authored Jan 6, 2025
1 parent 25bb074 commit eea45ec
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 59 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repos:
hooks:
- id: trailing-whitespace
- id: detect-private-key
exclude: tokens/testdata/
- repo: https://github.com/google/yamlfmt
rev: v0.14.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[files]
extend-exclude = ["db","internal/ent/generated/**","go.mod","go.sum","pkg/testutils/","pkg/passwd/","pkg/tokens/testdata/","pkg/tokens/expires_test.go","internal/graphapi/tools_test.go","internal/httpserve/handlers/tools_test.go","pkg/keygen/auth_test.go","pkg/utils/oas/","pkg/keygen/crypto_test.go","pkg/auth/auth_test.go"]
extend-exclude = ["tokens/testdata/**","go.mod","go.sum"]
ignore-hidden = true
ignore-files = true
ignore-dot = true
Expand Down
3 changes: 2 additions & 1 deletion auth/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

echo "github.com/theopenlane/echox"

"github.com/theopenlane/utils/contextx"
"github.com/theopenlane/utils/ulids"

"github.com/theopenlane/echox/middleware/echocontext"
Expand Down Expand Up @@ -87,7 +88,7 @@ func GetAuthenticatedUserContext(c context.Context) (*AuthenticatedUser, error)
func AddAuthenticatedUserContext(c echo.Context, user *AuthenticatedUser) context.Context {
c.Set(ContextAuthenticatedUser.name, user)

ctx := context.WithValue(c.Request().Context(), echocontext.EchoContextKey, c)
ctx := contextx.With(c.Request().Context(), c)

c.SetRequest(c.Request().WithContext(ctx))

Expand Down
7 changes: 4 additions & 3 deletions auth/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"

"github.com/theopenlane/echox/middleware/echocontext"
"github.com/theopenlane/utils/contextx"
"github.com/theopenlane/utils/ulids"

"github.com/theopenlane/iam/auth"
Expand All @@ -16,7 +17,7 @@ func TestGetSubjectIDFromContext(t *testing.T) {
// context with no user set
ec := echocontext.NewTestEchoContext()

basicContext := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
basicContext := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(basicContext))

Expand Down Expand Up @@ -75,7 +76,7 @@ func TestGetOrganizationIDFromContext(t *testing.T) {
// context with no user set
ec := echocontext.NewTestEchoContext()

basicContext := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
basicContext := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(basicContext))

Expand Down Expand Up @@ -136,7 +137,7 @@ func TestGetSubscriptionFromContext(t *testing.T) {

ec := echocontext.NewTestEchoContext()

basicContext := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
basicContext := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(basicContext))

Expand Down
7 changes: 4 additions & 3 deletions auth/test_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/golang-jwt/jwt/v5"
echo "github.com/theopenlane/echox"
"github.com/theopenlane/echox/middleware/echocontext"
"github.com/theopenlane/utils/contextx"
"github.com/theopenlane/utils/ulids"

"github.com/theopenlane/iam/tokens"
Expand Down Expand Up @@ -55,7 +56,7 @@ func NewTestContextWithValidUser(subject string) (context.Context, error) {
return nil, err
}

reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
reqCtx := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(reqCtx))

Expand Down Expand Up @@ -106,7 +107,7 @@ func NewTestContextWithOrgID(sub, orgID string) (context.Context, error) {
return nil, err
}

reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
reqCtx := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(reqCtx))

Expand Down Expand Up @@ -137,7 +138,7 @@ func NewTestContextWithSubscription(subscription bool) (context.Context, error)
return nil, err
}

reqCtx := context.WithValue(ec.Request().Context(), echocontext.EchoContextKey, ec)
reqCtx := contextx.With(ec.Request().Context(), ec)

ec.SetRequest(ec.Request().WithContext(reqCtx))

Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ go 1.23.3
require (
entgo.io/contrib v0.6.0
entgo.io/ent v0.14.1
github.com/99designs/gqlgen v0.17.61
github.com/99designs/gqlgen v0.17.62
github.com/Yamashou/gqlgenc v0.30.2
github.com/alicebob/miniredis/v2 v2.34.0
github.com/brianvoe/gofakeit/v7 v7.1.2
github.com/coreos/go-oidc/v3 v3.11.0
github.com/coreos/go-oidc/v3 v3.12.0
github.com/go-webauthn/webauthn v0.11.2
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-github/v67 v67.0.0
github.com/google/go-github/v68 v68.0.0
github.com/gorilla/securecookie v1.1.2
github.com/lestrrat-go/jwx/v2 v2.1.3
github.com/oklog/ulid/v2 v2.1.0
Expand All @@ -28,11 +28,11 @@ require (
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.34.0
github.com/testcontainers/testcontainers-go/modules/openfga v0.34.0
github.com/theopenlane/echox v0.2.0
github.com/theopenlane/echox v0.2.1
github.com/theopenlane/utils v0.4.2
github.com/vmihailenco/msgpack/v5 v5.4.1
golang.org/x/oauth2 v0.25.0
golang.org/x/tools v0.28.0
golang.org/x/tools v0.29.0
google.golang.org/api v0.214.0
google.golang.org/protobuf v1.36.1
)
Expand Down Expand Up @@ -154,7 +154,7 @@ require (
github.com/urfave/cli/v2 v2.27.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vektah/gqlparser/v2 v2.5.20 // indirect
github.com/vektah/gqlparser/v2 v2.5.21 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
Expand All @@ -169,12 +169,12 @@ require (
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
gonum.org/v1/gonum v0.15.1 // indirect
Expand Down
40 changes: 20 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ entgo.io/contrib v0.6.0 h1:xfo4TbJE7sJZWx7BV7YrpSz7IPFvS8MzL3fnfzZjKvQ=
entgo.io/contrib v0.6.0/go.mod h1:3qWIseJ/9Wx2Hu5zVh15FDzv7d/UvKNcYKdViywWCQg=
entgo.io/ent v0.14.1 h1:fUERL506Pqr92EPHJqr8EYxbPioflJo6PudkrEA8a/s=
entgo.io/ent v0.14.1/go.mod h1:MH6XLG0KXpkcDQhKiHfANZSzR55TJyPL5IGNpI8wpco=
github.com/99designs/gqlgen v0.17.61 h1:vE7xLRC066n9wehgjeplILOWtwz75zbzcV2/Iv9i3pw=
github.com/99designs/gqlgen v0.17.61/go.mod h1:rFU1T3lhv/tPeAlww/DJ4ol2YxT/pPpue+xxPbkd3r4=
github.com/99designs/gqlgen v0.17.62 h1:Wovt1+XJN9dTWYh92537Y9a5FuMVSkrQL4bn0a8v5Rg=
github.com/99designs/gqlgen v0.17.62/go.mod h1:sVCM2iwIZisJjTI/DEC3fpH+HFgxY1496ZJ+jbT9IjA=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
Expand Down Expand Up @@ -69,8 +69,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI=
github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
github.com/coreos/go-oidc/v3 v3.12.0 h1:sJk+8G2qq94rDI6ehZ71Bol3oUHy63qNYmkiSjrc/Jo=
github.com/coreos/go-oidc/v3 v3.12.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
Expand Down Expand Up @@ -143,8 +143,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg=
github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY=
github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s=
github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM=
Expand Down Expand Up @@ -342,8 +342,8 @@ github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybu
github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ=
github.com/testcontainers/testcontainers-go/modules/openfga v0.34.0 h1:Y5ZFzu6eANOViDjXFxAdyu+68LMQdok9GUdQJiwVjp0=
github.com/testcontainers/testcontainers-go/modules/openfga v0.34.0/go.mod h1:0IWpmPSJOXpAUCHLgbhiE1fTOR69XJ/rnbdiQfkwLfc=
github.com/theopenlane/echox v0.2.0 h1:s9DJJrsLOSPsXVfgmQxgXmSVtxzztBnSmcVX4ax7tIM=
github.com/theopenlane/echox v0.2.0/go.mod h1:nfxwQpwvqYYI/pFHJKDs3/HLvjYKEGCih4XDgLSma64=
github.com/theopenlane/echox v0.2.1 h1:ZhVkimmWxpKITf67oM57SrLWeIdnV8+dNXlC+VzlRaQ=
github.com/theopenlane/echox v0.2.1/go.mod h1:4j/Hx0uoLk5gVzdA83Qqz7xBEmqpoEP+OnzVaw2p6/o=
github.com/theopenlane/utils v0.4.2 h1:f72oSi3lQj05QRZKiqqSSqy4RY4Wgy1qIRv3RGjftVE=
github.com/theopenlane/utils v0.4.2/go.mod h1:rGGqAI6hxDZVAUB+kmp7HOzD9RmHnsH6K/nr9QQgsTs=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
Expand All @@ -356,8 +356,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vektah/gqlparser/v2 v2.5.20 h1:kPaWbhBntxoZPaNdBaIPT1Kh0i1b/onb5kXgEdP5JCo=
github.com/vektah/gqlparser/v2 v2.5.20/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM=
github.com/vektah/gqlparser/v2 v2.5.21 h1:Zw1rG2dr1pRR4wqwbVq4d6+xk2f4ut/yo+hwr4QjE08=
github.com/vektah/gqlparser/v2 v2.5.21/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
Expand Down Expand Up @@ -411,8 +411,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand All @@ -423,8 +423,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -445,10 +445,10 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
Expand All @@ -459,8 +459,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
14 changes: 7 additions & 7 deletions providers/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"net/url"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
)

// ClientConfig holds the configuration for the GitHub client
Expand Down Expand Up @@ -100,8 +100,8 @@ func (u *UsersMock) Get(context.Context, string) (*github.User, *github.Response
resp := &http.Response{StatusCode: http.StatusOK}

return &github.User{
Login: github.String("antman"),
ID: github.Int64(1),
Login: github.Ptr("antman"),
ID: github.Ptr(int64(1)),
}, &github.Response{Response: resp}, nil
}

Expand All @@ -111,12 +111,12 @@ func (u *UsersMock) ListEmails(ctx context.Context, opts *github.ListOptions) ([

return []*github.UserEmail{
{
Email: github.String("[email protected]"),
Primary: github.Bool(true),
Email: github.Ptr("[email protected]"),
Primary: github.Ptr(true),
},
{
Email: github.String("[email protected]"),
Primary: github.Bool(false),
Email: github.Ptr("[email protected]"),
Primary: github.Ptr(false),
},
}, &github.Response{Response: resp}, nil
}
2 changes: 1 addition & 1 deletion providers/github/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package github
import (
"context"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
)

// unexported key type prevents collisions
Expand Down
6 changes: 3 additions & 3 deletions providers/github/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"context"
"testing"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"github.com/stretchr/testify/assert"
)

func TestContextUser(t *testing.T) {
expectedUser := &github.User{
ID: github.Int64(917408),
Name: github.String("Meow Meowingtonr"),
ID: github.Ptr(int64(917408)),
Name: github.Ptr("Meow Meowingtonr"),
}
ctx := WithUser(context.Background(), expectedUser)
user, err := UserFromContext(ctx)
Expand Down
2 changes: 1 addition & 1 deletion providers/github/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"net/url"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"golang.org/x/oauth2"

oauth2Login "github.com/theopenlane/iam/providers/oauth2"
Expand Down
16 changes: 8 additions & 8 deletions providers/github/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

oauth2Login "github.com/theopenlane/iam/providers/oauth2"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"github.com/stretchr/testify/assert"
"golang.org/x/oauth2"
)
Expand All @@ -27,9 +27,9 @@ func TestGithubHandler(t *testing.T) {
emailJSONData := `[{"primary": true, "email": "[email protected]"}, {"primary": false, "email": "[email protected]"}]`

expectedUser := &github.User{
ID: github.Int64(917408),
Name: github.String("Sarah Funkytown"),
Email: github.String("[email protected]"),
ID: github.Ptr(int64(917408)),
Name: github.Ptr("Sarah Funkytown"),
Email: github.Ptr("[email protected]"),
}

proxyClient, server := newGithubTestServer("", jsonData, emailJSONData)
Expand Down Expand Up @@ -122,9 +122,9 @@ func TestGithubEnterprise(t *testing.T) {
jsonData := `{"id": 917408, "name": "Sarah Funkytown"}`
emailJSONData := `[{"primary": true, "email": "[email protected]"}, {"primary": false, "email": "[email protected]"}]`
expectedUser := &github.User{
ID: github.Int64(917408),
Name: github.String("Sarah Funkytown"),
Email: github.String("[email protected]"),
ID: github.Ptr(int64(917408)),
Name: github.Ptr("Sarah Funkytown"),
Email: github.Ptr("[email protected]"),
}

proxyClient, server := newGithubTestServer("/api/v3", jsonData, emailJSONData)
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestGithubEnterprise(t *testing.T) {
}

func TestValidateResponse(t *testing.T) {
validUser := &github.User{ID: github.Int64(123)}
validUser := &github.User{ID: github.Ptr(int64(123))}
validResponse := &github.Response{Response: &http.Response{StatusCode: 200}}
invalidResponse := &github.Response{Response: &http.Response{StatusCode: 500}}

Expand Down
2 changes: 1 addition & 1 deletion sessions/redisstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type PersistentStore interface {

var _ PersistentStore = &persistentStore{}

// persistentStore stores Sessions in a persisent data store (redis)
// persistentStore stores Sessions in a persistent data store (redis)
type persistentStore struct {
client *redis.Client
mu sync.Mutex
Expand Down
2 changes: 1 addition & 1 deletion totp/testing/templates/totp.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3>Generated Key:</h3>
<h2>Secret Key</h2>
<p>{{ .key }}</p>
<h2>QR Code</h2>
<img src="data:image/png;base64,{{ .qr }}" alt="QR code" id="imge">
<img src="data:image/png;base64,{{ .qr }}" alt="QR code" id="image">
</div>
<h2>TOTP</h2>
<p id="otp-input">{{ .generateTOTP }}</p>
Expand Down

0 comments on commit eea45ec

Please sign in to comment.