-
Notifications
You must be signed in to change notification settings - Fork 642
feat(bitbucket): add API token authentication support and deprecate A… #8604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pp passwords - Updated Bitbucket connection model to include `UsesApiToken` field for API token support. - Modified connection handling in the Bitbucket API to use API tokens. - Added migration script to update existing connections for backward compatibility. - Updated UI to reflect changes in authentication method and provide guidance on API token usage. - Updated documentation to inform users about the deprecation of App passwords.
…ection handling - Introduced tests for Bitbucket connection API, validating API token and app password authentication methods. - Added tests for connection sanitization to ensure sensitive data is handled correctly. - Implemented tests for connection status code handling and deprecation warnings for app passwords. - Enhanced coverage for connection merging logic and authentication setup. Addresses apache#8520
|
FWIW I'm very keen to have this. Bitbucket have stopped allowing app passwords since September 9, so the bitbucket cloud integration effectively won't work for new users until the API token feature is available. Thanks for doing this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Nice work.
Can you reolve the conflict so I can merge it? Thanks.
The following issues were resolved: - SA1006 in `server/api/shared/api_output.go`: Changed `fmt.Errorf` to `errors.Default.New` and removed unused `fmt` import. - gofmt in `plugins/bitbucket/models/migrationscripts/20251001_add_api_token_auth.go`: Fixed trailing blank line. - gofmt in `plugins/bitbucket/api/connection_api.go`: Corrected inconsistent tab spacing. - confusing-results in `server/services/remote/plugin/plugin_impl.go`: Added named return parameters and resolved variable shadowing. - ST1016 in `plugins/bitbucket/models/connection.go`: Standardized receiver name from `connection` to `bc`. - S1009 in `plugins/github_graphql/tasks/issue_extractor.go`: Removed redundant nil check. - superfluous-else in `impls/logruslog/init.go`: Refactored code to eliminate unnecessary else block. - superfluous-else in `helpers/srvhelper/scope_service_helper.go`: Refactored code to eliminate unnecessary else block. Fixes apache#8520
|
@klesh I resolved the linting issues and the merge conflict. Should we still wait till @petkostas's PR #8599 is merged, before merging this one? |
Does the PR depend on #8599 to work properly? |
|
@klesh No, it doesn't. I figured it's a matter of responsibility. Upgrading from Go 1.22 --> 1.24 linting rules would probs require me to change my code. So, should that responsibility fall on me, or on @petkostas? |
Bitbucket API Token Authentication Support
Summary
This PR adds support for Bitbucket API tokens as an authentication method for the Bitbucket plugin, in response to Atlassian's deprecation timeline for App passwords (creation discontinued September 9, 2025; all deactivated June 9, 2026).
Key Changes:
UsesApiTokenboolean field to track authentication type (both use HTTP Basic Auth withusername:credentialformat)usesApiToken = falseby default)Authentication Details:
Testing:
Does this close any open issues?
Closes #8520
Screenshots
Onboarding Connection Form (API Token - Default)

New Connection Form (From Config-UI)

Other Information
Migration Path
Required API Token Scopes
read:account- Required to view users profilesread:issue:bitbucket- View your issuesread:pipeline:bitbucket- View your pipelinesread:project:bitbucket- View your projectsread:pullrequest:bitbucket- View your pull requestsread:repository:bitbucket- View your repositoriesread:runner:bitbucket- View your workspaces/repositories' runnersread:user:bitbucket- View user info (required for connection test)read:workspace:bitbucket- View your workspaces