User token stops working 8 hours after /github connect (classic OAuth App)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, go
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
Start with the OAuth flow and token storage around server/plugin/plugin.go, then inspect server/plugin/graphql/client.go and the existing mm_34646_token_refresh.go reset path. Confirm whether GitHub returns expires_in and refresh_token for this OAuth flow, then reproduce the failure and identify the point where refresh handling and tests should be added. Done means expiring tokens are refreshed before the next GitHub call, revoked-token behavior remains covered, and relevant tests pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
On our self-hosted Mattermost, the token the plugin gets from /github connect stops working about 8 hours later. From then on every GitHub call returns 401 Bad credentials, and the next morning the daily reminder triggers the “Your Github account was disconnected due to an invalid or revoked authorization token” DM.
Environment
- Mattermost Team Edition 11.11.1 (since upgraded to 12.0.0)
- GitHub plugin 2.6.0
- A classic OAuth App owned by our organization, not a GitHub App. Its settings page has no token expiration option.
- One connected user, a bot account
Timing
| Connect (UTC) | First 401 (UTC) | Lifetime |
|---|---|---|
| 13 Oct 07:29:36 | 13 Oct 15:30:11 | 8h 00m |
| 14 Oct 07:58:04 | 14 Oct 16:15:51 | 8h 17m |
| 15 Oct 06:20:15 | 15 Oct 14:31:47 | 8h 11m |
| 16 Oct 08:33:43 | 16 Oct 16:35:11 | 8h 01m |
Connect times come from the account’s security log (oauth_access.create), 401 times from the plugin’s Failed to search for the sidebar data errors. The 401 appears at the first plugin call after the 8 hours, which explains the extra minutes.
What we ruled out
- The MM-34646 reset in
mm_34646_token_refresh.go. It skips users who connected through/github connect, since those getMM34646ResetTokenDone: true, and itsUpdated user access token for MM-34646debug line never appears in our logs. - Revocation. The security log has no
oauth_authorization.destroy, password change or 2FA change. It does have anoauth_access.regenerateby “GitHub System” within a second of everyoauth_access.create, but that also happens for an unrelated integration (Copilot), so it looks like part of normal token issuance. - Mattermost itself. No restart or plugin configuration change around the first failure.
Suggestion
Eight hours is the lifetime of GitHub’s expiring user tokens. If GitHub now issues those to OAuth Apps too, the plugin needs to keep the refresh token and refresh on expiry. Today it wraps the stored token in oauth2.StaticTokenSource (server/plugin/plugin.go, server/plugin/graphql/client.go), so it never refreshes. We inferred the 8 hours from the timings above and haven’t inspected the token response for expires_in or refresh_token. Can anyone confirm whether GitHub changed this for classic OAuth Apps?
- Ngôn ngữ chính
- Go
- Star
- 181
- Fork
- 180
- Merge trung bình
- 21 giờ 4 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của mattermost/mattermost-plugin-github
-
Mute comments from github appĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
mattermost/mattermost-plugin-github#996 · 1 bình luận ·
-
Panic when loading lhs-contentĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
mattermost/mattermost-plugin-github#937 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của mattermost/mattermost-plugin-github
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
devlikeapro/waha#2322 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
validateDeclaredPath lets control characters through into the Gradle init script's Groovy literalĐang mởagent-butler-finding agent-research bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jordansmall/spindrift#5821 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[rmqctl][Bug] Windows build script fails when the output directory is absentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/rocketmq-dashboard#7243 ·
Maintainer thường phản hồi trong vòng 3 ngày