From b835848a3f4d48ee76e6a5a8b0d59fc04e8ac393 Mon Sep 17 00:00:00 2001 From: Alissa Renz Date: Tue, 13 Jul 2021 21:48:46 -0700 Subject: [PATCH 1/3] Update docs to include deleteInstallation --- docs/_basic/authenticating_oauth.md | 12 ++++++++++++ docs/_basic/ja_authenticating_oauth.md | 12 ++++++++++++ docs/_tutorials/reference.md | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/_basic/authenticating_oauth.md b/docs/_basic/authenticating_oauth.md index ca2df33d5..b955d4226 100644 --- a/docs/_basic/authenticating_oauth.md +++ b/docs/_basic/authenticating_oauth.md @@ -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'); + }, }, }); ``` diff --git a/docs/_basic/ja_authenticating_oauth.md b/docs/_basic/ja_authenticating_oauth.md index c83738bda..a3336378a 100644 --- a/docs/_basic/ja_authenticating_oauth.md +++ b/docs/_basic/ja_authenticating_oauth.md @@ -50,6 +50,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'); + }, }, }); ``` diff --git a/docs/_tutorials/reference.md b/docs/_tutorials/reference.md index c1cf3f582..6239096c5 100644 --- a/docs/_tutorials/reference.md +++ b/docs/_tutorials/reference.md @@ -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. | From 211355bc40af8f0f30e0328e44aeaa3b39325efa Mon Sep 17 00:00:00 2001 From: Alissa Renz Date: Wed, 14 Jul 2021 17:48:03 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Kazuhiro Sera --- docs/_basic/ja_authenticating_oauth.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_basic/ja_authenticating_oauth.md b/docs/_basic/ja_authenticating_oauth.md index a3336378a..7e15f8781 100644 --- a/docs/_basic/ja_authenticating_oauth.md +++ b/docs/_basic/ja_authenticating_oauth.md @@ -51,13 +51,13 @@ 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 + // OrG 全体へのインストール情報の削除 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'); From 218923fc05e56043ff7b774da9d448b8167e4da9 Mon Sep 17 00:00:00 2001 From: Alissa Renz Date: Wed, 14 Jul 2021 17:49:35 -0700 Subject: [PATCH 3/3] update ja docs --- docs/_tutorials/ja_reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_tutorials/ja_reference.md b/docs/_tutorials/ja_reference.md index e6ac29a20..01a01eef5 100644 --- a/docs/_tutorials/ja_reference.md +++ b/docs/_tutorials/ja_reference.md @@ -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 のドキュメントを参照してください。 |