AsyncOAuthFlow raises UnboundLocalError on org-wide install without a bot token
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
The crash is in slack_bolt/oauth/async_oauth_flow.py in AsyncOAuthFlow.run_installation, where auth_test is read for enterprise installs but only assigned inside the bot-token branch. Compare it with the sync OAuthFlow.run_installation, which keeps that lookup under if bot_token is not None:. A fix already exists in linked PR #1590 with tests, so review or extend that PR rather than starting a parallel one. Done means an org-wide install with user scopes only saves the installation and redirects without raising UnboundLocalError.
索引モデルが issue の本文から書いたものです。
説明
Reproducible in:
The slack_bolt version
slack_bolt==1.30.0
slack_sdk==3.45.0
Python runtime version
Python 3.12.5
OS info
macOS 27.0
Steps to reproduce:
Use AsyncApp with OAuth and have an Enterprise Grid org install the app with only user scopes (no bot scopes). The oauth.v2.access response then has no access_token for the bot and is_enterprise_install is true.
- Configure
AsyncOAuthFlowwith user scopes only. - Install the app at the organization level (org-wide install).
- Complete the OAuth redirect.
Expected result:
The installation is saved and the redirect succeeds, the same as it does with the sync OAuthFlow.
Actual result:
AsyncOAuthFlow.run_installation in slack_bolt/oauth/async_oauth_flow.py raises:
UnboundLocalError: cannot access local variable 'auth_test' where it is not associated with a value
The code reads auth_test.get("url") for enterprise installs, but auth_test is only set when a bot token exists. The sync OAuthFlow.run_installation nests that line inside the if bot_token is not None: block, so the two have drifted apart.
I have a fix that mirrors the sync version, with tests for both, in #1590.
Requirements
I have read the Contributing guidelines and Code of Conduct.
- 主要言語
- Python
- スター
- 1.3k
- フォーク
- 300
- 平均マージ
- 19時間 33分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/bolt-python のほかの issue
-
`extract_team_id` crashes with `TypeError when payload["user"]` is a string (e.g. `member_joined_channel` events)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンauto-triage-skip bug security semver:major
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
slackapi/bolt-python#1447 · コメント 9 件 ·
メンテナーはふだん 1 日以内に返信
-
auto-triage-stale
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
slackapi/bolt-python#1599 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Error handlers that take args: Args crash with a missing 'next' argument対応中かも @sahiljagtap08 が 42 日前に担当しました。 オープンauto-triage-stale
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
slackapi/bolt-python#1598 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Assistant listener middleware crashes when given a plain function対応中かも @sahiljagtap08 が 42 日前に担当しました。 オープンauto-triage-stale
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
slackapi/bolt-python#1597 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
SslCheck returns 401 for a matching verification_token and 200 for a wrong one対応中かも @sahiljagtap08 が 42 日前に担当しました。 オープンauto-triage-stale
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
slackapi/bolt-python#1595 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
slackapi/bolt-python の issue をすべて見る
似ている issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
BrainLesion/BraTS#200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
OpenHands/extensions#970 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
rl-institut/enetra#91 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/datasets#9100 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/garak#2486 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信