MM-69450: Notify users when GitHub SAML SSO or token auth fails#1032
Open
jgheithcock wants to merge 1 commit into
Open
MM-69450: Notify users when GitHub SAML SSO or token auth fails#1032jgheithcock wants to merge 1 commit into
jgheithcock wants to merge 1 commit into
Conversation
Surface hidden GitHub auth failures (401 and SAML 403) by routing them through the existing handleRevokedToken path, which force-disconnects the account and sends the bot DM prompting reconnect via /github connect.
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.
Summary
When GitHub API calls fail due to revoked tokens (401) or SAML SSO authorization issues (403), the plugin previously logged the errors server-side but gave users no indication they needed to reconnect. This routes those failures through the existing
handleRevokedTokenflow, which force-disconnects the account and sends the bot DM telling the user to run/github connectagain.Changes:
isGitHubAuthFailureto detect 401 and SAML-specific 403 errors from both go-github (REST) and githubv4 (GraphQL) error shapes.useGitHubClientand wire upgetLHSData/getPrsDetailspaths that previously bypassed it.GetLHSDataso SAML failures are not swallowed when other orgs succeed.Ticket Link
https://mattermost.atlassian.net/browse/MM-69450
Checklist
make check-stylego test ./server/plugin/...