diff --git a/.changeset/four-moons-watch.md b/.changeset/four-moons-watch.md new file mode 100644 index 0000000000..3d0b25c1d5 --- /dev/null +++ b/.changeset/four-moons-watch.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration-react': patch +--- + +Revert of change #26430 diff --git a/docs/auth/gitlab/provider.md b/docs/auth/gitlab/provider.md index 73546411bf..4f5339f5b9 100644 --- a/docs/auth/gitlab/provider.md +++ b/docs/auth/gitlab/provider.md @@ -19,6 +19,7 @@ should point to your Backstage backend auth handler. 1. Set this to `http://localhost:7007/api/auth/gitlab/handler/frame` for local development. 2. Set this to `http://{APP_FQDN}:{APP_BACKEND_PORT}/api/auth/gitlab/handler/frame` for non-local deployments. 3. Select the following scopes from the list: + - [x] `api` Grants full read-write access to the api. This is only required if users need to be able to create merge requests with their own permissions. - [x] `read_user` Grants read-only access to the authenticated user's profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users. - [x] `read_repository` Grants read-only access to repositories on private projects using Git-over-HTTP (not using the API). - [x] `write_repository` Grants read-write access to repositories on private projects using Git-over-HTTP (not using the API). diff --git a/packages/integration-react/src/api/ScmAuth.test.ts b/packages/integration-react/src/api/ScmAuth.test.ts index e63ce2844c..d252b95b85 100644 --- a/packages/integration-react/src/api/ScmAuth.test.ts +++ b/packages/integration-react/src/api/ScmAuth.test.ts @@ -105,7 +105,7 @@ describe('ScmAuth', () => { additionalScope: { repoWrite: true }, }), ).resolves.toMatchObject({ - token: 'read_user read_api read_repository write_repository', + token: 'read_user read_api read_repository write_repository api', }); const azureAuth = ScmAuth.forAzure(mockAuthApi); diff --git a/packages/integration-react/src/api/ScmAuth.ts b/packages/integration-react/src/api/ScmAuth.ts index 6257915c8c..f848a71d8b 100644 --- a/packages/integration-react/src/api/ScmAuth.ts +++ b/packages/integration-react/src/api/ScmAuth.ts @@ -162,7 +162,7 @@ export class ScmAuth implements ScmAuthApi { * * If the additional `repoWrite` permission is requested, these scopes are added: * - * `write_repository` + * `write_repository api` */ static forGitlab( gitlabAuthApi: OAuthApi, @@ -173,7 +173,7 @@ export class ScmAuth implements ScmAuthApi { const host = options?.host ?? 'gitlab.com'; return new ScmAuth('gitlab', gitlabAuthApi, host, { default: ['read_user', 'read_api', 'read_repository'], - repoWrite: ['write_repository'], + repoWrite: ['write_repository api'], }); }