Constants

OAUTH2_ACCESS_TOKEN_URL

OAUTH2_ACCESS_TOKEN_URL = 'https://bitbucket.org/site/oauth2/access_token'

Properties

$io

$io : 

Type

$config

$config : 

Type

$process

$process : 

Type

$remoteFilesystem

$remoteFilesystem : 

Type

$token

$token : 

Type

$time

$time : 

Type

Methods

__construct()

__construct(\Composer\IO\IOInterface  $io, \Composer\Config  $config, \Composer\Util\ProcessExecutor  $process = null, \Composer\Util\RemoteFilesystem  $remoteFilesystem = null, integer  $time = null) 

Constructor.

Parameters

\Composer\IO\IOInterface $io

The IO instance

\Composer\Config $config

The composer configuration

\Composer\Util\ProcessExecutor $process

Process instance, injectable for mocking

\Composer\Util\RemoteFilesystem $remoteFilesystem

Remote Filesystem, injectable for mocking

integer $time

Timestamp, injectable for mocking

getToken()

getToken() : string

Returns

string

authorizeOAuth()

authorizeOAuth(string  $originUrl) : boolean

Attempts to authorize a Bitbucket domain via OAuth

Parameters

string $originUrl

The host this Bitbucket instance is located at

Returns

boolean —

true on success

authorizeOAuthInteractively()

authorizeOAuthInteractively(string  $originUrl, string  $message = null) : boolean

Authorizes a Bitbucket domain interactively via OAuth

Parameters

string $originUrl

The host this Bitbucket instance is located at

string $message

The reason this authorization is required

Throws

\RuntimeException
\Composer\Downloader\TransportException|\Exception

Returns

boolean —

true on success

requestToken()

requestToken(string  $originUrl, string  $consumerKey, string  $consumerSecret) : string

Retrieves an access token from Bitbucket.

Parameters

string $originUrl
string $consumerKey
string $consumerSecret

Returns

string

requestAccessToken()

requestAccessToken(string  $originUrl) : boolean

Parameters

string $originUrl

Returns

boolean

storeInAuthConfig()

storeInAuthConfig(string  $originUrl, string  $consumerKey, string  $consumerSecret) 

Store the new/updated credentials to the configuration

Parameters

string $originUrl
string $consumerKey
string $consumerSecret

getTokenFromConfig()

getTokenFromConfig(string  $originUrl) : boolean

Parameters

string $originUrl

Returns

boolean