Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Bitbucket.php

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\Util

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal