function Bitbucket::storeInAuthConfig
Store the new/updated credentials to the configuration
2 calls to Bitbucket::storeInAuthConfig()
- Bitbucket::authorizeOAuthInteractively in vendor/
composer/ composer/ src/ Composer/ Util/ Bitbucket.php - Authorizes a Bitbucket domain interactively via OAuth
- Bitbucket::requestToken in vendor/
composer/ composer/ src/ Composer/ Util/ Bitbucket.php - Retrieves an access token from Bitbucket.
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Bitbucket.php, line 218
Class
- Bitbucket
- @author Paul Wenke <wenke.paul@gmail.com>
Namespace
Composer\UtilCode
private function storeInAuthConfig(Config\ConfigSourceInterface $authConfigSource, string $originUrl, string $consumerKey, string $consumerSecret) : void {
$this->config
->getConfigSource()
->removeConfigSetting('bitbucket-oauth.' . $originUrl);
if (null === $this->token || !isset($this->token['expires_in'])) {
throw new \LogicException('Expected a token configured with expires_in present, got ' . json_encode($this->token));
}
$time = null === $this->time ? time() : $this->time;
$consumer = [
"consumer-key" => $consumerKey,
"consumer-secret" => $consumerSecret,
"access-token" => $this->token['access_token'],
"access-token-expiration" => $time + $this->token['expires_in'],
];
$this->config
->getAuthConfigSource()
->addConfigSetting('bitbucket-oauth.' . $originUrl, $consumer);
}