Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .ci-tools/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,6 @@ parameters:
count: 1
path: ../src/Bundle/DependencyInjection/JoseFrameworkExtension.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\DependencyInjection\JoseFrameworkExtension::getAlias() has Symfony\Component\DependencyInjection\Exception\BadMethodCallException in PHPDoc @throws tag but it''s not thrown.'
identifier: throws.unusedType
count: 1
path: ../src/Bundle/DependencyInjection/JoseFrameworkExtension.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\DependencyInjection\JoseFrameworkExtension::getConfiguration() has a parameter $container with a type declaration of Symfony\Component\DependencyInjection\ContainerBuilder, but containers should not be injected.'
identifier: ergebnis.noParameterWithContainerTypeDeclaration
Expand Down Expand Up @@ -5370,12 +5364,6 @@ parameters:
count: 1
path: ../src/Bundle/Resources/config/analyzers.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Routing\JWKSetLoader::load() has Exception in PHPDoc @throws tag but it''s not thrown.'
identifier: throws.unusedType
count: 1
path: ../src/Bundle/Routing/JWKSetLoader.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Routing\JWKSetLoader::load() has parameter $type with a nullable type declaration.'
identifier: ergebnis.noParameterWithNullableTypeDeclaration
Expand Down Expand Up @@ -5466,12 +5454,6 @@ parameters:
count: 1
path: ../src/Bundle/Serializer/JWESerializer.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Serializer\JWESerializer::denormalize() has Symfony\Component\Serializer\Exception\ExceptionInterface in PHPDoc @throws tag but it''s not thrown.'
identifier: throws.unusedType
count: 1
path: ../src/Bundle/Serializer/JWESerializer.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Serializer\JWESerializer::denormalize() has parameter $format with a nullable type declaration.'
identifier: ergebnis.noParameterWithNullableTypeDeclaration
Expand Down Expand Up @@ -5574,12 +5556,6 @@ parameters:
count: 1
path: ../src/Bundle/Serializer/JWSSerializer.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Serializer\JWSSerializer::denormalize() has Symfony\Component\Serializer\Exception\ExceptionInterface in PHPDoc @throws tag but it''s not thrown.'
identifier: throws.unusedType
count: 1
path: ../src/Bundle/Serializer/JWSSerializer.php

-
rawMessage: 'Method Jose\Bundle\JoseFramework\Serializer\JWSSerializer::denormalize() has parameter $format with a nullable type declaration.'
identifier: ergebnis.noParameterWithNullableTypeDeclaration
Expand Down Expand Up @@ -9720,12 +9696,6 @@ parameters:
count: 1
path: ../src/Library/KeyManagement/KeyConverter/KeyConverter.php

-
rawMessage: 'Parameter #1 $certificate of static method Jose\Component\KeyManagement\KeyConverter\KeyConverter::loadKeyFromCertificate() expects string, mixed given.'
identifier: argument.type
count: 1
path: ../src/Library/KeyManagement/KeyConverter/KeyConverter.php

