Gitlab私人令牌许可

发布于 2025-02-10 10:53:45 字数 220 浏览 0 评论 0原文

是否可以检查我们连接到GitLab的私人令牌的范围 /权限? 在BASH脚本中,我想检查是否可以使用我授权的令牌创建分支。 此命令只会返回所有令牌的列表,我想检查授权的洗涤。

curl -s --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" "https://gitlab.com/api/v4/personal_access_tokens"

Is it possible to check the scope / permissions of the private token that we connect to gitlab?
In the bash script I would like to check if I can create a branch with the token that I authorize.
This command only returns me a list of all tokens, and I would like to check what washing is the one that authorizes.

curl -s --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" "https://gitlab.com/api/v4/personal_access_tokens"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦屿孤独相伴 2025-02-17 10:53:45

获得GitLab令牌ID后,您需要在卷发中添加一些后处理:

curl -s --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
  "https://gitlab.com/api/v4/personal_access_tokens" | \
  jq '.[] | select(.id == ${GITLAB_TOKEN_ID}).scopes'

You would need to add some post-processing to your curl, after getting your GitLab token ID:

curl -s --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
  "https://gitlab.com/api/v4/personal_access_tokens" | \
  jq '.[] | select(.id == ${GITLAB_TOKEN_ID}).scopes'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文