Skip to content
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

BitBucket Publish doesn't work if user and owner are different #6292

Closed
sr258 opened this issue Sep 27, 2021 · 0 comments · Fixed by #6293
Closed

BitBucket Publish doesn't work if user and owner are different #6292

sr258 opened this issue Sep 27, 2021 · 0 comments · Fixed by #6293

Comments

@sr258
Copy link
Contributor

sr258 commented Sep 27, 2021

The way BitbucketPublisher is written, you can't use it to publish to repositories if you are not the owner of them.

It constructs the API endpoint like this:

this.basePath = `/2.0/repositories/${this.info.owner}/${this.info.slug}/downloads`

And the HTTP Basic auth header is created like this:

static convertAppPassword(owner: string, token: string) {
const base64encodedData = Buffer.from(`${owner}:${token.trim()}`).toString("base64")
return `Basic ${base64encodedData}`
}

As you can see, owner and acting user must be identical. There can be situations in which you want to push to an organisation's repository and the username you're using is not identical to the organisation's name.

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

Successfully merging a pull request may close this issue.

1 participant