-
rawMessage: 'Parameter #1 $details of static method Jose\Component\KeyManagement\KeyConverter\KeyConverter::tryToLoadECKey() expects array{type: int, key: string}, non-empty-array given.'
identifier: argument.type
Expand Down
2 changes: 1 addition & 1 deletion .ci-tools/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
</php>
<source>
<source ignoreIndirectDeprecations="true">
<include>
<directory>./../src</directory>
</include>
Expand Down
34 changes: 20 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: "0️⃣ Pre-checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: "Check file permissions"
run: |
Expand All @@ -43,7 +43,7 @@ jobs:
outputs:
cache-key: ${{ steps.cache-key-generator.outputs.key }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- id: cache-key-generator
run: echo "key=composer-${{ runner.os }}-${{ hashFiles('composer.lock') }}" >> $GITHUB_OUTPUT
Expand All @@ -69,7 +69,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: |
Expand All @@ -85,7 +85,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: |
Expand All @@ -101,7 +101,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: |
Expand All @@ -117,7 +117,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: |
Expand All @@ -136,7 +136,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- run: composer exec -- parallel-lint src tests

check_licenses:
Expand All @@ -146,7 +146,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- run: castor check-licenses

deptrac:
Expand All @@ -156,7 +156,7 @@ jobs:
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: |
Expand All @@ -166,7 +166,7 @@ jobs:
- run: castor deptrac

tests:
name: "8️⃣ Unit & Functional Tests (PHP ${{ matrix.php-version }}${{ matrix.lowest-deps && ' --prefer-lowest' || '' }})"
name: "🧪 Unit & Functional Tests (PHP ${{ matrix.php-version }}${{ matrix.lowest-deps && ' - Lowest Deps' || '' }})"
needs:
- prepare_dependencies
- phpstan
Expand All @@ -177,27 +177,33 @@ jobs:
- check_licenses
- deptrac
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
include:
- php-version: '8.2'
lowest-deps: true
- php-version: '8.2'
- php-version: '8.3'
- php-version: '8.4'
- php-version: '8.5'
experimental: true
container:
image: ghcr.io/spomky-labs/phpqa:${{ matrix.php-version }}
env:
XDEBUG_MODE: coverage
PHP_VERSION: ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install dependencies
run: |
if [ "${{ matrix.lowest-deps || 'false' }}" = "true" ]; then
composer update --prefer-lowest --no-interaction --no-progress
else
composer install --no-interaction --no-progress
fi

- name: Run PHPUnit
run: castor phpunit

Expand All @@ -211,7 +217,7 @@ jobs:
env:
XDEBUG_MODE: coverage
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Execute Infection
run: castor infect

Expand All @@ -220,7 +226,7 @@ jobs:
needs: [prepare_dependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Check exported files
run: |
EXPECTED=".gitsplit.yml,CODE_OF_CONDUCT.md,LICENSE,README.md,SECURITY.md,castor.php,composer.json"
Expand Down
2 changes: 1 addition & 1 deletion castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function phpunit(): void
{
phpqa(
[
'composer', 'exec', '--', 'phpunit',
'composer', 'exec', '--', 'phpunit-11',
'--coverage-xml', '.ci-tools/coverage',
'--log-junit=.ci-tools/coverage/junit.xml',
'--configuration', '.ci-tools/phpunit.xml.dist',
Expand Down
5 changes: 2 additions & 3 deletions src/Library/Console/AddKeyIntoKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
use function is_array;
use function is_string;

#[AsCommand(name: 'keyset:add:key', description: 'Add a key into a key set.', help: <<<'TXT'
This command adds a key at the end of a key set.
TXT)]
#[AsCommand(name: 'keyset:add:key', description: 'Add a key into a key set.')]
final class AddKeyIntoKeysetCommand extends ObjectOutputCommand
{
#[Override]
protected function configure(): void
{
parent::configure();
$this
->setHelp('This command adds a key at the end of a key set.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object')
->addArgument('jwk', InputArgument::REQUIRED, 'The new JWK object');
}
Expand Down
5 changes: 2 additions & 3 deletions src/Library/Console/JKULoaderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use function is_string;

#[AsCommand(name: 'keyset:load:jku', description: 'Loads a key set from an url.', help: <<<'TXT'
This command will try to get a key set from an URL. The distant key set is a JWKSet.
TXT)]
#[AsCommand(name: 'keyset:load:jku', description: 'Loads a key set from an url.')]
final class JKULoaderCommand extends ObjectOutputCommand
{
public function __construct(
Expand All @@ -30,6 +28,7 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp('This command will try to get a key set from an URL. The distant key set is a JWKSet.')
->addArgument('url', InputArgument::REQUIRED, 'The URL');
}

Expand Down
5 changes: 2 additions & 3 deletions src/Library/Console/KeyAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
use function is_array;
use function is_string;

#[AsCommand(name: 'key:analyze', description: 'JWK quality analyzer.', help: <<<'TXT'
This command will analyze a JWK object and find security issues.
TXT)]
#[AsCommand(name: 'key:analyze', description: 'JWK quality analyzer.')]
final class KeyAnalyzerCommand extends Command
{
public function __construct(
Expand All @@ -35,6 +33,7 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp('This command will analyze a JWK object and find security issues.')
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK object');
}

Expand Down
5 changes: 2 additions & 3 deletions src/Library/Console/KeysetAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
use function is_string;
use function sprintf;

#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.', help: <<<'TXT'
This command will analyze a JWKSet object and find security issues.
TXT)]
#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.')]
final class KeysetAnalyzerCommand extends Command
{
public function __construct(
Expand All @@ -39,6 +37,7 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp('This command will analyze a JWKSet object and find security issues.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object');
}

Expand Down
7 changes: 4 additions & 3 deletions src/Library/Console/MergeKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
use Symfony\Component\Console\Output\OutputInterface;
use function is_array;

#[AsCommand(name: 'keyset:merge', description: 'Merge several key sets into one.', help: <<<'TXT'
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.
TXT)]
#[AsCommand(name: 'keyset:merge', description: 'Merge several key sets into one.')]
final class MergeKeysetCommand extends ObjectOutputCommand
{
#[Override]
protected function configure(): void
{
parent::configure();
$this
->setHelp(
'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.'
)
->addArgument('jwksets', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'The JWKSet objects');
}

Expand Down
4 changes: 1 addition & 3 deletions src/Library/Console/PublicKeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#[AsCommand(
name: 'key:convert:public',
description: 'Convert a private key into public key. Symmetric keys (shared keys) are not changed.',
help: <<<'TXT'
This command converts a private key into a public key.
TXT
)]
final class PublicKeyCommand extends ObjectOutputCommand
{
Expand All @@ -29,6 +26,7 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp('This command converts a private key into a public key.')
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK object');
}

