From 4d6e5e6cbc298d0577be18cee9cdd29ab89e1114 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Thu, 22 Oct 2026 17:17:35 +0200 Subject: [PATCH] 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 --- backend/oauth_connect.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/backend/oauth_connect.json b/backend/oauth_connect.json index 611e3f7c17..32c85284f3 100644 --- a/backend/oauth_connect.json +++ b/backend/oauth_connect.json @@ -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",