Skip to content

Commit

Permalink
chore: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
noxecane committed Nov 18, 2023
1 parent 32fcdc3 commit 481d9d0
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 1,474 deletions.
6 changes: 3 additions & 3 deletions ajax/ajax.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ajax

import (
"context"
"errors"
"fmt"
"io"
"net/http"
Expand All @@ -10,7 +11,6 @@ import (
"github.com/noxecane/anansi/api"
"github.com/noxecane/anansi/json"
"github.com/noxecane/anansi/jwt"
"github.com/pkg/errors"
)

var (
Expand Down Expand Up @@ -97,7 +97,7 @@ func (c *Client) NewHeadlessRequest(r *http.Request, method, url string, session

token, err := jwt.Encode(c.serviceSecret, c.headlessDuration, session)
if err != nil {
return nil, errors.Wrap(err, "could not create headless token")
return nil, errors.Join(err, errors.New("could not create headless token"))
}

req, err := http.NewRequestWithContext(r.Context(), method, url, body)
Expand All @@ -119,7 +119,7 @@ func (c *Client) NewBaseRequest(ctx context.Context, method, url string, session

token, err := jwt.Encode(c.serviceSecret, c.headlessDuration, session)
if err != nil {
return nil, errors.Wrap(err, "could not create headless token")
return nil, errors.Join(err, errors.New("could not create headless token"))
}

req, err := http.NewRequestWithContext(ctx, method, url, body)
Expand Down
2 changes: 1 addition & 1 deletion api/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"
"time"

"github.com/go-redis/redis/v8"
"github.com/noxecane/anansi/sessions"
"github.com/noxecane/anansi/tokens"
"github.com/redis/go-redis/v9"
)

var store *sessions.Store
Expand Down
50 changes: 23 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
module github.com/noxecane/anansi

go 1.17
go 1.21

require (
github.com/go-chi/chi v1.5.4
github.com/go-chi/chi v1.5.5
github.com/go-jose/go-jose/v3 v3.0.1
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/go-pg/pg/v10 v10.10.6
github.com/go-playground/mold/v3 v3.1.1
github.com/go-redis/redis/v8 v8.11.4
github.com/golang-migrate/migrate/v4 v4.15.1
github.com/joho/godotenv v1.4.0
github.com/go-playground/mold/v4 v4.5.0
github.com/golang-migrate/migrate/v4 v4.16.2
github.com/joho/godotenv v1.5.1
github.com/json-iterator/go v1.1.12
github.com/kelseyhightower/envconfig v1.4.0
github.com/mitchellh/mapstructure v1.4.3
github.com/pkg/errors v0.9.1
github.com/mitchellh/mapstructure v1.5.0
github.com/prometheus/client_golang v1.11.0
github.com/redis/go-redis/v9 v9.3.0
github.com/rs/cors v1.8.0
github.com/rs/zerolog v1.26.0
github.com/rs/zerolog v1.31.0
github.com/segmentio/ksuid v1.0.4
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
gopkg.in/square/go-jose.v2 v2.6.0
golang.org/x/crypto v0.15.0
syreclabs.com/go/faker v1.2.3
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-pg/zerochecker v0.2.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/lib/pq v1.10.0 // indirect
github.com/gosimple/slug v1.13.1 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/lib/pq v1.10.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/segmentio/go-camelcase v0.0.0-20160726192923-7085f1e3c734 // indirect
github.com/segmentio/go-snakecase v1.2.0 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/vmihailenco/bufpool v0.1.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.uber.org/atomic v1.6.0 // indirect
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c // indirect
google.golang.org/protobuf v1.27.1 // indirect
mellium.im/sasl v0.2.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
1,500 changes: 85 additions & 1,415 deletions go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions jwt/jwt.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package jwt

import (
"errors"
"time"

"github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v3/jwt"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2/jwt"
)

var (
Expand Down Expand Up @@ -75,7 +75,7 @@ func Decode(secret []byte, token string, v interface{}) error {
config := &mapstructure.DecoderConfig{Result: v, TagName: `json`}
decoder, err := mapstructure.NewDecoder(config)
if err != nil {
return errors.Wrap(err, "could not convert claims to struct")
return errors.Join(err, errors.New("could not convert claims to struct"))
}

return decoder.Decode(claims.CustomClaims)
Expand Down
19 changes: 0 additions & 19 deletions postgres/connect.go

This file was deleted.

4 changes: 2 additions & 2 deletions requests/body.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/go-chi/chi"
ozzo "github.com/go-ozzo/ozzo-validation/v4"
"github.com/go-playground/mold/v3"
"github.com/go-playground/mold/v3/modifiers"
"github.com/go-playground/mold/v4"
"github.com/go-playground/mold/v4/modifiers"
"github.com/noxecane/anansi/json"
)

Expand Down
2 changes: 1 addition & 1 deletion sessions/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

"github.com/go-redis/redis/v8"
"github.com/noxecane/anansi/jwt"
"github.com/noxecane/anansi/tokens"
"github.com/redis/go-redis/v9"
)

var sharedTestStore tokens.Store
Expand Down
2 changes: 1 addition & 1 deletion tokens/redis_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"errors"
"time"

"github.com/go-redis/redis/v8"
"github.com/noxecane/anansi/json"
"github.com/redis/go-redis/v9"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion tokens/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/go-redis/redis/v8"
"github.com/redis/go-redis/v9"
"syreclabs.com/go/faker"
)

Expand Down

0 comments on commit 481d9d0

Please sign in to comment.