tektoncd / tektoncd/pipelines-as-code

Bitbucket server with bearer tokens

Open
#1,338 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority/medium
Dominant language
Go
Stars
214
Forks
144
Avg merge
2d 11h
Merged PRs (30d)
27

Description

Hi, 👋🏻

I'm testing PAC with Bitbucket Server.

With a personal access token (username/token) I can get it to work fine.

I'm trying to test with a project bearer token, which doesn't require a username.

I know the bearer token works with curl

BEARER='bear_token_here'
PROJECT="project_name"
REPO="repo_name"

curl  \
  --insecure \
    --header "Authorization: Bearer ${BEARER}" \
    https://bitbucket.mycorp/bitbucket/rest/api/latest/projects/${PROJECT}/repos/${REPO}/commits

But when I define the Repository resource, I receive an error if I leave the username out, as shown here

I thought I might get away with a placeholder username, but looks like basicAuth is the only option at present when I look here

Have I missed an option somewhere to setup Bitbucket server with a Bearer token?

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/provider/bitbucketserver/bitbucketserver.go at the Repository configuration and authentication handling referenced in the issue. Compare the working curl request with the current basicAuth setup, then verify that a Bitbucket Server project bearer token can be configured without a username and used for the repository request.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.