Skip to content

Commit

Permalink
🔄 Sync from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
mojo-machine[bot] committed Dec 12, 2023
1 parent ac21fc3 commit d37ee62
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 78 deletions.
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ require (
cloud.google.com/go v0.111.0
cloud.google.com/go/kms v1.15.5
cloud.google.com/go/secretmanager v1.11.4
github.com/blang/semver v3.5.1+incompatible
github.com/blang/semver/v4 v4.0.0
github.com/chebyrash/promise v0.0.0-20230709133807-42ec49ba1459
github.com/deckarep/golang-set/v2 v2.5.0
github.com/go-chi/chi/v5 v5.0.10
github.com/go-redis/redis v6.15.9+incompatible
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/google/go-cmp v0.6.0
github.com/jamescun/basex v0.0.0-20180407124237-e1bcb39ab18e
github.com/matryer/is v1.4.1
github.com/pkg/errors v0.9.1
github.com/redis/go-redis/v9 v9.3.0
github.com/sirupsen/logrus v1.9.3
github.com/xeipuuv/gojsonschema v1.2.0
go.mongodb.org/mongo-driver v1.13.1
Expand All @@ -24,7 +24,7 @@ require (
go.opentelemetry.io/otel/trace v1.21.0
golang.org/x/oauth2 v0.15.0
golang.org/x/sync v0.5.0
google.golang.org/api v0.153.0
google.golang.org/api v0.154.0
google.golang.org/grpc v1.60.0
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/ini.v1 v1.67.0
Expand All @@ -34,23 +34,22 @@ require (
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/panjf2000/ants/v2 v2.8.2 // indirect
github.com/panjf2000/ants/v2 v2.9.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
Expand All @@ -59,6 +58,7 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
Expand All @@ -69,8 +69,8 @@ require (
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
92 changes: 32 additions & 60 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"syscall"
"time"

"github.com/go-redis/redis"
"github.com/redis/go-redis/v9"
"github.com/wearemojo/mojo-public-go/lib/db/mongodb"
"github.com/wearemojo/mojo-public-go/lib/merr"
"go.mongodb.org/mongo-driver/mongo/options"
Expand Down Expand Up @@ -41,15 +41,15 @@ func (r Redis) Options() (*redis.Options, error) {
}

// Connect returns a connected redis.Client instance.
func (r Redis) Connect() (*redis.Client, error) {
func (r Redis) Connect(ctx context.Context) (*redis.Client, error) {
opts, err := r.Options()
if err != nil {
return nil, err
}

client := redis.NewClient(opts)

if err := client.Ping().Err(); err != nil {
if err := client.Ping(ctx).Err(); err != nil {
return client, err
}

Expand Down
2 changes: 1 addition & 1 deletion lib/config/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/go-redis/redis"
"github.com/matryer/is"
"github.com/redis/go-redis/v9"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/writeconcern"
)
Expand Down
4 changes: 4 additions & 0 deletions lib/googleiid/googleiid.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func (c *Client) ImportAPNSTokens(ctx context.Context, req *APNSRequest) (res *A
return res, c.client.Do(ctx, "POST", "iid/v1:batchImport", nil, req, &res)
}

// Deprecated: https://firebase.google.com/support/faq#fcm-depr-features
//
// supported equivalent: https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token
// or rip from: https://github.com/firebase/firebase-js-sdk/blob/master/packages/messaging/src/internals/requests.ts#L39
func (c *Client) ImportWebPushSubscription(ctx context.Context, req *WebPushRequest) (res *WebPushResponse, err error) {
// https://web.archive.org/web/20220407013020/https://developers.google.com/instance-id/reference/server#import_push_subscriptions
return res, c.client.Do(ctx, "POST", "v1/web/iid", nil, req, &res)
Expand Down
2 changes: 2 additions & 0 deletions lib/googleiid/roundtripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func (r roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
}

// https://web.archive.org/web/20221206045856/https://firebase.google.com/docs/cloud-messaging/auth-server#authorize-http-requests
// Deprecated: https://firebase.google.com/support/faq#fcm-depr-features
// switch to service account auth: https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually
req.Header.Set("Authorization", "key="+serverKey)

// https://developers.google.com/instance-id/reference/server#parameters_5
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/request/client_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"strconv"

"github.com/blang/semver"
"github.com/blang/semver/v4"
"github.com/wearemojo/mojo-public-go/lib/merr"
)

Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/request/client_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/blang/semver"
"github.com/blang/semver/v4"
"github.com/matryer/is"
)

Expand Down

0 comments on commit d37ee62

Please sign in to comment.