Repository navigation
Expose safe Slack OAuth exchange diagnostics - #369
Merged
Merged
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c8bc63ab-2df7-45bc-8aaa-ade72e29f011) |
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Slack installation failures all displayed “Slack did not return a bot token,” including configuration, network, and exchange rejections. Return a typed result with fixed diagnostic codes and show corresponding dashboard messages so the next live attempt can identify the failure category.
Known Slack errors are allowlisted. Unknown errors, response bodies, exception messages, tokens, client secrets, and authorization codes are never reflected into redirects. Existing token/channel validation and approval permissions are unchanged.
Validation:
npm run checkpassed: typecheck, lint (warnings only), 1,900 tests; 56 DB tests skipped. Added failure classification, timeout, missing configuration, and redirect secret-leak tests. Browser rendering not checked. The production install cause remains unverified until deployment and a fresh consent attempt.Note
Medium Risk
Touches OAuth token exchange and redirect query parameters for Slack install, but failures are constrained to fixed codes with tests guarding against secret leakage; successful install and permission checks are unchanged.
Overview
Replaces the generic Slack install failure path with typed, bounded OAuth diagnostics so admins see why token exchange failed instead of a single “no bot token” message.
exchangeSlackCodenow returns a discriminatedSlackExchangeResultwith fixed error codes (missing config, allowlisted Slack API errors, HTTP/JSON/network/timeout, and post-success validation gaps like missing bot token or channel). The OAuth callback redirects toslack=oauth_<code>on failure; WebhookSettings maps each code to a specific user-facing explanation. Sensitive Slack payloads, secrets, codes, and arbitrary error strings are not echoed into redirect URLs.Tests cover failure classification, timeout handling, missing configuration, and redirects that only expose bounded diagnostics.
Reviewed by Cursor Bugbot for commit de6d47f. Bugbot is set up for automated code reviews on this repo. Configure here.