diff --git a/src/VCS/Adapter/Git.php b/src/VCS/Adapter/Git.php index ada9c982..b14a1bec 100644 --- a/src/VCS/Adapter/Git.php +++ b/src/VCS/Adapter/Git.php @@ -99,6 +99,12 @@ abstract public function createWebhook(string $owner, string $repositoryName, st */ abstract public function createTag(string $owner, string $repositoryName, string $tagName, string $target, string $message = ''): array; + /** Whether the archive url reaches a private repository on its own. */ + public function supportsAuthenticatedArchiveUrl(): bool + { + return true; + } + /** * Get a short-lived URL to download the repository archive. * diff --git a/src/VCS/Adapter/Git/Bitbucket.php b/src/VCS/Adapter/Git/Bitbucket.php index e380f579..9c3e90b8 100644 --- a/src/VCS/Adapter/Git/Bitbucket.php +++ b/src/VCS/Adapter/Git/Bitbucket.php @@ -1413,6 +1413,15 @@ private function authenticatedBitbucketUrl(): string return str_replace('://', '://' . $userinfo . '@', $this->bitbucketUrl); } + /** + * The archive host answers a token in the url with a redirect to a login + * page. The git endpoint accepts the same token. + */ + public function supportsAuthenticatedArchiveUrl(): bool + { + return false; + } + /** * @link https://support.atlassian.com/bitbucket-cloud/kb/how-to-download-repositories-using-the-api/ *