Merge pull request #26841 from swnia/rollback-gitlab-permissions

Revert of #26430
This commit is contained in:
Ben Lambert
2024-09-27 10:50:08 +02:00
committed by GitHub
4 changed files with 9 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/integration-react': patch
---
Revert of change #26430
+1
View File
@@ -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).
@@ -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);
@@ -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'],
});
}