From 54e700bf366f97f227c05dd9f924eaa695708575 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 14:51:57 +0100 Subject: [PATCH 1/6] Added support for Symfony 8 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d94443c..b76f8db 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,12 @@ ], "require": { "php": "^8.0", - "symfony/http-client": "^6.4|^7.0", + "symfony/http-client": "^6.4 || ^7.0 || ^8.0", "nyholm/psr7": "^1.8", "itk-dev/vault": "^0.1.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/config": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0" + "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", + "symfony/config": "^6.4 || ^7.0 || ^8.0", + "symfony/http-kernel": "^6.4 || ^7.0 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.64" From b233a1419e4c4ba41bb7e6fd820a87bde05be187 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 14:54:41 +0100 Subject: [PATCH 2/6] Validated input options --- src/Command/VaultSecretCommand.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Command/VaultSecretCommand.php b/src/Command/VaultSecretCommand.php index 0fb2212..5aa92af 100644 --- a/src/Command/VaultSecretCommand.php +++ b/src/Command/VaultSecretCommand.php @@ -6,9 +6,10 @@ use ItkDev\Vault\Exception\VaultException; use ItkDev\Vault\Model\Secret; use ItkDev\VaultBundle\Service\Vault; -use Psr\SimpleCache\InvalidArgumentException; +use Psr\SimpleCache\InvalidArgumentException as PsrSimpleCacheInvalidArgumentException; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -42,7 +43,7 @@ protected function configure(): void } /** - * @throws InvalidArgumentException + * @throws PsrSimpleCacheInvalidArgumentException * @throws NotFoundException * @throws VaultException * @throws \DateMalformedIntervalStringException @@ -53,8 +54,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io = new SymfonyStyle($input, $output); $path = $input->getOption('path'); + if (null === $path) { + throw new InvalidArgumentException('The path option is required.'); + } $secret = $input->getOption('secret'); + if (null === $secret) { + throw new InvalidArgumentException('The secret option is required.'); + } $keys = $input->getOption('keys'); + if (empty($keys)) { + throw new InvalidArgumentException('At least one key must be specified.'); + } $version = $input->getOption('version-id'); $useCache = $input->getOption('useCache'); From 1f08e143fae7bf6d827a3eca8b4ea60142a31365 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 14:56:03 +0100 Subject: [PATCH 3/6] Renamed option --- src/Command/VaultSecretCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/VaultSecretCommand.php b/src/Command/VaultSecretCommand.php index 5aa92af..d6c9c0c 100644 --- a/src/Command/VaultSecretCommand.php +++ b/src/Command/VaultSecretCommand.php @@ -34,7 +34,7 @@ protected function configure(): void $this ->addOption('path', null, InputOption::VALUE_REQUIRED, 'Vault secret engine path)') ->addOption('secret', null, InputOption::VALUE_REQUIRED, 'Name of the secret to fetch') - ->addOption('keys', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'List of secret keys to fetch') + ->addOption('key', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'List of secret keys to fetch') ->addOption('version-id', null, InputOption::VALUE_REQUIRED, 'Version of the secret to fetch') ->addOption('useCache', null, InputOption::VALUE_NONE, 'Cache the token and secrets fetched') ->addOption('expire', null, InputOption::VALUE_REQUIRED, 'For how long the secrets should be cached (in seconds). The token will be cached based on its expiration time.') @@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (null === $secret) { throw new InvalidArgumentException('The secret option is required.'); } - $keys = $input->getOption('keys'); + $keys = $input->getOption('key'); if (empty($keys)) { throw new InvalidArgumentException('At least one key must be specified.'); } From fc735a359a25e898de895c138937119d0ecda1ed Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 14:57:42 +0100 Subject: [PATCH 4/6] Fixed typos --- README.md | 2 +- src/Command/VaultLoginCommand.php | 2 +- src/Command/VaultSecretCommand.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53a7de8..e4d24a2 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ App\Command\TestCommand: This bundle also comes with two CLI commands to help debug configuration and to check that you fetch the expected data from the vault. Use the `--help` option -to symfony console to see the options available for the commands. +to Symfony console to see the options available for the commands. * `itkdev:vault:login` * `itkdev:vault:secret` diff --git a/src/Command/VaultLoginCommand.php b/src/Command/VaultLoginCommand.php index 142da7f..6411bb9 100644 --- a/src/Command/VaultLoginCommand.php +++ b/src/Command/VaultLoginCommand.php @@ -30,7 +30,7 @@ protected function configure(): void { $this ->addOption('engine-path', null, InputOption::VALUE_REQUIRED, 'Authentication engine path', 'approle') - ->addOption('refresh', null, InputOption::VALUE_NONE, 'Refresh token from the vault (by-passing the cache)') + ->addOption('refresh', null, InputOption::VALUE_NONE, 'Refresh token from the vault (bypassing the cache)') ; } diff --git a/src/Command/VaultSecretCommand.php b/src/Command/VaultSecretCommand.php index d6c9c0c..cc5d739 100644 --- a/src/Command/VaultSecretCommand.php +++ b/src/Command/VaultSecretCommand.php @@ -32,13 +32,13 @@ public function __construct( protected function configure(): void { $this - ->addOption('path', null, InputOption::VALUE_REQUIRED, 'Vault secret engine path)') + ->addOption('path', null, InputOption::VALUE_REQUIRED, 'Vault secret engine path') ->addOption('secret', null, InputOption::VALUE_REQUIRED, 'Name of the secret to fetch') ->addOption('key', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'List of secret keys to fetch') ->addOption('version-id', null, InputOption::VALUE_REQUIRED, 'Version of the secret to fetch') ->addOption('useCache', null, InputOption::VALUE_NONE, 'Cache the token and secrets fetched') ->addOption('expire', null, InputOption::VALUE_REQUIRED, 'For how long the secrets should be cached (in seconds). The token will be cached based on its expiration time.') - ->addOption('refresh', null, InputOption::VALUE_NONE, 'Should both token and secrets be refreshed from the vault (by-passing the cache)') + ->addOption('refresh', null, InputOption::VALUE_NONE, 'Should both token and secrets be refreshed from the vault (bypassing the cache)') ; } From 56b63f31438a3d45c6b2d055b30ca8e803191a23 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 14:58:06 +0100 Subject: [PATCH 5/6] Updated installation instructions --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4d24a2..bf32fa0 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,12 @@ retrieval of secrets directly in `.env` files at runtime. ## Install ```shell -composer require itk-dev/vault-bundle +composer require itk-dev/vault-bundle --no-scripts ``` +> [!NOTE] +> We use `--no-scripts` since the bundle config may not yet have been created. + ### Setup Create a configuration file at `config/packages/itkdev_vault.yaml` and add the From 2efb5e52ac85782651ad15fe36dfa9aea16597fb Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 12 Jan 2026 15:05:29 +0100 Subject: [PATCH 6/6] Updated changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb0f96..0e4a7e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log. ## [Unreleased] +* Added support for Symfony 8 + ## [0.1.2] * Fixed action to auto create github release @@ -44,8 +46,8 @@ See [keep a changelog] for information about writing changes to this log. * Basic bundle setup. [keep a changelog]: https://keepachangelog.com/en/1.1.0/ -[Unreleased]: https://github.com/itk-dev/vault-bundle/compare/0.1.0...head -[0.1.1]: https://github.com/itk-dev/vault-library/compare/0.1.1...0.1.2 +[Unreleased]: https://github.com/itk-dev/vault-bundle/compare/0.1.2...head +[0.1.2]: https://github.com/itk-dev/vault-library/compare/0.1.1...0.1.2 [0.1.1]: https://github.com/itk-dev/vault-library/compare/0.1.0...0.1.1 [0.1.0]: https://github.com/itk-dev/vault-library/compare/0.0.4...0.1.0 [0.0.4]: https://github.com/itk-dev/vault-library/compare/0.0.3...0.0.4