Allow using Bitbucket Cloud API Token for authorization#1206
Allow using Bitbucket Cloud API Token for authorization#1206verbalius wants to merge 1 commit intofluxcd:mainfrom
Conversation
|
We do not need to establish these special values for username in order to branch off the code to comp := strings.Split(token, ":")
if len(comp) != 2 {
return nil, errors.New("invalid token format, expected to be <user>:<password>")
}
username := comp[0]
password := comp[1]This is very unfortunate, because we also support username+password inputs in the referenced secret. @verbalius How is bitbucket handling this deprecation? Has username+password stopped working completely? I ask this because I'd like to fix this code to do the right thing (if token is set, use @stefanprodan Thoughts? |
|
@matheuscscp Hi, Matheus! Thanks for looking at this pull request. |
Bitbucket deprecated app paswords and tells users to use API tokens instead. But API tokens (for example repo api tokens) they don't work with username:password scheme where username is the bot email. This pull request changes auth to NewOAuthbearerToken if the username is
x-api-token-authorx-bitbucket-api-token-authas Bitbucket tells in the documentation.https://developer.atlassian.com/cloud/bitbucket/rest/intro/#app-passwords
Before the change I was always getting the 401 error (tried various combinations of email, username, personal tokens and repo tokens)

After a change it works
