-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1883 from shlinkio/release/v3.6.4
Release 3.6.4
- Loading branch information
Showing
36 changed files
with
297 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shlinkio\Shlink\CLI\Command\Api; | ||
|
||
use Shlinkio\Shlink\CLI\Util\ExitCode; | ||
use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class InitialApiKeyCommand extends Command | ||
{ | ||
public const NAME = 'api-key:initial'; | ||
|
||
public function __construct(private readonly ApiKeyServiceInterface $apiKeyService) | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
protected function configure(): void | ||
{ | ||
$this | ||
->setHidden() | ||
->setName(self::NAME) | ||
->setDescription('Tries to create initial API key') | ||
->addArgument('apiKey', InputArgument::REQUIRED, 'The initial API to create'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): ?int | ||
{ | ||
$key = $input->getArgument('apiKey'); | ||
$result = $this->apiKeyService->createInitial($key); | ||
|
||
if ($result === null && $output->isVerbose()) { | ||
$output->writeln('<comment>Other API keys already exist. Initial API key creation skipped.</comment>'); | ||
} | ||
|
||
return ExitCode::EXIT_SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ShlinkioCliTest\Shlink\CLI\Command; | ||
|
||
use PHPUnit\Framework\Attributes\Test; | ||
use Shlinkio\Shlink\CLI\Command\Api\InitialApiKeyCommand; | ||
use Shlinkio\Shlink\TestUtils\CliTest\CliTestCase; | ||
|
||
class InitialApiKeyTest extends CliTestCase | ||
{ | ||
#[Test] | ||
public function createsNoKeyWhenOtherApiKeysAlreadyExist(): void | ||
{ | ||
[$output] = $this->exec([InitialApiKeyCommand::NAME, 'new_api_key', '-v']); | ||
|
||
self::assertEquals( | ||
<<<OUT | ||
Other API keys already exist. Initial API key creation skipped. | ||
OUT, | ||
$output, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.