Skip to content

[Refactor][Bitbucket] Support Bitbucket API tokens in place of App passwords #8520

Closed

Description

@sanjeevpenupala

What and why to refactor

Currently, the Bitbucket plugin in Apache DevLake relies on “App passwords” for authentication to Bitbucket Cloud. Bitbucket has announced that on September 9, 2025, creation of App passwords will be discontinued, and on June 9, 2026, all existing App passwords will be deactivated. After these dates, any DevLake connections using App passwords will break and fail to sync Bitbucket data.

To ensure uninterrupted operation and long-term support for Bitbucket integrations, we need to refactor the plugin to support the new Bitbucket API tokens authentication mechanism.

Describe the solution you’d like

  1. Support API token authentication
    • Add a new authentication mode in the Bitbucket connector configuration to accept API tokens in lieu of App passwords.
    • Update the DevLake client library to include the Authorization: Bearer <API_TOKEN> header when connecting to Bitbucket Cloud.
  2. Migration path and validation
    • Detect at runtime which credential type is provided (App password vs. API token) and validate accordingly.
    • Provide clear error messages if an App password is used post-deprecation or if an API token lacks required scopes.
  3. Documentation updates
    • Revise the “Connecting Bitbucket” docs to walk users through generating API tokens, the required scopes (Account:Read, Workspace membership:Read, Repositories:Read, Projects:Read, Pull requests:Read, Issues:Read, Pipelines:Read, Runners:Read), and updating their DevLake blueprint.
  4. Backward compatibility and defaults
    • Preserve existing App password support until June 9, 2026 but display deprecation warnings in logs and the UI.
    • Default new installations to require API tokens only.

Related issues

None

Additional context

Bitbucket’s in-product warning when creating App passwords:

Bitbucket App passwords deprecation warning

Activity

  1. klesh commented on Aug 4, 2025

    @klesh
    Contributor

    LGTM.
    Are you going to work on it? I can assign the issue to you if you do.

  2. sanjeevpenupala commented on Aug 4, 2025

    @sanjeevpenupala
    Author

    @klesh I would love to give it a shot, but unfortunately I don't have time in the near future to do so.

  3. klesh commented on Aug 5, 2025

    @klesh
    Contributor

    I see. Thanks for the quick response.

  4. sanjeevpenupala commented on Sep 30, 2025

    @sanjeevpenupala
    Author

    @klesh You can assign this ticket to me. I'll give it a shot.

  5. klesh commented on Oct 9, 2025

    @klesh
    Contributor

    @klesh You can assign this ticket to me. I'll give it a shot.

    Sorry for late response, just got back from holidays.

    Thanks for taking the ticket, happy coding. 💪

  6. klesh commented on Oct 9, 2025

    @klesh
    Contributor

    To move forward more quickly, you could pull in the relevant changes from @petkostas 's PR #8599 to update the Go versions in your own branch.

  7. sanjeevpenupala commented on Oct 9, 2025

    @sanjeevpenupala
    Author

    @klesh Will do. I left some comments on issues I was facing with @petkostas's PR.

    I will wait for them to respond to it.

  8. petkostas commented on Oct 10, 2025

    @petkostas
    Contributor

    Thanks @spenpal I have updated the PR bumping Go to v1.23

  9. GChannon commented on Oct 28, 2025

    @GChannon

    When will you release the bitbucket token changes?

  10. sanjeevpenupala commented on Oct 29, 2025

    @sanjeevpenupala
    Author

    @GChannon Hey, I'm primarily waiting for @petkostas's PR (#8599) to be merged first, so I can pull in those changes, since it is a pretty big Go version upgrade and will probably result in a lot of linting issues from the code I wrote.

  11. added 2 commits that reference this issue on Oct 29, 2025
    2a62b3c
    ea1bb8a
  12. GChannon commented on Nov 3, 2025

    @GChannon

    Are these changes in master?

  13. sanjeevpenupala commented on Nov 4, 2025

    @sanjeevpenupala
    Author

    @GChannon
    Yes, @klesh merged to the main branch.

  14. GChannon commented on Nov 5, 2025

    @GChannon

    Is it possible to add it to the latest beta release?

    The latest docker image doesn’t contain the changes.

  15. sanjeevpenupala commented on Nov 6, 2025

    @sanjeevpenupala
    Author

    @klesh would be able to answer that, as they are a maintainer for this project.

  16. GChannon commented on Nov 6, 2025

    @GChannon

    @klesh would be able to answer that, as they are a maintainer for this project.

    @klesh Can we get this into a beta version so I can test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions