You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(worker): guard against anonymous Bitbucket Server token fallback in account permission sync (#998)
* fix(worker): guard against anonymous Bitbucket Server token fallback in account permission sync
Bitbucket Server instances with anonymous access enabled silently treat
expired/invalid OAuth tokens as anonymous rather than returning a 401.
This caused account-driven permission syncing to receive an empty repo
list (200 OK) and wipe all AccountToRepoPermission records.
Added isBitbucketServerUserAuthenticated() which calls
/rest/api/1.0/profile/recent/repos — an endpoint that always requires
authentication even when anonymous access is enabled — to detect this
condition before fetching repos. Also added explicit throws for
unsupported provider/code host types instead of silently returning
empty results.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: update CHANGELOG for #998
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* nit
* feedback
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Added
11
11
- Added generated OpenAPI documentation for the public search, repo, and file browsing API surface. [#996](https://github.com/sourcebot-dev/sourcebot/pull/996)
12
12
13
+
### Fixed
14
+
-[EE] Fixed account-driven permission sync silently wiping all Bitbucket Server repository permissions when the OAuth token expires on instances with anonymous access enabled. [#998](https://github.com/sourcebot-dev/sourcebot/pull/998)
thrownewError(`Bitbucket Server authentication check failed. The OAuth token may be expired and the server may be treating the request as anonymous. Please re-authenticate with Bitbucket Server.`);
0 commit comments