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

Breadcrumb

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

function Bitbucket::authorizeOAuth

Attempts to authorize a Bitbucket domain via OAuth

Parameters

string $originUrl The host this Bitbucket instance is located at:

Return value

bool true on success

File

vendor/composer/composer/src/Composer/Util/Bitbucket.php, line 73

Class

Bitbucket
@author Paul Wenke <wenke.paul@gmail.com>

Namespace

Composer\Util

Code

public function authorizeOAuth(string $originUrl) : bool {
    if ($originUrl !== 'bitbucket.org') {
        return false;
    }
    // if available use token from git config
    if (0 === $this->process
        ->execute([
        'git',
        'config',
        'bitbucket.accesstoken',
    ], $output)) {
        $this->io
            ->setAuthentication($originUrl, 'x-token-auth', trim($output));
        return true;
    }
    return false;
}

API Navigation

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