|
@@ -171,7 +171,7 @@ EOT
|
|
}
|
|
}
|
|
if ($input->getOption('global') && !$this->authConfigFile->exists()) {
|
|
if ($input->getOption('global') && !$this->authConfigFile->exists()) {
|
|
touch($this->authConfigFile->getPath());
|
|
touch($this->authConfigFile->getPath());
|
|
- $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'http-basic' => new \ArrayObject));
|
|
|
|
|
|
+ $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject));
|
|
Silencer::call('chmod', $this->authConfigFile->getPath(), 0600);
|
|
Silencer::call('chmod', $this->authConfigFile->getPath(), 0600);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -510,7 +510,7 @@ EOT
|
|
}
|
|
}
|
|
|
|
|
|
// handle auth
|
|
// handle auth
|
|
- if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|http-basic)\.(.+)/', $settingKey, $matches)) {
|
|
|
|
|
|
+ if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic)\.(.+)/', $settingKey, $matches)) {
|
|
if ($input->getOption('unset')) {
|
|
if ($input->getOption('unset')) {
|
|
$this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
$this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
@@ -524,7 +524,7 @@ EOT
|
|
}
|
|
}
|
|
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
|
|
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
|
|
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
|
|
- } elseif ($matches[1] === 'github-oauth' || $matches[1] === 'gitlab-oauth') {
|
|
|
|
|
|
+ } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token'), true)) {
|
|
if (1 !== count($values)) {
|
|
if (1 !== count($values)) {
|
|
throw new \RuntimeException('Too many arguments, expected only one token');
|
|
throw new \RuntimeException('Too many arguments, expected only one token');
|
|
}
|
|
}
|