Skip to content

Commit

Permalink
Apple Sign In support, wallet improvements. (heroiclabs#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Jul 21, 2020
1 parent 8e8e742 commit 4b92d9f
Show file tree
Hide file tree
Showing 48 changed files with 2,761 additions and 1,061 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Added
- Support for Apple Sign In authentication, linking, and unlinking.
- Wallet operations now return the updated and previous state of the wallet.

### Changed
- Sanitize metric names and properties fields.
- Wallet operations now use int64 values for all numeric operations.
- Update to nakama-common 1.6.0 release.

### Fixed
- Prevent bad presence list input to dispatcher message broadcasts from causing unexpected errors.

## [2.12.0] - 2020-05-25
### Added
Expand Down
385 changes: 251 additions & 134 deletions apigrpc/apigrpc.pb.go

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions apigrpc/apigrpc.pb.gw.go

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions apigrpc/apigrpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ service Nakama {
option (google.api.http).post = "/v2/group/{group_id}/add";
}

// Authenticate a user with an Apple ID against the server.
rpc AuthenticateApple (api.AuthenticateAppleRequest) returns (api.Session) {
option (google.api.http) = {
post: "/v2/account/authenticate/apple",
body: "account"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
security: {
security_requirement: {
key: "BasicAuth";
value: {};
}
}
};
}

// Authenticate a user with a custom id against the server.
rpc AuthenticateCustom (api.AuthenticateCustomRequest) returns (api.Session) {
option (google.api.http) = {
Expand Down Expand Up @@ -325,6 +341,14 @@ service Nakama {
option (google.api.http).post = "/v2/group/{group_id}/leave";
}

// Add an Apple ID to the social profiles on the current user's account.
rpc LinkApple (api.AccountApple) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/account/link/apple",
body: "*"
};
}

// Add a custom ID to the social profiles on the current user's account.
rpc LinkCustom (api.AccountCustom) returns (google.protobuf.Empty) {
option (google.api.http) = {
Expand Down Expand Up @@ -496,6 +520,14 @@ service Nakama {
};
}

// Remove the Apple ID from the social profiles on the current user's account.
rpc UnlinkApple (api.AccountApple) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/account/unlink/apple",
body: "*"
};
}

// Remove the custom ID from the social profiles on the current user's account.
rpc UnlinkCustom (api.AccountCustom) returns (google.protobuf.Empty) {
option (google.api.http) = {
Expand Down
115 changes: 114 additions & 1 deletion apigrpc/apigrpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,39 @@
]
}
},
"/v2/account/authenticate/apple": {
"post": {
"summary": "Authenticate a user with an Apple ID against the server.",
"operationId": "AuthenticateApple",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiSession"
}
}
},
"parameters": [
{
"name": "body",
"description": "The Apple account details.",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiAccountApple"
}
}
],
"tags": [
"Nakama"
],
"security": [
{
"BasicAuth": []
}
]
}
},
"/v2/account/authenticate/custom": {
"post": {
"summary": "Authenticate a user with a custom id against the server.",
Expand Down Expand Up @@ -471,6 +504,33 @@
]
}
},
"/v2/account/link/apple": {
"post": {
"summary": "Add an Apple ID to the social profiles on the current user's account.",
"operationId": "LinkApple",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiAccountApple"
}
}
],
"tags": [
"Nakama"
]
}
},
"/v2/account/link/custom": {
"post": {
"summary": "Add a custom ID to the social profiles on the current user's account.",
Expand Down Expand Up @@ -697,6 +757,33 @@
]
}
},
"/v2/account/unlink/apple": {
"post": {
"summary": "Remove the Apple ID from the social profiles on the current user's account.",
"operationId": "UnlinkApple",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiAccountApple"
}
}
],
"tags": [
"Nakama"
]
}
},
"/v2/account/unlink/custom": {
"post": {
"summary": "Remove the custom ID from the social profiles on the current user's account.",
Expand Down Expand Up @@ -2550,6 +2637,23 @@
},
"description": "A user with additional account details. Always the current user."
},
"apiAccountApple": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "The ID token received from Apple to validate."
},
"vars": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Extra information that will be bundled in the session token."
}
},
"description": "Send a Apple Sign In token to the server. Used with authenticate/link/unlink."
},
"apiAccountCustom": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2895,6 +2999,11 @@
"type": "integer",
"format": "int32",
"description": "The friend status."
},
"update_time": {
"type": "string",
"format": "date-time",
"description": "Time of the latest relationship update."
}
},
"description": "A friend of a user."
Expand Down Expand Up @@ -3631,7 +3740,11 @@
},
"facebook_instant_game_id": {
"type": "string",
"description": "The Facebook Instant Game id in the user's account."
"description": "The Facebook Instant Game ID in the user's account."
},
"apple_id": {
"type": "string",
"description": "The Apple Sign In ID in the user's account."
}
},
"description": "A user in the server."
Expand Down
12 changes: 6 additions & 6 deletions console/a_console-packr.go

Large diffs are not rendered by default.

Loading

0 comments on commit 4b92d9f

Please sign in to comment.