Expand Down
4 changes: 1 addition & 3 deletions src/Library/Console/PublicKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#[AsCommand(
name: 'keyset:convert:public',
description: 'Convert private keys in a key set into public keys. Symmetric keys (shared keys) are not changed.',
help: <<<'TXT'
This command converts private keys in a key set into public keys.
TXT
)]
final class PublicKeysetCommand extends ObjectOutputCommand
{
Expand All @@ -29,6 +26,7 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp('This command converts private keys in a key set into public keys.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object');
}

Expand Down
5 changes: 2 additions & 3 deletions src/Library/Console/RotateKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
use function is_array;
use function is_string;

#[AsCommand(name: 'keyset:rotate', description: 'Rotate a key set.', help: <<<'TXT'
This command removes the last key in a key set a place a new one at the beginning.
TXT)]
#[AsCommand(name: 'keyset:rotate', description: 'Rotate a key set.')]
final class RotateKeysetCommand extends ObjectOutputCommand
{
#[Override]
protected function configure(): void
{
parent::configure();
$this
->setHelp('This command removes the last key in a key set a place a new one at the beginning.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object')
->addArgument('jwk', InputArgument::REQUIRED, 'The new JWK object');
}
Expand Down
7 changes: 4 additions & 3 deletions src/Library/Console/X5ULoaderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use function is_string;

#[AsCommand(name: 'keyset:load:x5u', description: 'Loads a key set from an url.', help: <<<'TXT'
This command will try to get a key set from an URL. The distant key set is list of X.509 certificates.
TXT)]
#[AsCommand(name: 'keyset:load:x5u', description: 'Loads a key set from an url.')]
final class X5ULoaderCommand extends ObjectOutputCommand
{
public function __construct(
Expand All @@ -30,6 +28,9 @@ protected function configure(): void
{
parent::configure();
$this
->setHelp(
'This command will try to get a key set from an URL. The distant key set is list of X.509 certificates.'
)
->addArgument('url', InputArgument::REQUIRED, 'The URL');
}

Expand Down
Loading
Loading