Unverified Commit c3af832c authored by Mike's avatar Mike Committed by GitHub
Browse files

Facebook Instant Game authentication (#409)

parent 5ff836b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
## [Unreleased]
### Added
- Return tournament end time in listing operations if one exists.
- Add Facebook Instant Game Authentication method.

### Changed
- Build with Go 1.13.8 release.
+248 −129

File changed.

Preview size limit exceeded, changes collapsed.

+252 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ import (
	"io"
	"net/http"

	"github.com/golang/protobuf/descriptor"
	"github.com/golang/protobuf/proto"
	"github.com/golang/protobuf/ptypes/empty"
	"github.com/grpc-ecosystem/grpc-gateway/runtime"
@@ -24,11 +25,13 @@ import (
	"google.golang.org/grpc/status"
)

// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage

var (
	filter_Nakama_AddFriends_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
@@ -328,6 +331,55 @@ func local_request_Nakama_AuthenticateFacebook_0(ctx context.Context, marshaler

}

var (
	filter_Nakama_AuthenticateFacebookInstantGame_0 = &utilities.DoubleArray{Encoding: map[string]int{"account": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)

func request_Nakama_AuthenticateFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AuthenticateFacebookInstantGameRequest
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Account); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	if err := req.ParseForm(); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}
	if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Nakama_AuthenticateFacebookInstantGame_0); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.AuthenticateFacebookInstantGame(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func local_request_Nakama_AuthenticateFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, server NakamaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AuthenticateFacebookInstantGameRequest
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Account); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Nakama_AuthenticateFacebookInstantGame_0); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := server.AuthenticateFacebookInstantGame(ctx, &protoReq)
	return msg, metadata, err

}

