slackapi / slackapi/bolt-python
OAuth installations without public endpoints for Socket Mode apps
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 288
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 10
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Yêu cầu này liên quan đến các adapter của Socket Mode và một API callback Slack OAuth mới, nhưng không nêu tệp nào trong repository hoặc test nào. Hãy bắt đầu bằng cách kiểm tra khu vực slack_bolt.adapter và cuộc thảo luận được tham chiếu trong issue #583. Công việc được xem là hoàn tất khi repository này có một hướng triển khai được xác định và có validation tương ứng cho các sự kiện cài đặt OAuth.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100