feat(auth): enable persistency of scopes for Bitbucket Cloud

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2025-02-18 19:25:49 +01:00
parent ac69654f3d
commit 5d10f99e53
4 changed files with 13 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-bitbucket-provider': patch
---
Enabled persistency of scopes for Bitbucket Cloud.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/integration-react': patch
---
Added scopes `project` and `repository:admin` for Bitbucket Cloud.
@@ -239,11 +239,13 @@ export class ScmAuth implements ScmAuthApi {
'pullrequest',
'snippet',
'issue',
'project',
];
const repoWriteScopes = options?.scopeMapping?.repoWrite ?? [
'pullrequest:write',
'snippet:write',
'issue:write',
'repository:admin',
];
return new ScmAuth('bitbucket', bitbucketAuthApi, host, {
default: defaultScopes,
@@ -28,6 +28,7 @@ export const bitbucketAuthenticator = createOAuthAuthenticator({
PassportOAuthAuthenticatorHelper.defaultProfileTransform,
scopes: {
required: ['account'],
persist: true,
},
initialize({ callbackUrl, config }) {
const clientID = config.getString('clientId');