Merge pull request #26430 from swnia/fix-gitlab-permission

Removed broad Gitlab permission from ScmAuth
This commit is contained in:
Fredrik Adelöw
2024-09-10 11:29:16 +02:00
committed by GitHub
3 changed files with 10 additions and 3 deletions
@@ -105,7 +105,7 @@ describe('ScmAuth', () => {
additionalScope: { repoWrite: true },
}),
).resolves.toMatchObject({
token: 'read_user read_api read_repository write_repository api',
token: 'read_user read_api read_repository write_repository',
});
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 api`
* `write_repository`
*/
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', 'api'],
repoWrite: ['write_repository'],
});
}