slackapi / slackapi/bolt-python

OAuth installations without public endpoints for Socket Mode apps

Ouverte
#1,181 5 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

auto-triage-skip discussion question server-side
Langage dominant
Python
Étoiles
1.3k
Forks
288
Merge moyen
1 j 8 h
PR mergées (30 j)
10

Description

At the moment creating simple Bots in SocketMode is easy, but as soon as you want to support OAuth2 installation so that the bot can act on behalf of the user, a whole world of pain and complexity ensues.

The problem is that an app using Socket Mode only makes a single outbound connection, authenticated with its tokens, whereas to support OAuth2 it needs to expose an HTTPS endpoint with a valid certificate. These are very different beasts.

  • A Socket Mode app can be run anywhere that can make an outbound connection. If you need OAuth2 then you need to expose the app to the internet.
  • A Socket Mode app does not need to know its own DNS address. If you want OAuth2 you do.
  • A Socket Mode app does not need a valid SSL certificate. To support OAuth2 you need one.

The requested enhancement, as proposed in this comment on another issue, is that Slack should offer a new API endpoint to provide an OAuth callback location for Socket Mode apps. The Slack API servers would present an endpoint with a URL of the form https://slack.com/api/oauth_redirect/MY_APP_ID and an app would use this in its OAuth2 installation process. When the user completes the OAuth2 flow this endpoint would be hit, the Slack servers would do some simple sanity checks on the values and then the tokens would be presented to the app as an event through the WebSocket connection. If the app is not connected at the time the API would reject the request, so the authentication process would not complete.

Offering this API would greatly simplify the process of deploying OAuth2 apps in Socket Mode. It would allow OAuth2 apps to run in Docker containers that don't have a good idea of where they are running or how they can be addressed. It would have the added security advantage of the app not having to expose any endpoint to the outside world.

Category
  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Others

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

La demande concerne les adaptateurs Socket Mode et une nouvelle API de callback Slack OAuth, mais ne nomme aucun fichier du dépôt ni aucun test. Commencez par inspecter la zone slack_bolt.adapter et la discussion référencée dans l’issue #583. La tâche sera considérée comme terminée lorsqu’un chemin d’implémentation défini existera dans ce dépôt, accompagné d’une validation correspondante pour les événements d’installation OAuth.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api, backend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.