Loading go.mod +30 −30 Original line number Diff line number Diff line Loading @@ -3,34 +3,34 @@ module github.com/heroiclabs/nakama/v3 go 1.18 require ( github.com/blugelabs/bluge v0.1.9 github.com/blugelabs/bluge v0.2.2 github.com/blugelabs/bluge_segment_api v0.2.0 github.com/blugelabs/query_string v0.3.0 github.com/dop251/goja v0.0.0-20220806120448-1444e6b94559 github.com/gofrs/uuid v4.0.0+incompatible github.com/golang-jwt/jwt/v4 v4.1.0 github.com/dop251/goja v0.0.0-20221003171542-5ea1285e6c91 github.com/gofrs/uuid v4.3.0+incompatible github.com/golang-jwt/jwt/v4 v4.4.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 github.com/heroiclabs/nakama-common v1.24.1-0.20221012104822-a3054a3e1c6b github.com/jackc/pgconn v1.10.0 github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451 github.com/jackc/pgtype v1.8.1 github.com/jackc/pgx/v4 v4.13.0 github.com/rubenv/sql-migrate v1.1.1 github.com/stretchr/testify v1.7.0 github.com/uber-go/tally/v4 v4.1.1 go.uber.org/atomic v1.9.0 go.uber.org/zap v1.19.1 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 google.golang.org/grpc v1.42.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 google.golang.org/protobuf v1.27.1 github.com/gorilla/websocket v1.5.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 github.com/heroiclabs/nakama-common v1.24.1-0.20221012144644-6310f72d5e4d github.com/jackc/pgconn v1.13.0 github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa github.com/jackc/pgtype v1.12.0 github.com/jackc/pgx/v4 v4.17.2 github.com/rubenv/sql-migrate v1.2.0 github.com/stretchr/testify v1.8.0 github.com/uber-go/tally/v4 v4.1.3 go.uber.org/atomic v1.10.0 go.uber.org/zap v1.23.0 golang.org/x/crypto v0.0.0-20221012134737-56aed061732a golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc google.golang.org/grpc v1.50.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf v1.28.1 gopkg.in/natefinch/lumberjack.v2 v2.0.0-20190411184413-94d9e492cc53 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( Loading @@ -39,18 +39,18 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.2.0 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect github.com/blevesearch/mmap-go v1.0.3 // indirect github.com/blevesearch/mmap-go v1.0.4 // indirect github.com/blevesearch/segment v0.9.0 // indirect github.com/blevesearch/snowballstem v0.9.0 // indirect github.com/blevesearch/vellum v1.0.7 // indirect github.com/blugelabs/ice v0.2.0 // indirect github.com/blugelabs/ice v1.0.0 // indirect github.com/blugelabs/ice/v2 v2.0.1 // indirect github.com/caio/go-tdigest v3.1.0+incompatible // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-gorp/gorp/v3 v3.0.2 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/golang/glog v1.0.0 // indirect Loading @@ -59,8 +59,9 @@ require ( github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.1.1 // indirect github.com/jackc/pgproto3/v2 v2.3.1 // indirect github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect github.com/klauspost/compress v1.15.2 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect Loading @@ -71,8 +72,7 @@ require ( github.com/prometheus/procfs v0.6.0 // indirect github.com/twmb/murmur3 v1.1.6 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) go.sum +75 −70 File changed.Preview size limit exceeded, changes collapsed. Show changes server/api.go +2 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" _ "google.golang.org/grpc/encoding/gzip" // enable gzip compression on server for grpc "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" Loading Loading @@ -195,7 +196,7 @@ func StartApiServer(logger *zap.Logger, startupLogger *zap.Logger, db *sql.DB, p cert := credentials.NewTLS(&tls.Config{RootCAs: certPool, InsecureSkipVerify: true}) dialOpts = append(dialOpts, grpc.WithTransportCredentials(cert)) } else { dialOpts = append(dialOpts, grpc.WithInsecure()) dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) } if err := apigrpc.RegisterNakamaHandlerFromEndpoint(ctx, grpcGateway, dialAddr, dialOpts); err != nil { startupLogger.Fatal("API server gateway registration failed", zap.Error(err)) Loading server/api_rpc.go +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package server import ( "context" "encoding/json" "io/ioutil" "io" "net/http" "strings" "time" Loading Loading @@ -132,7 +132,7 @@ func (s *ApiServer) RpcFuncHttp(w http.ResponseWriter, r *http.Request) { // Prepare input to function. var payload string if r.Method == "POST" { b, err := ioutil.ReadAll(r.Body) b, err := io.ReadAll(r.Body) if err != nil { // Request body too large. if err.Error() == "http: request body too large" { Loading server/api_test.go +4 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/encoding/protojson" ) Loading Loading @@ -173,7 +174,7 @@ func NewAPIServer(t *testing.T, runtime *Runtime) (*ApiServer, *Pipeline) { router := &DummyMessageRouter{} tracker := &LocalTracker{} pipeline := NewPipeline(logger, cfg, db, protojsonMarshaler, protojsonUnmarshaler, nil, nil, nil, nil, nil, tracker, router, runtime) apiServer := StartApiServer(logger, logger, db, protojsonMarshaler, protojsonUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, nil, metrics, pipeline, runtime) apiServer := StartApiServer(logger, logger, db, protojsonMarshaler, protojsonUnmarshaler, cfg, "3.0.0", nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, nil, metrics, pipeline, runtime) return apiServer, pipeline } Loading @@ -182,7 +183,7 @@ func NewSession(t *testing.T, customID string) (*grpc.ClientConn, apigrpc.Nakama outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{ "authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte("defaultkey:")), })) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithInsecure()) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal(err) } Loading @@ -209,7 +210,7 @@ func NewAuthenticatedAPIClient(t *testing.T, customID string) (*grpc.ClientConn, outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{ "authorization": "Bearer " + session.Token, })) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithInsecure()) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal(err) } Loading Loading
go.mod +30 −30 Original line number Diff line number Diff line Loading @@ -3,34 +3,34 @@ module github.com/heroiclabs/nakama/v3 go 1.18 require ( github.com/blugelabs/bluge v0.1.9 github.com/blugelabs/bluge v0.2.2 github.com/blugelabs/bluge_segment_api v0.2.0 github.com/blugelabs/query_string v0.3.0 github.com/dop251/goja v0.0.0-20220806120448-1444e6b94559 github.com/gofrs/uuid v4.0.0+incompatible github.com/golang-jwt/jwt/v4 v4.1.0 github.com/dop251/goja v0.0.0-20221003171542-5ea1285e6c91 github.com/gofrs/uuid v4.3.0+incompatible github.com/golang-jwt/jwt/v4 v4.4.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 github.com/heroiclabs/nakama-common v1.24.1-0.20221012104822-a3054a3e1c6b github.com/jackc/pgconn v1.10.0 github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451 github.com/jackc/pgtype v1.8.1 github.com/jackc/pgx/v4 v4.13.0 github.com/rubenv/sql-migrate v1.1.1 github.com/stretchr/testify v1.7.0 github.com/uber-go/tally/v4 v4.1.1 go.uber.org/atomic v1.9.0 go.uber.org/zap v1.19.1 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 google.golang.org/grpc v1.42.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 google.golang.org/protobuf v1.27.1 github.com/gorilla/websocket v1.5.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 github.com/heroiclabs/nakama-common v1.24.1-0.20221012144644-6310f72d5e4d github.com/jackc/pgconn v1.13.0 github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa github.com/jackc/pgtype v1.12.0 github.com/jackc/pgx/v4 v4.17.2 github.com/rubenv/sql-migrate v1.2.0 github.com/stretchr/testify v1.8.0 github.com/uber-go/tally/v4 v4.1.3 go.uber.org/atomic v1.10.0 go.uber.org/zap v1.23.0 golang.org/x/crypto v0.0.0-20221012134737-56aed061732a golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc google.golang.org/grpc v1.50.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf v1.28.1 gopkg.in/natefinch/lumberjack.v2 v2.0.0-20190411184413-94d9e492cc53 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( Loading @@ -39,18 +39,18 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.2.0 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect github.com/blevesearch/mmap-go v1.0.3 // indirect github.com/blevesearch/mmap-go v1.0.4 // indirect github.com/blevesearch/segment v0.9.0 // indirect github.com/blevesearch/snowballstem v0.9.0 // indirect github.com/blevesearch/vellum v1.0.7 // indirect github.com/blugelabs/ice v0.2.0 // indirect github.com/blugelabs/ice v1.0.0 // indirect github.com/blugelabs/ice/v2 v2.0.1 // indirect github.com/caio/go-tdigest v3.1.0+incompatible // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-gorp/gorp/v3 v3.0.2 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/golang/glog v1.0.0 // indirect Loading @@ -59,8 +59,9 @@ require ( github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.1.1 // indirect github.com/jackc/pgproto3/v2 v2.3.1 // indirect github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect github.com/klauspost/compress v1.15.2 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect Loading @@ -71,8 +72,7 @@ require ( github.com/prometheus/procfs v0.6.0 // indirect github.com/twmb/murmur3 v1.1.6 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect )
server/api.go +2 −1 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" _ "google.golang.org/grpc/encoding/gzip" // enable gzip compression on server for grpc "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" Loading Loading @@ -195,7 +196,7 @@ func StartApiServer(logger *zap.Logger, startupLogger *zap.Logger, db *sql.DB, p cert := credentials.NewTLS(&tls.Config{RootCAs: certPool, InsecureSkipVerify: true}) dialOpts = append(dialOpts, grpc.WithTransportCredentials(cert)) } else { dialOpts = append(dialOpts, grpc.WithInsecure()) dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) } if err := apigrpc.RegisterNakamaHandlerFromEndpoint(ctx, grpcGateway, dialAddr, dialOpts); err != nil { startupLogger.Fatal("API server gateway registration failed", zap.Error(err)) Loading
server/api_rpc.go +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package server import ( "context" "encoding/json" "io/ioutil" "io" "net/http" "strings" "time" Loading Loading @@ -132,7 +132,7 @@ func (s *ApiServer) RpcFuncHttp(w http.ResponseWriter, r *http.Request) { // Prepare input to function. var payload string if r.Method == "POST" { b, err := ioutil.ReadAll(r.Body) b, err := io.ReadAll(r.Body) if err != nil { // Request body too large. if err.Error() == "http: request body too large" { Loading
server/api_test.go +4 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/encoding/protojson" ) Loading Loading @@ -173,7 +174,7 @@ func NewAPIServer(t *testing.T, runtime *Runtime) (*ApiServer, *Pipeline) { router := &DummyMessageRouter{} tracker := &LocalTracker{} pipeline := NewPipeline(logger, cfg, db, protojsonMarshaler, protojsonUnmarshaler, nil, nil, nil, nil, nil, tracker, router, runtime) apiServer := StartApiServer(logger, logger, db, protojsonMarshaler, protojsonUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, nil, metrics, pipeline, runtime) apiServer := StartApiServer(logger, logger, db, protojsonMarshaler, protojsonUnmarshaler, cfg, "3.0.0", nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, nil, metrics, pipeline, runtime) return apiServer, pipeline } Loading @@ -182,7 +183,7 @@ func NewSession(t *testing.T, customID string) (*grpc.ClientConn, apigrpc.Nakama outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{ "authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte("defaultkey:")), })) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithInsecure()) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal(err) } Loading @@ -209,7 +210,7 @@ func NewAuthenticatedAPIClient(t *testing.T, customID string) (*grpc.ClientConn, outgoingCtx := metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{ "authorization": "Bearer " + session.Token, })) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithInsecure()) conn, err := grpc.DialContext(outgoingCtx, "localhost:7349", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal(err) } Loading