Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-22436

Download repository archives with repository access tokens

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      The archives on the Downloads page of the repo can be downloaded programmatically with basic authentication, as follows

      curl -u BB_Username:BB_AppPassword https://bitbucket.org/<workspace-id>/<repo-slug>/get/1.0.zip -o 1.0.zip

      However, this is not currently possible with a Repository access token. If someone is writing a script to download an archive, and that script can be accessed by other users as well, then their app password gets exposed to other users.

      Suggested Solution

      Support the download of repo archives using a Repository access token.

      Workaround

      A Git command can be used to clone the repo. If an archive of a certain tag or branch is needed, then the following command can be used to clone a specific tag or branch

      git clone --depth 1 --branch <branch_or_tag> https://x-token-auth@bitbucket.org/<workspace-id>/<repo-slug>.git

      <branch_or_tag> can be either a branch name or a tag name.
      --depth 1 is optional. If we only need the source code, then it may not be useful to clone the whole history.

      If only the source code files are needed and not the history, then the .git folder inside the repo can be deleted after the clone.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tboudale Theodora Boudale
              Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: