Skip to content

Commit

Permalink
increase expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Oct 31, 2023
1 parent 6e44162 commit 7036c9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Command/CodeStudio/CodeStudioWizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Acquia\Cli\Command\WizardCommandBase;
use Acquia\Cli\Output\Checklist;
use AcquiaCloudApi\Endpoints\Account;
use DateTime;
use Gitlab\Exception\ValidationFailedException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -161,10 +162,9 @@ private function createProjectAccessToken(array $project, string $projectAccessT
$this->checklist->completePreviousItem();
}
$this->checklist->addItem("Creating access token named <comment>$projectAccessTokenName</comment>");
$dateTime = new \DateTime('tomorrow');
$projectAccessToken = $this->gitLabClient->projects()
->createProjectAccessToken($project['id'], [
'expires_at' => $dateTime,
'expires_at' => new DateTime('+365 days'),
'name' => $projectAccessTokenName,
'scopes' => ['api', 'write_repository'],
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Acquia\Cli\Tests\Commands\Ide\IdeRequiredTestTrait;
use Acquia\Cli\Tests\Commands\WizardTestBase;
use Acquia\Cli\Tests\TestBase;
use DateTime;
use Gitlab\Api\Groups;
use Gitlab\Api\ProjectNamespaces;
use Gitlab\Api\Schedules;
Expand Down Expand Up @@ -270,13 +271,12 @@ public function testMissingGitLabCredentials(): void {
}

protected function mockGitLabProjectsTokens(ObjectProphecy $projects): void {
$dateTime = new \DateTime('tomorrow');
$tokens = [
0 => [
'access_level' => 40,
'active' => TRUE,
'created_at' => '2021-12-28T20:08:21.629Z',
'expires_at' => $dateTime,
'expires_at' => new DateTime('+365 days'),
'id' => $this->gitLabTokenId,
'name' => 'acquia-codestudio',
'revoked' => FALSE,
Expand All @@ -287,7 +287,7 @@ protected function mockGitLabProjectsTokens(ObjectProphecy $projects): void {
'user_id' => 154,
],
];
$projects->projectAccessTokens($this->gitLabProjectId)->willReturn($tokens);
$projects->projectAccessTokens($this->gitLabProjectId)->willReturn($tokens)->shouldBeCalled();
$projects->deleteProjectAccessToken($this->gitLabProjectId, $this->gitLabTokenId);
$token = $tokens[0];
$token['token'] = 'token';
Expand Down

0 comments on commit 7036c9d

Please sign in to comment.