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 分鐘
- 30 天內合併 PR
- 25
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
slackapi/bolt-python 的其他 Issue
-
`extract_team_id` crashes with `TypeError when payload["user"]` is a string (e.g. `member_joined_channel` events)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉auto-triage-skip bug security semver:major
難度 2/5 1-3 小時 新手友好度 72/100
slackapi/bolt-python#1447 · 9 則留言 ·
維護者通常 1 天內回覆
-
auto-triage-stale
難度 5/5 一週以上 新手友好度 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
維護者通常 2 天內回覆