From 147c6a2f7eaba86daefbd2cff2e111168ffa1187 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 31 Mar 2022 12:29:19 +0100 Subject: [PATCH] Bitbucket: when OAuth consumer authentication fails mention that the `This is a private consumer` needs to be enabled (#10678) --- src/Composer/Util/Bitbucket.php | 3 ++- tests/Composer/Test/Util/BitbucketTest.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Composer/Util/Bitbucket.php b/src/Composer/Util/Bitbucket.php index 970225560..c74870b67 100644 --- a/src/Composer/Util/Bitbucket.php +++ b/src/Composer/Util/Bitbucket.php @@ -112,9 +112,10 @@ class Bitbucket } catch (TransportException $e) { if ($e->getCode() === 400) { $this->io->writeError('Invalid OAuth consumer provided.'); - $this->io->writeError('This can have two reasons:'); + $this->io->writeError('This can have three reasons:'); $this->io->writeError('1. You are authenticating with a bitbucket username/password combination'); $this->io->writeError('2. You are using an OAuth consumer, but didn\'t configure a (dummy) callback url'); + $this->io->writeError('3. You are using an OAuth consumer, but didn\'t configure it as private consumer'); return false; } diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index 5d1b83c25..9a1b39cf6 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -197,9 +197,10 @@ class BitbucketTest extends TestCase ->method('writeError') ->withConsecutive( array('Invalid OAuth consumer provided.'), - array('This can have two reasons:'), + array('This can have three reasons:'), array('1. You are authenticating with a bitbucket username/password combination'), - array('2. You are using an OAuth consumer, but didn\'t configure a (dummy) callback url') + array('2. You are using an OAuth consumer, but didn\'t configure a (dummy) callback url'), + array('3. You are using an OAuth consumer, but didn\'t configure it as private consumer') ); $this->httpDownloader->expects($this->once())