Avoid retrying forever if a gitlab token has insufficient rights, fixes #6189
parent
6afc844339
commit
63447cf724
|
@ -591,6 +591,11 @@ class RemoteFilesystem
|
|||
} elseif ($this->config && in_array($this->originUrl, $this->config->get('gitlab-domains'), true)) {
|
||||
$message = "\n".'Could not fetch '.$this->fileUrl.', enter your ' . $this->originUrl . ' credentials ' .($httpStatus === 401 ? 'to access private repos' : 'to go over the API rate limit');
|
||||
$gitLabUtil = new GitLab($this->io, $this->config, null);
|
||||
|
||||
if ($this->io->hasAuthentication($this->originUrl) && ($auth = $this->io->getAuthentication($this->originUrl)) && $auth['password'] === 'private-token') {
|
||||
throw new TransportException("Invalid credentials for '" . $this->fileUrl . "', aborting.", $httpStatus);
|
||||
}
|
||||
|
||||
if (!$gitLabUtil->authorizeOAuth($this->originUrl)
|
||||
&& (!$this->io->isInteractive() || !$gitLabUtil->authorizeOAuthInteractively($this->scheme, $this->originUrl, $message))
|
||||
) {
|
||||
|
|
Loading…
Reference in New Issue