gpt4 book ai didi

gitlab - 在 Gitlab : What are the different token scope use cases? 中添加个人访问 token

转载 作者:行者123 更新时间:2023-12-05 04:01:44 24 4
gpt4 key购买 nike

我正在将我的 GitLab 帐户连接到 PyCharm,在 GitLab 中创建 token 访问时,我不确定实际用途是什么。
我对此很陌生,所以如果有人能简化这一点,我将不胜感激。

Limiting scopes of a personam access token

最佳答案

想法是:

  • 限制您可以使用一个 PAT 执行的操作
  • 有多个 PAT 用于多种用途
  • 如果受到损害/不需要,可以轻松撤销一个 PAT,而不会使其他 PAT 失效

作为illustrated here ,如果您打算使用 PAT 作为 GitLab 密码,则需要“api”范围。
如果没有,“read_repository”或(如果您不需要克隆)“read_user”就足够了。
read_registry”仅在您的 GitLab 托管 docker 镜像作为 docker 注册表时才需要。

What I don't understand is it allows me to select all at once

那是因为每个范围都匹配一个不同的用例,可能被另一个范围覆盖。
通过全部选择它们,您涵盖了所有用例:

  • api 涵盖所有内容(这太多了,如 issue 20440 所示。GitLab 12.10,2020 年 4 月,应使用 merge request 28944read_api 范围)
  • 写入(自 GitLab 1.11,2019 年 5 月起):“Repository read-write scope for personal access tokens”。
    许多个人访问 token 依赖于 api 级别范围来进行编程更改,但完整的 API 访问权限对于某些用户或组织来说可能过于宽松。
    由于社区的贡献,个人访问 token 现在可以限定为仅读取和写入项目存储库——防止更深入的 API 访问 GitLab 的敏感区域,如设置和成员资格
  • read_usersregistry 各自针对不同的场景

gitlab-ce/merge_request 5951 中所述:

I would want us to (eventually) have separate scopes for read_user and write_user, for example.

I've looked at the OpenID Connect Core spec - it defines the profile, email, address, and phone scopes, which need to be accompanied by the openid scope.

Since we can have multiple allowable scopes for a given resource, my preference would be to leave the read_user scope here, and add in the openid and profile scopes whenever we're implementing OpenID compliance.
The presence of other scopes (like read_user and write_user) shouldn't affect the OpenID flow.

关于gitlab - 在 Gitlab : What are the different token scope use cases? 中添加个人访问 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55133245/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com