1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Added token refresh for GitLab to support GitLab 15+ (#10988)

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
This commit is contained in:
Thomas Lüder 2022-08-16 13:34:18 +02:00 committed by GitHub
parent 41a13fa0a1
commit 41d6467b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 131 additions and 7 deletions

View file

@ -30,6 +30,8 @@ class GitLabTest extends TestCase
private $origin = 'gitlab.com';
/** @var string */
private $token = 'gitlabtoken';
/** @var string */
private $refreshtoken = 'gitlabrefreshtoken';
public function testUsernamePasswordAuthenticationFlow(): void
{
@ -54,7 +56,7 @@ class GitLabTest extends TestCase
$httpDownloader = $this->getHttpDownloaderMock();
$httpDownloader->expects(
[['url' => sprintf('http://%s/oauth/token', $this->origin), 'body' => sprintf('{"access_token": "%s", "token_type": "bearer", "expires_in": 7200}', $this->token)]],
[['url' => sprintf('http://%s/oauth/token', $this->origin), 'body' => sprintf('{"access_token": "%s", "refresh_token": "%s", "token_type": "bearer", "expires_in": 7200, "created_at": 0}', $this->token, $this->refreshtoken)]],
true
);