Move bearer auth to be first to make sure it does not get shadowed by github/gitlab/.. configs
parent
cbec8ceb53
commit
479414d8bd
|
@ -817,7 +817,9 @@ class RemoteFilesystem
|
||||||
if ($this->io->hasAuthentication($originUrl)) {
|
if ($this->io->hasAuthentication($originUrl)) {
|
||||||
$authenticationDisplayMessage = null;
|
$authenticationDisplayMessage = null;
|
||||||
$auth = $this->io->getAuthentication($originUrl);
|
$auth = $this->io->getAuthentication($originUrl);
|
||||||
if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
|
if ($auth['password'] === 'bearer') {
|
||||||
|
$headers[] = 'Authorization: Bearer '.$auth['username'];
|
||||||
|
} elseif ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) {
|
||||||
$options['github-token'] = $auth['username'];
|
$options['github-token'] = $auth['username'];
|
||||||
$authenticationDisplayMessage = 'Using GitHub token authentication';
|
$authenticationDisplayMessage = 'Using GitHub token authentication';
|
||||||
} elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) {
|
} elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) {
|
||||||
|
@ -835,8 +837,6 @@ class RemoteFilesystem
|
||||||
$headers[] = 'Authorization: Bearer ' . $auth['password'];
|
$headers[] = 'Authorization: Bearer ' . $auth['password'];
|
||||||
$authenticationDisplayMessage = 'Using Bitbucket OAuth token authentication';
|
$authenticationDisplayMessage = 'Using Bitbucket OAuth token authentication';
|
||||||
}
|
}
|
||||||
} elseif ($auth['password'] === 'bearer' ) {
|
|
||||||
$headers[] = 'Authorization: Bearer '.$auth['username'];
|
|
||||||
} else {
|
} else {
|
||||||
$authStr = base64_encode($auth['username'] . ':' . $auth['password']);
|
$authStr = base64_encode($auth['username'] . ':' . $auth['password']);
|
||||||
$headers[] = 'Authorization: Basic '.$authStr;
|
$headers[] = 'Authorization: Basic '.$authStr;
|
||||||
|
|
Loading…
Reference in New Issue