oauth: widen bitbucket default scopes and add scope_options

Bitbucket ignores scope on authorize but narrows the token to the scope sent
on refresh, so every Connect token dropped to repository (read) at its first
refresh. Default to account + repository/pullrequest/pipeline read and write,
add cc_scopes for client credentials, and offer repository:admin, snippet and
webhook as options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hugocasa
2026-10-22 17:17:35 +02:00
co-authored by Claude Opus 5.5
parent 5ef19a88a9
commit 4d6e5e6cbc
+30 -1
View File
@@ -14,7 +14,36 @@
"auth_url": "https://bitbucket.org/site/oauth2/authorize",
"token_url": "https://bitbucket.org/site/oauth2/access_token",
"grant_types": ["authorization_code", "client_credentials"],
"scopes": ["repository"]
"scopes": [
"account",
"repository",
"repository:write",
"pullrequest",
"pullrequest:write",
"pipeline",
"pipeline:write"
],
"cc_scopes": [
"account",
"repository",
"repository:write",
"pullrequest",
"pullrequest:write",
"pipeline",
"pipeline:write"
],
"scope_options": [
{ "value": "account", "label": "Read your account and workspaces" },
{ "value": "repository", "label": "Read repositories" },
{ "value": "repository:write", "label": "Push to repositories, create branches and tags" },
{ "value": "repository:admin", "label": "Create and administer repositories" },
{ "value": "pullrequest", "label": "Read pull requests" },
{ "value": "pullrequest:write", "label": "Create, comment on, approve and merge pull requests" },
{ "value": "pipeline", "label": "Read pipelines" },
{ "value": "pipeline:write", "label": "Run and stop pipelines" },
{ "value": "snippet", "label": "Read and comment on snippets" },
{ "value": "webhook", "label": "Manage webhooks" }
]
},
"slack": {
"auth_url": "https://slack.com/oauth/v2/authorize",