Open giveadamakick opened 7 months ago
Hi @giveadamakick, have you tried using oauth_token/BITBUCKET_OAUTH_TOKEN ? at the very least it implents this as a bearer token
Hi @DrFaust92, I had tried setting BITBUCKET_OAUTH_TOKEN
to my workspace access token, and it failed with an Error: unexpected end of JSON input
message for multiple resources when I did a terraform plan
. I had assumed that this was because workspace access tokens were unsupported.
Looking at the particular resources that failed more closely, I now see that they are all bitbucket_group
resources. My best guess is that in fact these errors are related to the "You can't use an Access Token to manipulate or query repository, project, or workspace permissions." restriction as stated here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#considerations-for-using-access-tokens
Long story short, setting BITBUCKET_OAUTH_TOKEN
to an access token does indeed seem to work. I still think it would be good to more intuitively support access tokens rather than shoehorning into the OAuth token var.
Terraform Version
1.6.4
Affected Resource(s)
Authentication
Terraform Configuration Files
Alternative:
BITBUCKET_ACCESS_TOKEN
environment variable set.Expected Behavior
The provider uses the access token to authenticate with Bitbucket Cloud.
Actual Behavior
access_token
/BITBUCKET_ACCESS_TOKEN
are not supported.Steps to Reproduce
terraform apply
Important Factoids
Using Workspace Access Tokens describes how to use the token when calling the Bitbucket Cloud API (via a header like this:
Authorization: Bearer <workspace_access_token>
).Project tokens and repo tokens use exactly the same auth mechanism.
References
161