我创建了一个特殊的“bot”用户来与Redmine集成。这个想法是将此用户作为“报告者”添加到某些项目/组中作为“报告者”,以授予 Redmine 访问它们的权限。在我看来,这在 GitLab Web 界面中使用比在顶级组上创建的令牌更实用(但也许我错了,我们仍在尝试使用 GitLab)。该机器人的 GitLab 密码不会在任何地方使用,只会使用 PAT 令牌。
我转到
admin/users/<user>/impersonation_tokens
并创建一个仅具有“read_repository”权限的新令牌。
但是之后我无法克隆:
git clone https://<user>:<token>@<project_url>.git
给出:
remote: HTTP Basic: Access denied.
The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password.
See https://gitlab.alma.fr/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://<project_url>.git/'
我已检查该用户确实是该项目的成员(直接或通过组)。 我尝试过不同的令牌权限、到期日期。我还尝试将克隆 url 替换为“oauth2”、“pat”等(目前尚未检查此登录)。