AsyncOAuthFlow raises UnboundLocalError on org-wide install without a bot token
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- python
- Domaine
- authentication, backend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 1.3k
- Forks
- 300
- Merge moyen
- 19 h 33 min
- PR mergées (30 j)
- 25
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de slackapi/bolt-python
-
`extract_team_id` crashes with `TypeError when payload["user"]` is a string (e.g. `member_joined_channel` events)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverteauto-triage-skip bug security semver:major
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
slackapi/bolt-python#1447 · 9 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
auto-triage-stale
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
slackapi/bolt-python#1599 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Error handlers that take args: Args crash with a missing 'next' argumentPeut-être pris @sahiljagtap08 l’a pris il y a 42 jours. Ouverteauto-triage-stale
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
slackapi/bolt-python#1598 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Assistant listener middleware crashes when given a plain functionPeut-être pris @sahiljagtap08 l’a pris il y a 42 jours. Ouverteauto-triage-stale
Difficulté 2/5 1-3 heures Accessibilité débutants 30/100
slackapi/bolt-python#1597 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
SslCheck returns 401 for a matching verification_token and 200 for a wrong onePeut-être pris @sahiljagtap08 l’a pris il y a 42 jours. Ouverteauto-triage-stale
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
slackapi/bolt-python#1595 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de slackapi/bolt-python
Issues similaires
-
documentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
BrainLesion/BraTS#200 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
OpenHands/extensions#970 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
rl-institut/enetra#91 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
huggingface/datasets#9100 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
NVIDIA/garak#2486 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours