Skip to content

Commit

Permalink
Revert "Revert "Update docs to include the InstallationStore deleteIn…
Browse files Browse the repository at this point in the history
…stallation method (#1002)" (#1004)" (#1005)

This reverts commit 134618d.
  • Loading branch information
seratch authored Jul 15, 2021
1 parent fde30a0 commit b0343da
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
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. |
| `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

0 comments on commit b0343da

Please sign in to comment.