Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to include the InstallationStore deleteInstallation method #1002

Merged
merged 4 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/_basic/authenticating_oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ const app = new App({
}
throw new Error('Failed fetching installation');
},
deleteInstallation: async (installQuery) => {
// change the line below so it deletes from your database
if (installQuery.isEnterpriseInstall && installQuery.enterpriseId !== undefined) {
// org wide app installation deletion
return await myDB.delete(installQuery.enterpriseId);
}
if (installQuery.teamId !== undefined) {
// single team app installation deletion
return await myDB.delete(installQuery.teamId);
}
throw new Error('Failed to delete installation');
},
},
});
```
Expand Down
12 changes: 12 additions & 0 deletions docs/_basic/ja_authenticating_oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ const app = new App({
}
throw new Error('Failed fetching installation');
},
deleteInstallation: async (installQuery) => {
// 実際のデータベースから削除するために、ここのコードを変更
if (installQuery.isEnterpriseInstall && installQuery.enterpriseId !== undefined) {
// OrG 全体へのインストール情報の削除
return await myDB.delete(installQuery.enterpriseId);
}
if (installQuery.teamId !== undefined) {
// 単独のワークスペースへのインストール情報の削除
return await myDB.delete(installQuery.teamId);
}
throw new Error('Failed to delete installation');
},
},
});
```
Expand Down
2 changes: 1 addition & 1 deletion docs/_tutorials/ja_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Bolt には、アプリをカスタマイズするためのさまざまな初期
| `clientId` | アプリの設定で指定した、クライアントの ID を示す 文字列。[OAuth の設定を行うために必要です](/bolt-js/concepts#authenticating-oauth)。 |
| `clientSecret` | アプリの設定で指定した、クライアントのシークレットキーを示す 文字列。[OAuth の設定を行うために必要です](/bolt-js/concepts#authenticating-oauth)。 |
| `stateSecret` | CSRF 攻撃を防ぐために [OAuth の設定時](/bolt-js/concepts#authenticating-oauth)に渡すことができる、推奨のパラメーター(文字列)。 |
| `installationStore` | [OAuth の設定時](/bolt-js/concepts#authenticating-oauth)に、インストールデータの保存と取得の手段を定義します。`fetchInstallation` `storeInstallation` という 2 つのメソッドが含まれます。デフォルトの `installationStore` はインメモリストアです。 |
| `installationStore` | [OAuth の設定時](/bolt-js/ja-jp/concepts#authenticating-oauth)に、インストールデータの保存・取得・削除の手段を定義します。`fetchInstallation` `storeInstallation`、`deleteInstallation` という 3 つのメソッドが含まれます。デフォルトの `installationStore` はインメモリストアです。 |
| `scopes` | アプリが [OAuth のプロセスの中で](/bolt-js/concepts#authenticating-oauth)アクセス許可を求めるスコープのリスト。 |
| `installerOptions` | [デフォルトの OAuth サポート](/bolt-js/concepts#authenticating-oauth)をカスタマイズする場合に指定するオブジェクト(必須ではない)。詳しくは、OAuth のドキュメントを参照してください。 |

Expand Down
2 changes: 1 addition & 1 deletion docs/_tutorials/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Bolt includes a collection of initialization options to customize apps. There ar
| `clientId` | The client ID `string` from your app's configuration which is [required to configure OAuth](/bolt-js/concepts#authenticating-oauth). |
| `clientSecret` | The client secret `string` from your app's configuration which is [required to configure OAuth](/bolt-js/concepts#authenticating-oauth). |
| `stateSecret` | Recommended parameter (`string`) that's passed when [configuring OAuth](/bolt-js/concepts#authenticating-oauth) to prevent CSRF attacks |
| `installationStore` | Defines how to save and fetch installation data when [configuring OAuth](/bolt-js/concepts#authenticating-oauth). Contains two methods: `fetchInstallation` and `storeInstallation`. The default `installationStore` is an in-memory store. |
| `installationStore` | Defines how to save, fetch and delete installation data when [configuring OAuth](/bolt-js/concepts#authenticating-oauth). Contains three methods: `fetchInstallation`, `storeInstallation` and `deleteInstallation`. The default `installationStore` is an in-memory store. |
misscoded marked this conversation as resolved.
Show resolved Hide resolved
| `scopes` | Array of scopes that your app will request [within the OAuth process](/bolt-js/concepts#authenticating-oauth). |
| `installerOptions` | Optional object that can be used to customize [the default OAuth support](/bolt-js/concepts#authenticating-oauth). Read more in the OAuth documentation. |

Expand Down