var (
	filter_Nakama_AuthenticateGameCenter_0 = &utilities.DoubleArray{Encoding: map[string]int{"account": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
@@ -1353,6 +1405,40 @@ func local_request_Nakama_LinkFacebook_0(ctx context.Context, marshaler runtime.

}

func request_Nakama_LinkFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountFacebookInstantGame
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.LinkFacebookInstantGame(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func local_request_Nakama_LinkFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, server NakamaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountFacebookInstantGame
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := server.LinkFacebookInstantGame(ctx, &protoReq)
	return msg, metadata, err

}

func request_Nakama_LinkGameCenter_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountGameCenter
	var metadata runtime.ServerMetadata
@@ -2700,6 +2786,40 @@ func local_request_Nakama_UnlinkFacebook_0(ctx context.Context, marshaler runtim

}

func request_Nakama_UnlinkFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountFacebookInstantGame
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.UnlinkFacebookInstantGame(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func local_request_Nakama_UnlinkFacebookInstantGame_0(ctx context.Context, marshaler runtime.Marshaler, server NakamaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountFacebookInstantGame
	var metadata runtime.ServerMetadata

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
	}
	if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := server.UnlinkFacebookInstantGame(ctx, &protoReq)
	return msg, metadata, err

}

func request_Nakama_UnlinkGameCenter_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq api.AccountGameCenter
	var metadata runtime.ServerMetadata
@@ -3205,6 +3325,26 @@ func RegisterNakamaHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser

	})

	mux.Handle("POST", pattern_Nakama_AuthenticateFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := local_request_Nakama_AuthenticateFacebookInstantGame_0(rctx, inboundMarshaler, server, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_AuthenticateFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_AuthenticateGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -3685,6 +3825,26 @@ func RegisterNakamaHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser

	})

	mux.Handle("POST", pattern_Nakama_LinkFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := local_request_Nakama_LinkFacebookInstantGame_0(rctx, inboundMarshaler, server, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_LinkFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_LinkGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -4185,6 +4345,26 @@ func RegisterNakamaHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser

	})

	mux.Handle("POST", pattern_Nakama_UnlinkFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := local_request_Nakama_UnlinkFacebookInstantGame_0(rctx, inboundMarshaler, server, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_UnlinkFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_UnlinkGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -4506,6 +4686,26 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("POST", pattern_Nakama_AuthenticateFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_AuthenticateFacebookInstantGame_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_AuthenticateFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_AuthenticateGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -4986,6 +5186,26 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("POST", pattern_Nakama_LinkFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_LinkFacebookInstantGame_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_LinkFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_LinkGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -5486,6 +5706,26 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("POST", pattern_Nakama_UnlinkFacebookInstantGame_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_UnlinkFacebookInstantGame_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_UnlinkFacebookInstantGame_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_UnlinkGameCenter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -5662,6 +5902,8 @@ var (

	pattern_Nakama_AuthenticateFacebook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "authenticate", "facebook"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_AuthenticateFacebookInstantGame_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "authenticate", "facebookinstantgame"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_AuthenticateGameCenter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "authenticate", "gamecenter"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_AuthenticateGoogle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "authenticate", "google"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -5710,6 +5952,8 @@ var (

	pattern_Nakama_LinkFacebook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "link", "facebook"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_LinkFacebookInstantGame_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "link", "facebookinstantgame"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_LinkGameCenter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "link", "gamecenter"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_LinkGoogle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "link", "google"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -5760,6 +6004,8 @@ var (

	pattern_Nakama_UnlinkFacebook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "unlink", "facebook"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_UnlinkFacebookInstantGame_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "unlink", "facebookinstantgame"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_UnlinkGameCenter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "unlink", "gamecenter"}, "", runtime.AssumeColonVerbOpt(true)))

	pattern_Nakama_UnlinkGoogle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "unlink", "google"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -5790,6 +6036,8 @@ var (

	forward_Nakama_AuthenticateFacebook_0 = runtime.ForwardResponseMessage

	forward_Nakama_AuthenticateFacebookInstantGame_0 = runtime.ForwardResponseMessage

	forward_Nakama_AuthenticateGameCenter_0 = runtime.ForwardResponseMessage

	forward_Nakama_AuthenticateGoogle_0 = runtime.ForwardResponseMessage
@@ -5838,6 +6086,8 @@ var (

	forward_Nakama_LinkFacebook_0 = runtime.ForwardResponseMessage

	forward_Nakama_LinkFacebookInstantGame_0 = runtime.ForwardResponseMessage

	forward_Nakama_LinkGameCenter_0 = runtime.ForwardResponseMessage

	forward_Nakama_LinkGoogle_0 = runtime.ForwardResponseMessage
@@ -5888,6 +6138,8 @@ var (

	forward_Nakama_UnlinkFacebook_0 = runtime.ForwardResponseMessage

	forward_Nakama_UnlinkFacebookInstantGame_0 = runtime.ForwardResponseMessage

	forward_Nakama_UnlinkGameCenter_0 = runtime.ForwardResponseMessage

	forward_Nakama_UnlinkGoogle_0 = runtime.ForwardResponseMessage
+32 −0
Original line number Diff line number Diff line
@@ -162,6 +162,22 @@ service Nakama {
    };
  }

  // Authenticate a user with a Facebook Instant Game token against the server.
  rpc AuthenticateFacebookInstantGame (api.AuthenticateFacebookInstantGameRequest) returns (api.Session) {
    option (google.api.http) = {
      post: "/v2/account/authenticate/facebookinstantgame",
      body: "account"
    };
    option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
      security: {
        security_requirement: {
          key: "BasicAuth";
          value: {};
        }
      }
    };
  }

  // Authenticate a user with Apple's GameCenter against the server.
  rpc AuthenticateGameCenter (api.AuthenticateGameCenterRequest) returns (api.Session) {
    option (google.api.http) = {
@@ -341,6 +357,14 @@ service Nakama {
    };
  }

  // Add Facebook Instant Game to the social profiles on the current user's account.
  rpc LinkFacebookInstantGame (api.AccountFacebookInstantGame) returns (google.protobuf.Empty) {
    option (google.api.http) = {
      post: "/v2/account/link/facebookinstantgame",
      body: "*"
    };
  }

  // Add Apple's GameCenter to the social profiles on the current user's account.
  rpc LinkGameCenter (api.AccountGameCenter) returns (google.protobuf.Empty) {
    option (google.api.http) = {
@@ -504,6 +528,14 @@ service Nakama {
    };
  }

  // Remove Facebook Instant Game profile from the social profiles on the current user's account.
  rpc UnlinkFacebookInstantGame (api.AccountFacebookInstantGame) returns (google.protobuf.Empty) {
    option (google.api.http) = {
      post: "/v2/account/unlink/facebookinstantgame",
      body: "*"
    };
  }

  // Remove Apple's GameCenter from the social profiles on the current user's account.
  rpc UnlinkGameCenter (api.AccountGameCenter) returns (google.protobuf.Empty) {
    option (google.api.http) = {
+124 −0
Original line number Diff line number Diff line
@@ -279,6 +279,54 @@
        ]
      }
    },
    "/v2/account/authenticate/facebookinstantgame": {
      "post": {
        "summary": "Authenticate a user with a Facebook Instant Game token against the server.",
        "operationId": "AuthenticateFacebookInstantGame",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/apiSession"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Facebook Instant Game account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebookInstantGame"
            }
          },
          {
            "name": "create",
            "description": "Register the account if the user does not already exist.",
            "in": "query",
            "required": false,
            "type": "boolean",
            "format": "boolean"
          },
          {
            "name": "username",
            "description": "Set the username on the account at register. Must be unique.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "Nakama"
        ],
        "security": [
          {
            "BasicAuth": []
          }
        ]
      }
    },
    "/v2/account/authenticate/gamecenter": {
      "post": {
        "summary": "Authenticate a user with Apple's GameCenter against the server.",
@@ -540,6 +588,34 @@
        ]
      }
    },
    "/v2/account/link/facebookinstantgame": {
      "post": {
        "summary": "Add Facebook Instant Game to the social profiles on the current user's account.",
        "operationId": "LinkFacebookInstantGame",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "description": "The Facebook Instant Game account details.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebookInstantGame"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/link/gamecenter": {
      "post": {
        "summary": "Add Apple's GameCenter to the social profiles on the current user's account.",
@@ -729,6 +805,33 @@
        ]
      }
    },
    "/v2/account/unlink/facebookinstantgame": {
      "post": {
        "summary": "Remove Facebook Instant Game profile from the social profiles on the current user's account.",
        "operationId": "UnlinkFacebookInstantGame",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/apiAccountFacebookInstantGame"
            }
          }
        ],
        "tags": [
          "Nakama"
        ]
      }
    },
    "/v2/account/unlink/gamecenter": {
      "post": {
        "summary": "Remove Apple's GameCenter from the social profiles on the current user's account.",
@@ -2514,6 +2617,23 @@
      },
      "description": "Send a Facebook token to the server. Used with authenticate/link/unlink."
    },
    "apiAccountFacebookInstantGame": {
      "type": "object",
      "properties": {
        "signed_player_info": {
          "type": "string",
          "title": "The OAuth token received from a Facebook Instant Game that may be decoded with the Application Secret (must be available with the nakama configuration)"
        },
        "vars": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Extra information that will be bundled in the session token."
        }
      },
      "description": "Send a Facebook Instant Game token to the server. Used with authenticate/link/unlink."
    },
    "apiAccountGameCenter": {
      "type": "object",
      "properties": {
@@ -3503,6 +3623,10 @@
          "type": "string",
          "format": "date-time",
          "description": "The UNIX time when the user was last updated."
        },
        "facebook_instant_game_id": {
          "type": "string",
          "description": "The Facebook Instant Game id in the user's account."
        }
      },
      "description": "A user in the server."
Loading