• 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.

      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.

            [BCLOUD-22436] Download repository archives with repository access tokens

            Are credentials exposed if used in repository / workspace variables and referenced in the script with $PASSWORD?

            Andrew Clark added a comment - Are credentials exposed if used in repository / workspace variables and referenced in the script with $PASSWORD?

            Christophe Faribault added a comment - - edited

            Same goes for files under "Downloads" like:

            https://api.bitbucket.org/2.0/repositories/<owner>/<repo>/downloads/file.yml

            This would be very useful for automated build/release where software builds are pushed to the repo.

            Christophe Faribault added a comment - - edited Same goes for files under "Downloads" like: https: //api.bitbucket.org/2.0/repositories/<owner>/<repo>/downloads/file.yml This would be very useful for automated build/release where software builds are pushed to the repo.

              Unassigned Unassigned
              tboudale Theodora Boudale
              Votes:
              14 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: