Skip to content

Commit c89b0dc

Browse files
committed
Resolve conflicts
2 parents 0ef6de1 + 3c6452f commit c89b0dc

25 files changed

+104
-97
lines changed

src/Component/Console/AddKeyIntoKeysetCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
use Jose\Component\Core\JWK;
1111
use Jose\Component\Core\JWKSet;
1212
use Jose\Component\Core\Util\JsonConverter;
13+
use Symfony\Component\Console\Attribute\AsCommand;
1314
use Symfony\Component\Console\Input\InputArgument;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617

18+
#[AsCommand(name: 'keyset:add:key', description: 'Add a key into a key set.')]
1719
final class AddKeyIntoKeysetCommand extends ObjectOutputCommand
1820
{
19-
protected static $defaultName = 'keyset:add:key';
20-
2121
protected function configure(): void
2222
{
2323
parent::configure();
24-
$this->setDescription('Add a key into a key set.')
24+
$this
2525
->setHelp('This command adds a key at the end of a key set.')
2626
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object')
2727
->addArgument('jwk', InputArgument::REQUIRED, 'The new JWK object');

src/Component/Console/EcKeyGeneratorCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
use InvalidArgumentException;
88
use function is_string;
99
use Jose\Component\KeyManagement\JWKFactory;
10+
use Symfony\Component\Console\Attribute\AsCommand;
1011
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314

15+
#[AsCommand(name: 'key:generate:ec', description: 'Generate an EC key (JWK format)')]
1416
final class EcKeyGeneratorCommand extends GeneratorCommand
1517
{
16-
protected static $defaultName = 'key:generate:ec';
17-
1818
protected function configure(): void
1919
{
2020
parent::configure();
2121
$this->setDescription('Generate an EC key (JWK format)')
22-
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the key.');
22+
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the key.')
23+
;
2324
}
2425

2526
protected function execute(InputInterface $input, OutputInterface $output): int

src/Component/Console/EcKeysetGeneratorCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
use function is_string;
99
use Jose\Component\Core\JWKSet;
1010
use Jose\Component\KeyManagement\JWKFactory;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112
use Symfony\Component\Console\Input\InputArgument;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

16+
#[AsCommand(name: 'keyset:generate:ec', description: 'Generate an EC key set (JWKSet format)')]
1517
final class EcKeysetGeneratorCommand extends GeneratorCommand
1618
{
17-
protected static $defaultName = 'keyset:generate:ec';
18-
1919
protected function configure(): void
2020
{
2121
parent::configure();
22-
$this->setDescription('Generate an EC key set (JWKSet format)')
22+
$this
2323
->addArgument('quantity', InputArgument::REQUIRED, 'Quantity of keys in the key set.')
2424
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the keys.');
2525
}

src/Component/Console/GetThumbprintCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
use function is_string;
1010
use Jose\Component\Core\JWK;
1111
use Jose\Component\Core\Util\JsonConverter;
12+
use Symfony\Component\Console\Attribute\AsCommand;
1213
use Symfony\Component\Console\Input\InputArgument;
1314
use Symfony\Component\Console\Input\InputInterface;
1415
use Symfony\Component\Console\Input\InputOption;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617

18+
#[AsCommand(name: 'key:thumbprint', description: 'Get the thumbprint of a JWK key.')]
1719
final class GetThumbprintCommand extends ObjectOutputCommand
1820
{
19-
protected static $defaultName = 'key:thumbprint';
20-
2121
protected function configure(): void
2222
{
2323
parent::configure();
24-
$this->setDescription('Get the thumbprint of a JWK key.')
24+
$this
2525
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK key.')
2626
->addOption('hash', null, InputOption::VALUE_OPTIONAL, 'The hashing algorithm.', 'sha256');
2727
}

src/Component/Console/JKULoaderCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
use InvalidArgumentException;
88
use function is_string;
99
use Jose\Component\KeyManagement\JKUFactory;
10+
use Symfony\Component\Console\Attribute\AsCommand;
1011
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314

15+
#[AsCommand(name: 'keyset:load:jku', description: 'Loads a key set from an url.')]
1416
final class JKULoaderCommand extends ObjectOutputCommand
1517
{
16-
protected static $defaultName = 'keyset:load:jku';
17-
1818
public function __construct(
1919
private readonly JKUFactory $jkuFactory,
20-
?string $name = null
2120
) {
22-
parent::__construct($name);
21+
parent::__construct();
2322
}
2423

2524
protected function configure(): void
2625
{
2726
parent::configure();
28-
$this->setDescription('Loads a key set from an url.')
27+
$this
2928
->setHelp('This command will try to get a key set from an URL. The distant key set is a JWKSet.')
30-
->addArgument('url', InputArgument::REQUIRED, 'The URL');
29+
->addArgument('url', InputArgument::REQUIRED, 'The URL')
30+
;
3131
}
3232

3333
protected function execute(InputInterface $input, OutputInterface $output): int

src/Component/Console/KeyAnalyzerCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,26 @@
1010
use Jose\Component\Core\JWK;
1111
use Jose\Component\Core\Util\JsonConverter;
1212
use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager;
13+
use Symfony\Component\Console\Attribute\AsCommand;
1314
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1516
use Symfony\Component\Console\Input\InputArgument;
1617
use Symfony\Component\Console\Input\InputInterface;
1718
use Symfony\Component\Console\Output\OutputInterface;
1819

20+
#[AsCommand(name: 'key:analyze', description: 'JWK quality analyzer.')]
1921
final class KeyAnalyzerCommand extends Command
2022
{
21-
protected static $defaultName = 'key:analyze';
22-
2323
public function __construct(
2424
private readonly KeyAnalyzerManager $analyzerManager,
25-
string $name = null
2625
) {
27-
parent::__construct($name);
26+
parent::__construct();
2827
}
2928

3029
protected function configure(): void
3130
{
3231
parent::configure();
33-
$this->setDescription('JWK quality analyzer.')
32+
$this
3433
->setHelp('This command will analyze a JWK object and find security issues.')
3534
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK object');
3635
}

src/Component/Console/KeyFileLoaderCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
use InvalidArgumentException;
88
use function is_string;
99
use Jose\Component\KeyManagement\JWKFactory;
10+
use Symfony\Component\Console\Attribute\AsCommand;
1011
use Symfony\Component\Console\Input\InputArgument;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Input\InputOption;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

16+
#[AsCommand(name: 'key:load:key', description: 'Loads a key from a key file (JWK format)')]
1517
final class KeyFileLoaderCommand extends GeneratorCommand
1618
{
17-
protected static $defaultName = 'key:load:key';
18-
1919
protected function configure(): void
2020
{
2121
parent::configure();
22-
$this->setDescription('Loads a key from a key file (JWK format)')
22+
$this
2323
->addArgument('file', InputArgument::REQUIRED, 'Filename of the key.')
2424
->addOption('secret', 's', InputOption::VALUE_OPTIONAL, 'Secret if the key is encrypted.', null);
2525
}

src/Component/Console/KeysetAnalyzerCommand.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,27 @@
1212
use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager;
1313
use Jose\Component\KeyManagement\Analyzer\KeysetAnalyzerManager;
1414
use Jose\Component\KeyManagement\Analyzer\MessageBag;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1718
use Symfony\Component\Console\Input\InputArgument;
1819
use Symfony\Component\Console\Input\InputInterface;
1920
use Symfony\Component\Console\Output\OutputInterface;
2021

22+
#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.')]
2123
final class KeysetAnalyzerCommand extends Command
2224
{
23-
protected static $defaultName = 'keyset:analyze';
24-
2525
public function __construct(
2626
private readonly KeysetAnalyzerManager $keysetAnalyzerManager,
27-
private readonly KeyAnalyzerManager $keyAnalyzerManager,
28-
string $name = null
27+
private readonly KeyAnalyzerManager $keyAnalyzerManager
2928
) {
30-
parent::__construct($name);
29+
parent::__construct();
3130
}
3231

3332
protected function configure(): void
3433
{
3534
parent::configure();
36-
$this->setDescription('JWKSet quality analyzer.')
35+
$this
3736
->setHelp('This command will analyze a JWKSet object and find security issues.')
3837
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object');
3938
}

src/Component/Console/MergeKeysetCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
use function is_array;
99
use Jose\Component\Core\JWKSet;
1010
use Jose\Component\Core\Util\JsonConverter;
11+
use Symfony\Component\Console\Attribute\AsCommand;
1112
use Symfony\Component\Console\Input\InputArgument;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

16+
#[AsCommand(name: 'keyset:merge', description: 'Merge several key sets into one.')]
1517
final class MergeKeysetCommand extends ObjectOutputCommand
1618
{
17-
protected static $defaultName = 'keyset:merge';
18-
1919
protected function configure(): void
2020
{
2121
parent::configure();
22-
$this->setDescription('Merge several key sets into one.')
22+
$this
2323
->setHelp(
2424
'This command merges several key sets into one. It is very useful when you generate e.g. RSA, EC and OKP keys and you want only one key set to rule them all.'
2525
)

src/Component/Console/NoneKeyGeneratorCommand.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,16 @@
55
namespace Jose\Component\Console;
66

77
use Jose\Component\KeyManagement\JWKFactory;
8+
use Symfony\Component\Console\Attribute\AsCommand;
89
use Symfony\Component\Console\Input\InputInterface;
910
use Symfony\Component\Console\Output\OutputInterface;
1011

12+
#[AsCommand(
13+
name: 'key:generate:none',
14+
description: 'Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.',
15+
)]
1116
final class NoneKeyGeneratorCommand extends GeneratorCommand
1217
{
13-
protected static $defaultName = 'key:generate:none';
14-
15-
protected function configure(): void
16-
{
17-
parent::configure();
18-
$this->setDescription(
19-
'Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.'
20-
);
21-
}
22-
2318
protected function execute(InputInterface $input, OutputInterface $output): int
2419
{
2520
$args = $this->getOptions($input);

0 commit comments

Comments
 (0)