diff --git a/.editorconfig b/.editorconfig index c0130606a..183c4953c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,6 +17,9 @@ block_comment_end = */ [{*.yml,*.yaml}] indent_size = 2 +[*.neon] +indent_style = tab + [*.md] trim_trailing_whitespace = false diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml new file mode 100644 index 000000000..dd8e196c3 --- /dev/null +++ b/.github/workflows/infection.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +name: "Integrate" + +on: + push: + branches: + - "*.x" + +jobs: + mutation_testing: + name: "5️⃣ Mutation Testing" + needs: + - "byte_level" + - "syntax_errors" + runs-on: "ubuntu-latest" + steps: + - name: "Set up PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "8.1" + extensions: "json, mbstring, openssl, sqlite3, curl, uuid" + + - name: "Checkout code" + uses: "actions/checkout@v4" + + - name: "Fetch Git base reference" + run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}" + + - name: "Install dependencies" + uses: "ramsey/composer-install@v2" + with: + dependency-versions: "highest" + composer-options: "--optimize-autoloader" + + - name: "Execute Infection" + run: "make ci-mu" diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 3e4db0e75..00d39dce6 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -14,7 +14,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Check file permissions" run: | @@ -34,7 +34,7 @@ jobs: php-version: "8.1" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install dependencies" uses: "ramsey/composer-install@v2" @@ -55,6 +55,8 @@ jobs: - "ubuntu-latest" php-version: - "8.1" + - "8.2" + - "8.3" dependencies: - "lowest" - "highest" @@ -68,7 +70,7 @@ jobs: coverage: "xdebug" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Install dependencies" uses: "ramsey/composer-install@v2" @@ -101,7 +103,7 @@ jobs: extensions: "json, mbstring, openssl, sqlite3, curl, uuid" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Validate Composer configuration" run: "composer validate --strict" @@ -129,7 +131,7 @@ jobs: extensions: "json, mbstring, openssl, sqlite3, curl, uuid" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Check adherence to EditorConfig" uses: "greut/eclint-action@v0" @@ -143,34 +145,6 @@ jobs: - name: "Check coding style" run: "make ci-cs" - mutation_testing: - name: "5️⃣ Mutation Testing" - needs: - - "byte_level" - - "syntax_errors" - runs-on: "ubuntu-latest" - steps: - - name: "Set up PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "8.1" - extensions: "json, mbstring, openssl, sqlite3, curl, uuid" - - - name: "Checkout code" - uses: "actions/checkout@v3" - - - name: "Fetch Git base reference" - run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}" - - - name: "Install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "--optimize-autoloader" - - - name: "Execute Infection" - run: "make ci-mu" - rector_checkstyle: name: "6️⃣ Rector Checkstyle" needs: @@ -186,7 +160,7 @@ jobs: coverage: "xdebug" - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Fetch Git base reference" run: "git fetch --depth=1 origin ${GITHUB_BASE_REF}" @@ -208,7 +182,7 @@ jobs: runs-on: "ubuntu-20.04" steps: - name: "Checkout code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Check exported files" run: | diff --git a/.github/workflows/merge-me.yml b/.github/workflows/merge-me.yml deleted file mode 100644 index cb13bebd7..000000000 --- a/.github/workflows/merge-me.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: bot-auto-merge - -on: - check_suite: - types: - - completed - -jobs: - merge-me: - name: Auto-merge passing bot PRs - runs-on: ubuntu-latest - steps: - - name: Auto-merge passing dependabot PRs - if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: ridedott/merge-me-action@v2 - with: - # For clarity only. dependabot is default. - GITHUB_LOGIN: dependabot - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ENABLED_FOR_MANUAL_CHANGES: "true" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 010d44106..e446f6e27 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -14,7 +14,9 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" + with: + fetch-depth: 0 - name: "Release" uses: "laminas/automatic-releases@1.24.0" @@ -35,7 +37,9 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" + with: + fetch-depth: 0 - name: "Create Merge-Up Pull Request" uses: "laminas/automatic-releases@1.24.0" @@ -56,7 +60,9 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" + with: + fetch-depth: 0 - name: "Create and/or Switch to new Release Branch" uses: "laminas/automatic-releases@1.24.0" @@ -77,7 +83,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: fetch-depth: 0 @@ -100,7 +106,9 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" + with: + fetch-depth: 0 - name: "Create new milestones" uses: "laminas/automatic-releases@1.24.0" diff --git a/.gitsplit.yml b/.gitsplit.yml index fff35babd..ce253cf04 100644 --- a/.gitsplit.yml +++ b/.gitsplit.yml @@ -1,55 +1,59 @@ splits: - - prefix: "src/Component/Core" - target: "https://${GH_TOKEN}@github.com/web-token/jwt-core.git" - - prefix: "src/Component/Checker" - target: "https://${GH_TOKEN}@github.com/web-token/jwt-checker.git" - - prefix: "src/Component/Signature" + - prefix: "src/Bundle" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-bundle.git" + - prefix: "src/Library" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-library.git" + - prefix: "src/Experimental" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-experimental.git" + - prefix: "src/Deprecated/Signature" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature.git" - - prefix: "src/Component/Encryption" + - prefix: "src/Deprecated/Checker" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-checker.git" + - prefix: "src/Deprecated/Console" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-console.git" + - prefix: "src/Deprecated/Core" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-core.git" + - prefix: "src/Deprecated/Ecc" + target: "https://${GH_TOKEN}@github.com/web-token/jwt-util-ecc.git" + - prefix: "src/Deprecated/Encryption" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption.git" - - prefix: "src/Component/KeyManagement" + - prefix: "src/Deprecated/KeyManagement" target: "https://${GH_TOKEN}@github.com/web-token/jwt-key-mgmt.git" - - prefix: "src/Component/Console" - target: "https://${GH_TOKEN}@github.com/web-token/jwt-console.git" - - prefix: "src/Component/NestedToken" + - prefix: "src/Deprecated/NestedToken" target: "https://${GH_TOKEN}@github.com/web-token/jwt-nested-token.git" - - prefix: "src/Bundle/JoseFramework" - target: "https://${GH_TOKEN}@github.com/web-token/jwt-bundle.git" - - prefix: "src/EncryptionAlgorithm/ContentEncryption/AESCBC" + - prefix: "src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aescbc.git" - - prefix: "src/EncryptionAlgorithm/ContentEncryption/AESGCM" + - prefix: "src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcm.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcmkw.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/AESKW" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aeskw.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/Direct" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-dir.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/ECDHES" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-ecdh-es.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/PBES2" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-pbes2.git" - - prefix: "src/EncryptionAlgorithm/KeyEncryption/RSA" + - prefix: "src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-rsa.git" - - prefix: "src/SignatureAlgorithm/ECDSA" + - prefix: "src/Deprecated/SignatureAlgorithm/ECDSA" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-ecdsa.git" - - prefix: "src/SignatureAlgorithm/EdDSA" + - prefix: "src/Deprecated/SignatureAlgorithm/EdDSA" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-eddsa.git" - - prefix: "src/SignatureAlgorithm/None" + - prefix: "src/Deprecated/SignatureAlgorithm/None" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-none.git" - - prefix: "src/SignatureAlgorithm/HMAC" + - prefix: "src/Deprecated/SignatureAlgorithm/HMAC" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-hmac.git" - - prefix: "src/SignatureAlgorithm/RSA" + - prefix: "src/Deprecated/SignatureAlgorithm/RSA" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-rsa.git" - - prefix: "src/SignatureAlgorithm/Experimental" + - prefix: "src/Deprecated/SignatureAlgorithm/Experimental" target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-experimental.git" - - prefix: "src/EncryptionAlgorithm/Experimental" + - prefix: "src/Deprecated/EncryptionAlgorithm/Experimental" target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-experimental.git" - - prefix: "src/Ecc" - target: "https://${GH_TOKEN}@github.com/web-token/jwt-util-ecc.git" - - prefix: "packs/encryption" + - prefix: "src/Deprecated/Pack/Encryption" target: "https://${GH_TOKEN}@github.com/web-token/encryption-pack.git" - - prefix: "packs/signature" + - prefix: "rc/Deprecated/Pack/Signature" target: "https://${GH_TOKEN}@github.com/web-token/signature-pack.git" origins: diff --git a/Makefile b/Makefile index 1960dee3b..53baadec4 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ st: vendor ## Run static analyse ################################################ -ci-mu: vendor ## Mutation tests (for Github only) +ci-mu: vendor ## Mutation tests (for GitHub only) vendor/bin/infection --logger-github -s --threads=$$(nproc) --min-msi=45 --min-covered-msi=60 ci-cc: vendor ## Show test coverage rates (console) diff --git a/SECURITY.md b/SECURITY.md index fd6918fe2..ae522574e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,9 +5,8 @@ | Version | Supported | |---------|--------------------| | 4.0.x | :white_check_mark: | -| 3.1.x | :white_check_mark: | -| 3.0.x | :white_check_mark: | -| < 3.0.0 | :x: | +| 3.3.x | :white_check_mark: | +| < 3.3.0 | :x: | ## Reporting a Vulnerability diff --git a/composer.json b/composer.json index af300658f..281621dc2 100644 --- a/composer.json +++ b/composer.json @@ -35,56 +35,9 @@ "autoload": { "psr-4": { "Jose\\": "src/", - "Jose\\Bundle\\JoseFramework\\": "src/Bundle/JoseFramework/", - "Jose\\Component\\Checker\\": "src/Component/Checker/", - "Jose\\Component\\Console\\": "src/Component/Console/", - "Jose\\Component\\Core\\": "src/Component/Core/", - "Jose\\Component\\Core\\Util\\Ecc\\": [ - "src/Ecc", - "src/Ecc/" - ], - "Jose\\Component\\Encryption\\": "src/Component/Encryption/", - "Jose\\Component\\Encryption\\Algorithm\\": [ - "src/EncryptionAlgorithm/Experimental", - "src/EncryptionAlgorithm/Experimental/" - ], - "Jose\\Component\\Encryption\\Algorithm\\ContentEncryption\\": [ - "src/EncryptionAlgorithm/ContentEncryption/AESCBC", - "src/EncryptionAlgorithm/ContentEncryption/AESCBC/", - "src/EncryptionAlgorithm/ContentEncryption/AESGCM", - "src/EncryptionAlgorithm/ContentEncryption/AESGCM/" - ], - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": [ - "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW", - "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/", - "src/EncryptionAlgorithm/KeyEncryption/AESKW", - "src/EncryptionAlgorithm/KeyEncryption/AESKW/", - "src/EncryptionAlgorithm/KeyEncryption/Direct", - "src/EncryptionAlgorithm/KeyEncryption/Direct/", - "src/EncryptionAlgorithm/KeyEncryption/ECDHES", - "src/EncryptionAlgorithm/KeyEncryption/ECDHES/", - "src/EncryptionAlgorithm/KeyEncryption/PBES2", - "src/EncryptionAlgorithm/KeyEncryption/PBES2/", - "src/EncryptionAlgorithm/KeyEncryption/RSA", - "src/EncryptionAlgorithm/KeyEncryption/RSA/" - ], - "Jose\\Component\\KeyManagement\\": "src/Component/KeyManagement/", - "Jose\\Component\\NestedToken\\": "src/Component/NestedToken/", - "Jose\\Component\\Signature\\": "src/Component/Signature/", - "Jose\\Component\\Signature\\Algorithm\\": [ - "src/SignatureAlgorithm/ECDSA", - "src/SignatureAlgorithm/ECDSA/", - "src/SignatureAlgorithm/EdDSA", - "src/SignatureAlgorithm/EdDSA/", - "src/SignatureAlgorithm/Experimental", - "src/SignatureAlgorithm/Experimental/", - "src/SignatureAlgorithm/HMAC", - "src/SignatureAlgorithm/HMAC/", - "src/SignatureAlgorithm/None", - "src/SignatureAlgorithm/None/", - "src/SignatureAlgorithm/RSA", - "src/SignatureAlgorithm/RSA/" - ] + "Jose\\Bundle\\JoseFramework\\": "src/Bundle/", + "Jose\\Experimental\\": "src/Experimental/", + "Jose\\Component\\": "src/Library/" } }, "autoload-dev": { @@ -99,30 +52,31 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "brick/math": "^0.9|^0.10|^0.11", - "paragonie/constant_time_encoding": "^2.4", + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "paragonie/constant_time_encoding": "^2.6", + "paragonie/sodium_compat": "^1.20", "psr/clock": "^1.0", "psr/event-dispatcher": "^1.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "spomky-labs/aes-key-wrap": "^7.0", "spomky-labs/pki-framework": "^1.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", "symfony/polyfill-mbstring": "^1.12" }, "require-dev": { "ext-curl": "*", "ext-gmp": "*", "bjeavons/zxcvbn-php": "^1.3", - "blackfire/php-sdk": "^2.0", "ekino/phpstan-banned-code": "^1.0", "infection/infection": "^0.27", - "matthiasnoback/symfony-config-test": "^4.3.0", - "nyholm/psr7": "^1.5", + "matthiasnoback/symfony-config-test": "^5.0", + "nyholm/psr7": "^1.8", "php-http/mock-client": "^1.5", "php-parallel-lint/php-parallel-lint": "^1.3", "phpbench/phpbench": "^1.2", @@ -131,24 +85,23 @@ "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^9.5.23", + "phpunit/phpunit": "^10.1", "qossmic/deptrac-shim": "^1.0", - "rector/rector": "^0.16", + "rector/rector": "^1.0", "roave/security-advisories": "dev-latest", - "symfony/browser-kit": "^6.1.3", - "symfony/finder": "^5.4|^6.0", - "symfony/framework-bundle": "^6.1.3", - "symfony/http-client": "^5.4|^6.0", - "symfony/phpunit-bridge": "^6.1.3", - "symfony/serializer": "^6.1.3", - "symfony/var-dumper": "^6.1.3", - "symfony/yaml": "^6.1.3", - "symplify/easy-coding-standard": "^11.0", - "symplify/monorepo-builder": "11.2.3.72" + "symfony/browser-kit": "^6.1|^7.0", + "symfony/finder": "^6.1|^7.0", + "symfony/framework-bundle": "^6.1|^7.0", + "symfony/phpunit-bridge": "^6.1|^7.0", + "symfony/serializer": "^6.1|^7.0", + "symfony/var-dumper": "^6.1|^7.0", + "symfony/yaml": "^6.1|^7.0", + "symplify/easy-coding-standard": "^12.0" }, "replace": { "web-token/encryption-pack": "self.version", "web-token/jwt-bundle": "self.version", + "web-token/jwt-library": "self.version", "web-token/jwt-checker": "self.version", "web-token/jwt-console": "self.version", "web-token/jwt-core": "self.version", @@ -171,17 +124,19 @@ "web-token/jwt-signature-algorithm-hmac": "self.version", "web-token/jwt-signature-algorithm-none": "self.version", "web-token/jwt-signature-algorithm-rsa": "self.version", + "web-token/jwt-signature-pack": "self.version", "web-token/jwt-util-ecc": "self.version", - "web-token/signature-pack": "self.version" + "web-token/signature-pack": "self.version", + "web-token/jwt-experimental": "self.version" }, "suggest": { - "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", "bjeavons/zxcvbn-php": "Adds key quality check for oct keys.", "php-http/httplug": "To enable JKU/X5U support.", "php-http/httplug-bundle": "To enable JKU/X5U support.", "php-http/message-factory": "To enable JKU/X5U support.", "symfony/serializer": "Use the Symfony serializer to serialize/unserialize JWS and JWE tokens.", - "symfony/var-dumper": "Used to show data on the debug toolbar." + "symfony/var-dumper": "Used to show data on the debug toolbar.", + "spomky-labs/aes-key-wrap": "To enable AES Key Wrap algorithm." }, "conflict": { "spomky-labs/jose": "*" diff --git a/ecs.php b/ecs.php index 6c1bbc65f..0e1998774 100644 --- a/ecs.php +++ b/ecs.php @@ -87,12 +87,13 @@ 'import_functions' => true, ]); - $config->services() - ->remove(PhpUnitTestClassRequiresCoversFixer::class); + $config->skip([PhpUnitTestClassRequiresCoversFixer::class]); $config->parallel(); $config->paths([ __DIR__ . '/performance', __DIR__ . '/src', __DIR__ . '/tests', + __DIR__ . '/ecs.php', + __DIR__ . '/rector.php', ]); }; diff --git a/monorepo-builder.php b/monorepo-builder.php deleted file mode 100644 index 85de166f9..000000000 --- a/monorepo-builder.php +++ /dev/null @@ -1,31 +0,0 @@ -packageDirectories([ - __DIR__ . '/src', - __DIR__ . '/packs', - ]); - - $mbConfig->workers([ - UpdateReplaceReleaseWorker::class, - SetCurrentMutualDependenciesReleaseWorker::class, - AddTagToChangelogReleaseWorker::class, - TagVersionReleaseWorker::class, - PushTagReleaseWorker::class, - SetNextMutualDependenciesReleaseWorker::class, - UpdateBranchAliasReleaseWorker::class, - PushNextDevReleaseWorker::class, - ]); -}; diff --git a/packs/encryption/composer.json b/packs/encryption/composer.json deleted file mode 100644 index af6e3e9ff..000000000 --- a/packs/encryption/composer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "web-token/encryption-pack", - "type": "symfony-pack", - "license": "MIT", - "description": "A pack with all encryption algorithms for the web-token/jwt-encryption package", - "require": { - "web-token/jwt-encryption-algorithm-aescbc": "^3.2", - "web-token/jwt-encryption-algorithm-aesgcm": "^3.2", - "web-token/jwt-encryption-algorithm-aesgcmkw": "^3.2", - "web-token/jwt-encryption-algorithm-aeskw": "^3.2", - "web-token/jwt-encryption-algorithm-dir": "^3.2", - "web-token/jwt-encryption-algorithm-ecdh-es": "^3.2", - "web-token/jwt-encryption-algorithm-pbes2": "^3.2", - "web-token/jwt-encryption-algorithm-rsa": "^3.2", - "web-token/jwt-encryption-algorithm-experimental": "^3.2" - } -} diff --git a/packs/signature/composer.json b/packs/signature/composer.json deleted file mode 100644 index 235ea268f..000000000 --- a/packs/signature/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "web-token/signature-pack", - "type": "symfony-pack", - "license": "MIT", - "description": "A pack with all signature algorithms for the web-token/jwt-signature package", - "require": { - "web-token/jwt-signature-algorithm-ecdsa": "^3.2", - "web-token/jwt-signature-algorithm-eddsa": "^3.2", - "web-token/jwt-signature-algorithm-none": "^3.2", - "web-token/jwt-signature-algorithm-hmac": "^3.2", - "web-token/jwt-signature-algorithm-rsa": "^3.2", - "web-token/jwt-signature-algorithm-experimental": "^3.2" - } -} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c70398a1b..c6a60b87d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,1936 +1,2051 @@ parameters: - ignoreErrors: - - - message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DataCollector/KeyCollector.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\JoseFrameworkExtension\\:\\:getConfiguration\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/JoseFrameworkExtension.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\JoseFrameworkExtension\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/JoseFrameworkExtension.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/AbstractSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\AbstractSource\\:\\:create\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/AbstractSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 2 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:load\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Core/CoreSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Core/CoreSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Core/CoreSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\AbstractEncryptionSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\AbstractEncryptionSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:getAlgorithmsFiles\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWEBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWEDecrypter\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEDecrypter.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php - - - - message: "#^Parameter \\#1 \\$id of class Symfony\\\\Component\\\\DependencyInjection\\\\Reference constructor expects string, mixed given\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/P12.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Values.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/AbstractSignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\AbstractSignatureSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/AbstractSignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\AbstractSignatureSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/AbstractSignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSBuilder.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSVerifier\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSVerifier.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:getAlgorithmsFiles\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Source.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Source.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/DependencyInjection/Source/Source.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryClaims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:getClaims\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:getMandatoryClaims\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$checkedClaims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryClaims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getCheckedClaims\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getClaims\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getMandatoryClaims\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryHeaderParameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/HeaderCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedFailureEvent\\:\\:getMandatoryHeaderParameters\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/HeaderCheckedFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryHeaderParameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/HeaderCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedSuccessEvent\\:\\:getMandatoryHeaderParameters\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/HeaderCheckedSuccessEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$recipients with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getRecipients\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getSharedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getSharedProtectedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$signatures with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWSBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSBuiltFailureEvent\\:\\:getSignatures\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Event/JWSBuiltFailureEvent.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addClaimChecker\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addHeaderChecker\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$keyEncryptionAlgorithm with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$keyEncryptionAlgorithm with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWELoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWESerializer\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSLoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSSerializer\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSVerifier\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKey\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKey\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyUri\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyUri\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyset\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyset\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addNestedTokenBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addNestedTokenLoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:updateJoseConfiguration\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Helper/ConfigurationHelper.php - - - - message: "#^Class Jose\\\\Bundle\\\\JoseFramework\\\\Routing\\\\JWKSetLoader has an uninitialized property \\$resolver\\. Give it default value or assign it in the constructor\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Routing/JWKSetLoader.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:decode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWEEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:encode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWEEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:getRecipientIndex\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWEEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:supportsDecoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWEEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:supportsEncoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWEEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:denormalize\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWESerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWESerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:decode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:encode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:getSignatureIndex\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:supportsDecoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:supportsEncoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSEncoder.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:denormalize\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Serializer/JWSSerializer.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\ClaimCheckerManager\\:\\:check\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/ClaimCheckerManager.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\ClaimCheckerManager\\:\\:check\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/ClaimCheckerManager.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWEDecrypterFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWEDecrypterFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWEDecrypterFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWSLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWSLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWSLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSVerifierFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/JWSVerifierFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$jwe_serializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$jws_serializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$signatureAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jweHeaderCheckers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jweSerializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jwsHeaderCheckers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jwsSerializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$signatureAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php - - - - message: "#^Invalid type object to throw\\.$#" - count: 3 - path: src/Component/Checker/AudienceChecker.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:check\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/ClaimCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:check\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/ClaimCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:checkMandatoryClaims\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/ClaimCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$checkedHeaderParameters with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header1 with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header2 with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkHeaders\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkHeaders\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkMandatoryHeaderParameters\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkMandatoryHeaderParameters\\(\\) has parameter \\$unprotected with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/HeaderCheckerManager.php - - - - message: "#^Invalid type object to throw\\.$#" - count: 2 - path: src/Component/Checker/IssuerChecker.php - - - - message: "#^Method Jose\\\\Component\\\\Checker\\\\IssuerChecker\\:\\:__construct\\(\\) has parameter \\$issuers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Checker/IssuerChecker.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/Component/Console/EcKeysetGeneratorCommand.php - - - - message: "#^Method Jose\\\\Component\\\\Console\\\\GeneratorCommand\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Console/GeneratorCommand.php - - - - message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" - count: 1 - path: src/Component/Console/KeysetAnalyzerCommand.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Component/Console/KeysetAnalyzerCommand.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/Component/Console/OctKeyGeneratorCommand.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 2 - path: src/Component/Console/OctKeysetGeneratorCommand.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/Component/Console/OkpKeysetGeneratorCommand.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/Component/Console/RsaKeyGeneratorCommand.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 2 - path: src/Component/Console/RsaKeysetGeneratorCommand.php - - - - message: "#^Property Jose\\\\Component\\\\Core\\\\AlgorithmManager\\:\\:\\$algorithms type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/AlgorithmManager.php - - - - message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" - count: 1 - path: src/Component/Core/AlgorithmManagerFactory.php - - - - message: "#^Property Jose\\\\Component\\\\Core\\\\AlgorithmManagerFactory\\:\\:\\$algorithms type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/AlgorithmManagerFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:__construct\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWK.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:all\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWK.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWK.php - - - - message: "#^Property Jose\\\\Component\\\\Core\\\\JWK\\:\\:\\$values type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWK.php - - - - message: "#^Class Jose\\\\Component\\\\Core\\\\JWKSet implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Instanceof between Jose\\\\Component\\\\Core\\\\JWK and Jose\\\\Component\\\\Core\\\\JWK will always evaluate to true\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:convertKeyOpsToKeyUse\\(\\) has parameter \\$key_ops with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:createFromKeyData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:doesKeySatisfyRestrictions\\(\\) has parameter \\$restrictions with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:sortKeys\\(\\) has parameter \\$a with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:sortKeys\\(\\) has parameter \\$b with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Only numeric types are allowed in \\+, int\\|true given on the right side\\.$#" - count: 2 - path: src/Component/Core/JWKSet.php - - - - message: "#^Parameter \\#1 \\$values of class Jose\\\\Component\\\\Core\\\\JWK constructor expects array, mixed given\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Property Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:\\$keys type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/JWKSet.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKey\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/Util/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKeyUsingOpenSSL\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/Util/ECKey.php - - - - message: "#^Strict comparison using \\=\\=\\= between '30' and '81' will always evaluate to false\\.$#" - count: 1 - path: src/Component/Core/Util/ECSignature.php - - - - message: "#^Access to an uninitialized property Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:\\$modulus\\.$#" - count: 1 - path: src/Component/Core/Util/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/Util/RSAKey.php - - - - message: "#^Parameter \\#1 \\$number of static method Brick\\\\Math\\\\BigInteger\\:\\:fromBase\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/Core/Util/RSAKey.php - - - - message: "#^Property Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Core/Util/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\:\\:__construct\\(\\) has parameter \\$methods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Compression/CompressionMethodManager.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$recipients with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWE.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWE.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWE.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:getSharedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWE.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:getSharedProtectedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWE.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:addRecipient\\(\\) has parameter \\$recipientHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkAndSetContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header1 with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header2 with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:determineCEK\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:encryptJWE\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getCompressionMethod\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKey\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKey\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyAgreementAndKeyWrappingAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyAgreementAndKeyWrappingAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyEncryptionAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyWrappingAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyWrappingAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:processRecipient\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:processRecipient\\(\\) has parameter \\$recipient with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:withSharedHeader\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:withSharedProtectedHeader\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, \\(float\\|int\\) given\\.$#" - count: 2 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$recipients type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$sharedHeader type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$sharedProtectedHeader type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEBuilder.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:checkCompleteHeader\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decompressIfNeeded\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptCEK\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptPayload\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:getContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:getKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\Core\\\\Util\\\\KeyChecker\\:\\:checkKeyAlgorithm\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" - count: 2 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\Core\\\\Util\\\\KeyChecker\\:\\:checkKeyUsage\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Parameter \\#3 \\$recipientKey of method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptCEK\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" - count: 1 - path: src/Component/Encryption/JWEDecrypter.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/JWELoaderFactory.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Recipient\\:\\:__construct\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Recipient.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Recipient\\:\\:getHeader\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Recipient.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:checkData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:processHeaders\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:processHeaders\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decode\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/Component/Encryption/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:checkData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processRecipient\\(\\) has parameter \\$recipient with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processRecipient\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decode\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/Component/Encryption/Serializer/JSONGeneralSerializer.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\Message\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/Message.php - - - - message: "#^Class Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\MessageBag implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/MessageBag.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\MessageBag\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/MessageBag.php - - - - message: "#^Cannot call method get\\(\\) on mixed\\.$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/MixedKeyTypes.php - - - - message: "#^Cannot call method get\\(\\) on mixed\\.$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php - - - - message: "#^Cannot call method has\\(\\) on mixed\\.$#" - count: 1 - path: src/Component/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 2 - path: src/Component/KeyManagement/Analyzer/UsageAnalyzer.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JKUFactory\\:\\:loadFromUrl\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JKUFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromCertificate\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromCertificateFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKey\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKeyFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromPKCS12CertificateFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromSecret\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromValues\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX509Resource\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX5C\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX5C\\(\\) has parameter \\$x5c with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKey\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, \\(float\\|int\\) given\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\ given\\.$#" - count: 1 - path: src/Component/KeyManagement/JWKFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:getSupportedCurves\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:loadJWK\\(\\) has parameter \\$jwk with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:loadPEM\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Property Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/ECKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromKey\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromKeyFile\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromX5C\\(\\) has parameter \\$x5c with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromX5C\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificate\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificateFile\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromDER\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromPEM\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromX509Resource\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:tryToLoadECKey\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:tryToLoadOtherKeyTypes\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/KeyConverter.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:createFromKeyDetails\\(\\) has parameter \\$details with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:loadJWK\\(\\) has parameter \\$jwk with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Parameter \\#1 \\$details of static method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:createFromKeyDetails\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Property Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/KeyConverter/RSAKey.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\UrlKeySetFactory\\:\\:getContent\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/UrlKeySetFactory.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/Component/KeyManagement/X5UFactory.php - - - - message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\X5UFactory\\:\\:loadFromUrl\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Component/KeyManagement/X5UFactory.php - - - - message: "#^Parameter \\#1 \\$certificate of static method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificate\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/KeyManagement/X5UFactory.php - - - - message: "#^Call to function array_key_exists\\(\\) with 'key' and array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, header\\?\\: array\\\\} will always evaluate to true\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Call to function array_key_exists\\(\\) with 'key' and array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, protected_header\\?\\: array\\, header\\?\\: array\\\\} will always evaluate to true\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Call to function is_array\\(\\) with array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, header\\?\\: array\\\\} will always evaluate to true\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Call to function is_array\\(\\) with array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, protected_header\\?\\: array\\, header\\?\\: array\\\\} will always evaluate to true\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWSBuilder\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Parameter \\#3 \\$header of method Jose\\\\Component\\\\Signature\\\\JWSBuilder\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Result of \\|\\| is always false\\.$#" - count: 2 - path: src/Component/NestedToken/NestedTokenBuilder.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/Signature/JWS.php - - - - message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/Signature/JWS.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/Signature/JWSBuilder.php - - - - message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" - count: 1 - path: src/Component/Signature/JWSBuilder.php - - - - message: "#^Parameter \\#1 \\$algorithm of method Jose\\\\Component\\\\Core\\\\AlgorithmManager\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/Signature/JWSVerifier.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Component/Signature/JWSVerifier.php - - - - message: "#^Parameter \\#1 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\Serializer\\:\\:isPayloadEncoded\\(\\) expects array\\, array given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/CompactSerializer.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/CompactSerializer.php - - - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decode\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Parameter \\#1 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\Serializer\\:\\:isPayloadEncoded\\(\\) expects array\\, array given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONFlattenedSerializer.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Cannot access offset 'signature' on mixed\\.$#" - count: 2 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decode\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#1 \\$signature of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) expects array\\{protected\\?\\: string, header\\?\\: array\\\\}, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processIsPayloadEncoded\\(\\) expects array\\, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#3 \\$encodedProtectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects string\\|null, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, mixed given\\.$#" - count: 1 - path: src/Component/Signature/Serializer/JSONGeneralSerializer.php - - - - message: "#^Binary operation \"\\^\" between string and 1 results in an error\\.$#" - count: 2 - path: src/Ecc/Curve.php - - - - message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\<1, max\\> given\\.$#" - count: 1 - path: src/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBCHS.php - - - - message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\ given\\.$#" - count: 1 - path: src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDH.php - - - - message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" - count: 1 - path: src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2AESKW.php - - - - message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" - count: 2 - path: src/EncryptionAlgorithm/KeyEncryption/RSA/Util/RSACrypt.php - - - - message: "#^Variable static method call on Jose\\\\Component\\\\Core\\\\Util\\\\Hash\\.$#" - count: 2 - path: src/EncryptionAlgorithm/KeyEncryption/RSA/Util/RSACrypt.php - - - - message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and '' will always evaluate to false\\.$#" - count: 1 - path: src/SignatureAlgorithm/None/None.php - - - - message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" - count: 1 - path: src/SignatureAlgorithm/RSA/Util/RSA.php - - - - message: "#^Variable static method call on Jose\\\\Component\\\\Core\\\\Util\\\\Hash\\.$#" - count: 2 - path: src/SignatureAlgorithm/RSA/Util/RSA.php + ignoreErrors: + - + message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" + count: 1 + path: src/Bundle/DataCollector/KeyCollector.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\JoseFrameworkExtension\\:\\:getConfiguration\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/JoseFrameworkExtension.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\JoseFrameworkExtension\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/JoseFrameworkExtension.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/AbstractSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\AbstractSource\\:\\:create\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/AbstractSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 2 + path: src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\CheckerSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\ClaimChecker\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Checker\\\\HeaderChecker\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Console\\\\ConsoleSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:load\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Core/CoreSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Core/CoreSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Core\\\\CoreSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Core/CoreSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\AbstractEncryptionSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\AbstractEncryptionSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\A128CTR not found\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\Chacha20Poly1305 not found\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:getAlgorithmsFiles\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\EncryptionSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWEBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWEDecrypter\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWEDecrypter.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWELoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Encryption\\\\JWESerializer\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JKUSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSetSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php + + - + message: "#^Parameter \\#1 \\$id of class Symfony\\\\Component\\\\DependencyInjection\\\\Reference constructor expects string, mixed given\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/P12.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Values.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\JWKUriSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\KeyManagement\\\\KeyManagementSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedToken\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenBuilder\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\NestedToken\\\\NestedTokenLoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/AbstractSignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\AbstractSignatureSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/AbstractSignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\AbstractSignatureSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/AbstractSignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSBuilder\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSBuilder.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSLoader\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSSerializer\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\JWSVerifier\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/JWSVerifier.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\HS1 not found\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:getAlgorithmsFiles\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Signature\\\\SignatureSource\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Source.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:prepend\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Source.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\Source\\\\Source\\:\\:prepend\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/DependencyInjection/Source/Source.php + + - + message: "#^Parameter \\#1 \\$json of static method Jose\\\\Component\\\\Core\\\\JWK\\:\\:createFromJson\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php + + - + message: "#^Parameter \\#1 \\$json of static method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:createFromJson\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryClaims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:getClaims\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedFailureEvent\\:\\:getMandatoryClaims\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$checkedClaims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryClaims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getCheckedClaims\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getClaims\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\ClaimCheckedSuccessEvent\\:\\:getMandatoryClaims\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/ClaimCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedFailureEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryHeaderParameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/HeaderCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedFailureEvent\\:\\:getMandatoryHeaderParameters\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/HeaderCheckedFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedSuccessEvent\\:\\:__construct\\(\\) has parameter \\$mandatoryHeaderParameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/HeaderCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\HeaderCheckedSuccessEvent\\:\\:getMandatoryHeaderParameters\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/HeaderCheckedSuccessEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$recipients with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getRecipients\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getSharedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEBuiltFailureEvent\\:\\:getSharedProtectedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWEBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSBuiltFailureEvent\\:\\:__construct\\(\\) has parameter \\$signatures with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWSBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSBuiltFailureEvent\\:\\:getSignatures\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Event/JWSBuiltFailureEvent.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addClaimChecker\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addHeaderChecker\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$keyEncryptionAlgorithm with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$keyEncryptionAlgorithm with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWEDecrypter\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWELoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWESerializer\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSLoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSSerializer\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addJWSVerifier\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKey\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKey\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyUri\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyUri\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyset\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addKeyset\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addNestedTokenBuilder\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:addNestedTokenLoader\\(\\) has parameter \\$tags with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Helper\\\\ConfigurationHelper\\:\\:updateJoseConfiguration\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" + count: 1 + path: src/Bundle/Helper/ConfigurationHelper.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A128CCM_16_128 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A128CCM_16_64 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A128CCM_64_128 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A128CCM_64_64 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A256CCM_16_128 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A256CCM_16_64 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A256CCM_64_128 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\A256CCM_64_64 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\A128CTR not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\A192CTR not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\A256CTR not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\RSAOAEP384 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\RSAOAEP512 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\KeyEncryption\\\\Chacha20Poly1305 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\Blake2b not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\ES256K not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\HS1 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\HS256_64 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + + - + message: "#^Class Jose\\\\Component\\\\Signature\\\\Algorithm\\\\RS1 not found\\.$#" + count: 1 + path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + + - + message: "#^Class Jose\\\\Bundle\\\\JoseFramework\\\\Routing\\\\JWKSetLoader has an uninitialized property \\$resolver\\. Give it default value or assign it in the constructor\\.$#" + count: 1 + path: src/Bundle/Routing/JWKSetLoader.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:decode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWEEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:encode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWEEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:getRecipientIndex\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWEEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:supportsDecoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWEEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWEEncoder\\:\\:supportsEncoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWEEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:denormalize\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:getSupportedTypes\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWESerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWESerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:decode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:encode\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:getSignatureIndex\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:supportsDecoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSEncoder\\:\\:supportsEncoding\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSEncoder.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:denormalize\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:getSupportedTypes\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Serializer\\\\JWSSerializer\\:\\:supportsDenormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Serializer/JWSSerializer.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\ClaimCheckerManager\\:\\:check\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/ClaimCheckerManager.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\ClaimCheckerManager\\:\\:check\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/ClaimCheckerManager.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWEDecrypterFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWEDecrypterFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWEDecrypterFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWSLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWSLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWSLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSVerifierFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/JWSVerifierFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$jwe_serializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$jws_serializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenBuilderFactory\\:\\:create\\(\\) has parameter \\$signatureAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenBuilderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jweHeaderCheckers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jweSerializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jwsHeaderCheckers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$jwsSerializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$signatureAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoaderFactory.php + + - + message: "#^Invalid type object to throw\\.$#" + count: 3 + path: src/Library/Checker/AudienceChecker.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:check\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/ClaimCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:check\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/ClaimCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\ClaimCheckerManager\\:\\:checkMandatoryClaims\\(\\) has parameter \\$claims with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/ClaimCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$checkedHeaderParameters with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkCriticalHeader\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header1 with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header2 with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkHeaders\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkHeaders\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkMandatoryHeaderParameters\\(\\) has parameter \\$protected with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\HeaderCheckerManager\\:\\:checkMandatoryHeaderParameters\\(\\) has parameter \\$unprotected with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/HeaderCheckerManager.php + + - + message: "#^Invalid type object to throw\\.$#" + count: 2 + path: src/Library/Checker/IssuerChecker.php + + - + message: "#^Method Jose\\\\Component\\\\Checker\\\\IssuerChecker\\:\\:__construct\\(\\) has parameter \\$issuers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Checker/IssuerChecker.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 1 + path: src/Library/Console/EcKeysetGeneratorCommand.php + + - + message: "#^Method Jose\\\\Component\\\\Console\\\\GeneratorCommand\\:\\:getOptions\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Console/GeneratorCommand.php + + - + message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" + count: 1 + path: src/Library/Console/KeysetAnalyzerCommand.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + count: 1 + path: src/Library/Console/KeysetAnalyzerCommand.php + + - + message: "#^Attribute class Jose\\\\Component\\\\Console\\\\AsCommand does not exist\\.$#" + count: 1 + path: src/Library/Console/NoneKeyGeneratorCommand.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 1 + path: src/Library/Console/OctKeyGeneratorCommand.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 2 + path: src/Library/Console/OctKeysetGeneratorCommand.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 1 + path: src/Library/Console/OkpKeysetGeneratorCommand.php + + - + message: "#^Attribute class Jose\\\\Component\\\\Console\\\\AsCommand does not exist\\.$#" + count: 1 + path: src/Library/Console/PublicKeyCommand.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 1 + path: src/Library/Console/RsaKeyGeneratorCommand.php + + - + message: "#^Cannot cast mixed to int\\.$#" + count: 2 + path: src/Library/Console/RsaKeysetGeneratorCommand.php + + - + message: "#^Attribute class Jose\\\\Component\\\\Console\\\\AsCommand does not exist\\.$#" + count: 1 + path: src/Library/Console/X5ULoaderCommand.php + + - + message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" + count: 1 + path: src/Library/Core/AlgorithmManagerFactory.php + + - + message: "#^Property Jose\\\\Component\\\\Core\\\\AlgorithmManagerFactory\\:\\:\\$algorithms type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/AlgorithmManagerFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:__construct\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWK.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:all\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWK.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWK\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWK.php + + - + message: "#^Property Jose\\\\Component\\\\Core\\\\JWK\\:\\:\\$values type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWK.php + + - + message: "#^Class Jose\\\\Component\\\\Core\\\\JWKSet implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Instanceof between Jose\\\\Component\\\\Core\\\\JWK and Jose\\\\Component\\\\Core\\\\JWK will always evaluate to true\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:convertKeyOpsToKeyUse\\(\\) has parameter \\$key_ops with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:createFromKeyData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:doesKeySatisfyRestrictions\\(\\) has parameter \\$restrictions with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:sortKeys\\(\\) has parameter \\$a with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:sortKeys\\(\\) has parameter \\$b with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Only numeric types are allowed in \\+, int\\|true given on the right side\\.$#" + count: 2 + path: src/Library/Core/JWKSet.php + + - + message: "#^Parameter \\#1 \\$values of class Jose\\\\Component\\\\Core\\\\JWK constructor expects array, mixed given\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Property Jose\\\\Component\\\\Core\\\\JWKSet\\:\\:\\$keys type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/JWKSet.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKey\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/Util/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\ECKey\\:\\:createECKeyUsingOpenSSL\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/Util/ECKey.php + + - + message: "#^Strict comparison using \\=\\=\\= between '30' and '81' will always evaluate to false\\.$#" + count: 1 + path: src/Library/Core/Util/ECSignature.php + + - + message: "#^Binary operation \"\\^\" between string and 1 results in an error\\.$#" + count: 2 + path: src/Library/Core/Util/Ecc/Curve.php + + - + message: "#^Method Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/Util/RSAKey.php + + - + message: "#^Parameter \\#1 \\$number of static method Brick\\\\Math\\\\BigInteger\\:\\:fromBase\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/Core/Util/RSAKey.php + + - + message: "#^Property Jose\\\\Component\\\\Core\\\\Util\\\\RSAKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Core/Util/RSAKey.php + + - + message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\<1, max\\> given\\.$#" + count: 1 + path: src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php + + - + message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\ given\\.$#" + count: 1 + path: src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" + count: 1 + path: src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" + count: 2 + path: src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php + + - + message: "#^Variable static method call on Jose\\\\Component\\\\Core\\\\Util\\\\Hash\\.$#" + count: 2 + path: src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\:\\:__construct\\(\\) has parameter \\$methods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Compression/CompressionMethodManager.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$recipients with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWE.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWE.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWE.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:getSharedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWE.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:getSharedProtectedHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWE.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:addRecipient\\(\\) has parameter \\$recipientHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkAndSetContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header1 with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:checkDuplicatedHeaderParameters\\(\\) has parameter \\$header2 with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:determineCEK\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:encryptJWE\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getCompressionMethod\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKey\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKey\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyAgreementAndKeyWrappingAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyAgreementAndKeyWrappingAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyEncryptionAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyWrappingAlgorithm\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getEncryptedKeyFromKeyWrappingAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:processRecipient\\(\\) has parameter \\$additionalHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:processRecipient\\(\\) has parameter \\$recipient with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:withSharedHeader\\(\\) has parameter \\$sharedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:withSharedProtectedHeader\\(\\) has parameter \\$sharedProtectedHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, \\(float\\|int\\) given\\.$#" + count: 2 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$recipients type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$sharedHeader type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$sharedProtectedHeader type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:checkCompleteHeader\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decompressIfNeeded\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptCEK\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptPayload\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:getContentEncryptionAlgorithm\\(\\) has parameter \\$completeHeader with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:getKeyEncryptionAlgorithm\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\Core\\\\Util\\\\KeyChecker\\:\\:checkKeyAlgorithm\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" + count: 2 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\Core\\\\Util\\\\KeyChecker\\:\\:checkKeyUsage\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Parameter \\#3 \\$recipientKey of method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptCEK\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$contentEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$headerCheckers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$keyEncryptionAlgorithms with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$serializers with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/JWELoaderFactory.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Recipient\\:\\:__construct\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Recipient.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Recipient\\:\\:getHeader\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Recipient.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:checkData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:processHeaders\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONFlattenedSerializer\\:\\:processHeaders\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + count: 3 + path: src/Library/Encryption/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:checkData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processRecipient\\(\\) has parameter \\$recipient with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processRecipient\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + count: 3 + path: src/Library/Encryption/Serializer/JSONGeneralSerializer.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\Message\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/Message.php + + - + message: "#^Class Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\MessageBag implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/MessageBag.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\MessageBag\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/MessageBag.php + + - + message: "#^Cannot call method get\\(\\) on mixed\\.$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/MixedKeyTypes.php + + - + message: "#^Cannot call method get\\(\\) on mixed\\.$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php + + - + message: "#^Cannot call method has\\(\\) on mixed\\.$#" + count: 1 + path: src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + count: 2 + path: src/Library/KeyManagement/Analyzer/UsageAnalyzer.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JKUFactory\\:\\:loadFromUrl\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JKUFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromCertificate\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromCertificateFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKey\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKeyFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromPKCS12CertificateFile\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromSecret\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromValues\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX509Resource\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX5C\\(\\) has parameter \\$additional_values with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromX5C\\(\\) has parameter \\$x5c with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Parameter \\#1 \\$key of static method Jose\\\\Component\\\\KeyManagement\\\\JWKFactory\\:\\:createFromKey\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, \\(float\\|int\\) given\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\ given\\.$#" + count: 1 + path: src/Library/KeyManagement/JWKFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:getSupportedCurves\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:loadJWK\\(\\) has parameter \\$jwk with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:loadPEM\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Property Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\ECKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/ECKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromKey\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromKeyFile\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromX5C\\(\\) has parameter \\$x5c with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadFromX5C\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificate\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificateFile\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromDER\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromPEM\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromX509Resource\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:tryToLoadECKey\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:tryToLoadOtherKeyTypes\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/KeyConverter.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:createFromKeyDetails\\(\\) has parameter \\$details with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:loadJWK\\(\\) has parameter \\$jwk with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Parameter \\#1 \\$details of static method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:createFromKeyDetails\\(\\) expects array, mixed given\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Property Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\RSAKey\\:\\:\\$values type has no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/KeyConverter/RSAKey.php + + - + message: "#^Cannot cast mixed to string\\.$#" + count: 1 + path: src/Library/KeyManagement/X5UFactory.php + + - + message: "#^Method Jose\\\\Component\\\\KeyManagement\\\\X5UFactory\\:\\:loadFromUrl\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" + count: 1 + path: src/Library/KeyManagement/X5UFactory.php + + - + message: "#^Parameter \\#1 \\$certificate of static method Jose\\\\Component\\\\KeyManagement\\\\KeyConverter\\\\KeyConverter\\:\\:loadKeyFromCertificate\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/KeyManagement/X5UFactory.php + + - + message: "#^Call to function array_key_exists\\(\\) with 'key' and array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, header\\?\\: array\\\\} will always evaluate to true\\.$#" + count: 1 + path: src/Library/NestedToken/NestedTokenBuilder.php + + - + message: "#^Call to function array_key_exists\\(\\) with 'key' and array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, protected_header\\?\\: array\\, header\\?\\: array\\\\} will always evaluate to true\\.$#" + count: 1 + path: src/Library/NestedToken/NestedTokenBuilder.php + + - + message: "#^Call to function is_array\\(\\) with array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, header\\?\\: array\\\\} will always evaluate to true\\.$#" + count: 1 + path: src/Library/NestedToken/NestedTokenBuilder.php + + - + message: "#^Call to function is_array\\(\\) with array\\{key\\: Jose\\\\Component\\\\Core\\\\JWK, protected_header\\?\\: array\\, header\\?\\: array\\\\} will always evaluate to true\\.$#" + count: 1 + path: src/Library/NestedToken/NestedTokenBuilder.php + + - + message: "#^Result of \\|\\| is always false\\.$#" + count: 2 + path: src/Library/NestedToken/NestedTokenBuilder.php + + - + message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and '' will always evaluate to false\\.$#" + count: 1 + path: src/Library/Signature/Algorithm/None.php + + - + message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#" + count: 1 + path: src/Library/Signature/Algorithm/Util/RSA.php + + - + message: "#^Variable static method call on Jose\\\\Component\\\\Core\\\\Util\\\\Hash\\.$#" + count: 2 + path: src/Library/Signature/Algorithm/Util/RSA.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" + count: 1 + path: src/Library/Signature/JWS.php + + - + message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" + count: 1 + path: src/Library/Signature/JWS.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" + count: 1 + path: src/Library/Signature/JWSBuilder.php + + - + message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array\\ given\\.$#" + count: 1 + path: src/Library/Signature/JWSBuilder.php + + - + message: "#^Parameter \\#1 \\$algorithm of method Jose\\\\Component\\\\Core\\\\AlgorithmManager\\:\\:get\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/Signature/JWSVerifier.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" + count: 1 + path: src/Library/Signature/JWSVerifier.php + + - + message: "#^Parameter \\#1 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\Serializer\\:\\:isPayloadEncoded\\(\\) expects array\\, array given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/CompactSerializer.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/CompactSerializer.php + + - + message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Parameter \\#1 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\Serializer\\:\\:isPayloadEncoded\\(\\) expects array\\, array given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php + + - + message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Cannot access offset 'signature' on mixed\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#1 \\$encodedString of static method ParagonIE\\\\ConstantTime\\\\Base64\\:\\:decodeNoPadding\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#1 \\$signature of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processHeaders\\(\\) expects array\\{protected\\?\\: string, header\\?\\: array\\\\}, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\JSONGeneralSerializer\\:\\:processIsPayloadEncoded\\(\\) expects array\\, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#3 \\$encodedProtectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects string\\|null, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php + + - + message: "#^Parameter \\#4 \\$header of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, mixed given\\.$#" + count: 1 + path: src/Library/Signature/Serializer/JSONGeneralSerializer.php diff --git a/phpstan.neon b/phpstan.neon index 510aa59fb..f197b0c66 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,12 +1,12 @@ parameters: - level: max - paths: - - src - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: true - treatPhpDocTypesAsCertain: true - checkUninitializedProperties: true - checkDynamicProperties: true + level: max + paths: + - src + checkMissingIterableValueType: true + checkGenericClassInNonGenericObjectType: true + treatPhpDocTypesAsCertain: true + checkUninitializedProperties: true + checkDynamicProperties: true includes: - - vendor/phpstan/phpstan/conf/bleedingEdge.neon - - phpstan-baseline.neon + - vendor/phpstan/phpstan/conf/bleedingEdge.neon + - phpstan-baseline.neon diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 16fed37a6..5e5d862e9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,22 +2,16 @@ - - - ./src - - + ./tests/ @@ -33,7 +27,9 @@ - - - + + + ./src + + diff --git a/rector.php b/rector.php index dfa7dd602..69897c226 100644 --- a/rector.php +++ b/rector.php @@ -1,47 +1,42 @@ import(SetList::DEAD_CODE); $config->import(LevelSetList::UP_TO_PHP_81); $config->import(SymfonyLevelSetList::UP_TO_SYMFONY_54); - $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); + $config->import(SymfonySetList::SYMFONY_50_TYPES); $config->import(SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES); + $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); $config->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION); $config->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES); $config->import(DoctrineSetList::DOCTRINE_CODE_QUALITY); $config->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES); - $config->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD); - $config->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_90); $config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); - $config->import(PHPUnitSetList::PHPUNIT_EXCEPTION); - $config->import(PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER); - $config->import(PHPUnitSetList::REMOVE_MOCKS); + $config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES); + $config->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_100); $config->paths([ __DIR__ . '/ecs.php', __DIR__ . '/rector.php', - __DIR__ . '/monorepo-builder.php', __DIR__ . '/performance', __DIR__ . '/src', __DIR__ . '/tests', ]); $config->skip([ - AnnotationToAttributeRector::class => __DIR__ . '/tests', - AnnotationWithValueToAttributeRector::class => __DIR__ . '/tests', - __DIR__ . '/src/Component/Core/JWKSet.php', + PreferPHPUnitThisCallRector::class => __DIR__ . '/tests', + __DIR__ . '/src/Library/Core/JWKSet.php', __DIR__ . '/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php', __DIR__ . '/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php', ]); diff --git a/packs/encryption/.github/CONTRIBUTING.md b/src/Bundle/.github/CONTRIBUTING.md similarity index 100% rename from packs/encryption/.github/CONTRIBUTING.md rename to src/Bundle/.github/CONTRIBUTING.md diff --git a/src/Bundle/JoseFramework/.github/FUNDING.yml b/src/Bundle/.github/FUNDING.yml similarity index 100% rename from src/Bundle/JoseFramework/.github/FUNDING.yml rename to src/Bundle/.github/FUNDING.yml diff --git a/packs/encryption/.github/PULL_REQUEST_TEMPLATE.md b/src/Bundle/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from packs/encryption/.github/PULL_REQUEST_TEMPLATE.md rename to src/Bundle/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Bundle/JoseFramework/.github/stale.yml b/src/Bundle/.github/stale.yml similarity index 100% rename from src/Bundle/JoseFramework/.github/stale.yml rename to src/Bundle/.github/stale.yml diff --git a/src/Bundle/JoseFramework/Controller/JWKSetController.php b/src/Bundle/Controller/JWKSetController.php similarity index 100% rename from src/Bundle/JoseFramework/Controller/JWKSetController.php rename to src/Bundle/Controller/JWKSetController.php diff --git a/src/Bundle/JoseFramework/Controller/JWKSetControllerFactory.php b/src/Bundle/Controller/JWKSetControllerFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Controller/JWKSetControllerFactory.php rename to src/Bundle/Controller/JWKSetControllerFactory.php diff --git a/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php b/src/Bundle/DataCollector/AlgorithmCollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php rename to src/Bundle/DataCollector/AlgorithmCollector.php index 54aeafe13..ebb47e3b7 100644 --- a/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php +++ b/src/Bundle/DataCollector/AlgorithmCollector.php @@ -4,7 +4,6 @@ namespace Jose\Bundle\JoseFramework\DataCollector; -use function array_key_exists; use Jose\Component\Core\Algorithm; use Jose\Component\Core\AlgorithmManagerFactory; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; @@ -14,6 +13,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Throwable; +use function array_key_exists; final class AlgorithmCollector implements Collector { diff --git a/src/Bundle/JoseFramework/DataCollector/CheckerCollector.php b/src/Bundle/DataCollector/CheckerCollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/CheckerCollector.php rename to src/Bundle/DataCollector/CheckerCollector.php diff --git a/src/Bundle/JoseFramework/DataCollector/Collector.php b/src/Bundle/DataCollector/Collector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/Collector.php rename to src/Bundle/DataCollector/Collector.php diff --git a/src/Bundle/JoseFramework/DataCollector/JWECollector.php b/src/Bundle/DataCollector/JWECollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/JWECollector.php rename to src/Bundle/DataCollector/JWECollector.php diff --git a/src/Bundle/JoseFramework/DataCollector/JWSCollector.php b/src/Bundle/DataCollector/JWSCollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/JWSCollector.php rename to src/Bundle/DataCollector/JWSCollector.php diff --git a/src/Bundle/JoseFramework/DataCollector/JoseCollector.php b/src/Bundle/DataCollector/JoseCollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/JoseCollector.php rename to src/Bundle/DataCollector/JoseCollector.php diff --git a/src/Bundle/JoseFramework/DataCollector/KeyCollector.php b/src/Bundle/DataCollector/KeyCollector.php similarity index 100% rename from src/Bundle/JoseFramework/DataCollector/KeyCollector.php rename to src/Bundle/DataCollector/KeyCollector.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/AlgorithmCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/AlgorithmCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php index 21f75fa49..23079b712 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/AlgorithmCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/AlgorithmCompilerPass.php @@ -12,9 +12,6 @@ final class AlgorithmCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(AlgorithmManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php index d80f56969..f5b252d63 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/CheckerCollectorCompilerPass.php @@ -12,9 +12,6 @@ final class CheckerCollectorCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(CheckerCollector::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php index 9717e07ef..176c28af6 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/ClaimCheckerCompilerPass.php @@ -12,9 +12,6 @@ final class ClaimCheckerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(ClaimCheckerManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/CompressionMethodCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/CompressionMethodCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/CompressionMethodCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/CompressionMethodCompilerPass.php index a37987a9f..dfcbf369f 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/CompressionMethodCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/CompressionMethodCompilerPass.php @@ -12,9 +12,6 @@ final class CompressionMethodCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(CompressionMethodManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/DataCollectorCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/DataCollectorCompilerPass.php similarity index 96% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/DataCollectorCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/DataCollectorCompilerPass.php index aa34e3a67..a2660d70b 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/DataCollectorCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/DataCollectorCompilerPass.php @@ -11,9 +11,6 @@ final class DataCollectorCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JoseCollector::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php similarity index 96% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php index 821f3b059..bed7d5f86 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/EncryptionSerializerCompilerPass.php @@ -11,9 +11,6 @@ final class EncryptionSerializerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JWESerializerManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php similarity index 94% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php index eb9d61a93..647c5ea33 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/EventDispatcherAliasCompilerPass.php @@ -10,9 +10,6 @@ final class EventDispatcherAliasCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition('event_dispatcher') || $container->hasAlias(EventDispatcherInterface::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php similarity index 98% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php index d96884eee..8e67c341f 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/HeaderCheckerCompilerPass.php @@ -13,9 +13,6 @@ final class HeaderCheckerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(HeaderCheckerManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/JWECollectorCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/JWECollectorCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/JWECollectorCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/JWECollectorCompilerPass.php index 85d59e4df..6296489ba 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/JWECollectorCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/JWECollectorCompilerPass.php @@ -12,9 +12,6 @@ final class JWECollectorCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JWECollector::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/JWSCollectorCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/JWSCollectorCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/JWSCollectorCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/JWSCollectorCompilerPass.php index b096cc1e4..8689c7094 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/JWSCollectorCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/JWSCollectorCompilerPass.php @@ -12,9 +12,6 @@ final class JWSCollectorCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JWSCollector::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php similarity index 96% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php index ffd445748..a0228635e 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/KeyAnalyzerCompilerPass.php @@ -11,9 +11,6 @@ final class KeyAnalyzerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(KeyAnalyzerManager::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyCollectorCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/KeyCollectorCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyCollectorCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/KeyCollectorCompilerPass.php index 393bc5472..95a4b33f8 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeyCollectorCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/KeyCollectorCompilerPass.php @@ -12,9 +12,6 @@ final class KeyCollectorCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(KeyCollector::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeySetControllerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/KeySetControllerCompilerPass.php similarity index 97% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/KeySetControllerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/KeySetControllerCompilerPass.php index c924a0354..3beaf4d99 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeySetControllerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/KeySetControllerCompilerPass.php @@ -11,9 +11,6 @@ final class KeySetControllerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JWKSetLoader::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php similarity index 96% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php index 2ca43d6fa..41a096522 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/KeysetAnalyzerCompilerPass.php @@ -11,9 +11,6 @@ final class KeysetAnalyzerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(KeysetAnalyzerManager::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php similarity index 96% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php index 4f72ecdf7..255686f08 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php +++ b/src/Bundle/DependencyInjection/Compiler/SignatureSerializerCompilerPass.php @@ -11,9 +11,6 @@ final class SignatureSerializerCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(JWSSerializerManagerFactory::class)) { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Compiler/SymfonySerializerCompilerPass.php b/src/Bundle/DependencyInjection/Compiler/SymfonySerializerCompilerPass.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Compiler/SymfonySerializerCompilerPass.php rename to src/Bundle/DependencyInjection/Compiler/SymfonySerializerCompilerPass.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Configuration.php b/src/Bundle/DependencyInjection/Configuration.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Configuration.php rename to src/Bundle/DependencyInjection/Configuration.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/JoseFrameworkExtension.php b/src/Bundle/DependencyInjection/JoseFrameworkExtension.php similarity index 95% rename from src/Bundle/JoseFramework/DependencyInjection/JoseFrameworkExtension.php rename to src/Bundle/DependencyInjection/JoseFrameworkExtension.php index 76ae713d9..d27456666 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/JoseFrameworkExtension.php +++ b/src/Bundle/DependencyInjection/JoseFrameworkExtension.php @@ -4,12 +4,12 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection; -use function count; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use function count; final class JoseFrameworkExtension extends Extension implements PrependExtensionInterface { @@ -28,7 +28,6 @@ public function getAlias(): string } /** - * {@inheritdoc} * @param array $configs */ public function load(array $configs, ContainerBuilder $container): void @@ -41,17 +40,11 @@ public function load(array $configs, ContainerBuilder $container): void } } - /** - * {@inheritdoc} - */ public function getConfiguration(array $configs, ContainerBuilder $container): Configuration { return new Configuration($this->getAlias(), $this->sources); } - /** - * {@inheritdoc} - */ public function prepend(ContainerBuilder $container): void { $configs = $container->getExtensionConfig($this->getAlias()); diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/AbstractSource.php b/src/Bundle/DependencyInjection/Source/AbstractSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/AbstractSource.php rename to src/Bundle/DependencyInjection/Source/AbstractSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php b/src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php similarity index 85% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php rename to src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php index a2736007c..c504c892d 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/Checker/CheckerSource.php +++ b/src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php @@ -4,20 +4,18 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Checker; -use function array_key_exists; -use function count; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\ClaimCheckerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\HeaderCheckerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; use Jose\Bundle\JoseFramework\DependencyInjection\Source\SourceWithCompilerPasses; -use Jose\Component\Checker\ClaimCheckerManagerFactory; -use Jose\Component\Checker\HeaderCheckerManagerFactory; use Jose\Component\Checker\TokenTypeSupport; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; class CheckerSource implements SourceWithCompilerPasses { @@ -38,9 +36,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $container->registerForAutoconfiguration(TokenTypeSupport::class)->addTag('jose.checker.token_type'); $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('checkers.php'); @@ -55,9 +50,6 @@ public function load(array $configs, ContainerBuilder $container): void public function getNodeDefinition(NodeDefinition $node): void { - if (! $this->isEnabled()) { - return; - } $node->children() ->scalarNode('clock') ->defaultValue('jose.internal_clock') @@ -79,9 +71,6 @@ public function getNodeDefinition(NodeDefinition $node): void public function prepend(ContainerBuilder $container, array $config): array { - if (! $this->isEnabled()) { - return []; - } $result = []; foreach ($this->sources as $source) { $prepend = $source->prepend($container, $config); @@ -100,9 +89,4 @@ public function getCompilerPasses(): array { return [new ClaimCheckerCompilerPass(), new HeaderCheckerCompilerPass()]; } - - private function isEnabled(): bool - { - return class_exists(HeaderCheckerManagerFactory::class) && class_exists(ClaimCheckerManagerFactory::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php b/src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Checker/ClaimChecker.php rename to src/Bundle/DependencyInjection/Source/Checker/ClaimChecker.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php b/src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Checker/HeaderChecker.php rename to src/Bundle/DependencyInjection/Source/Checker/HeaderChecker.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php b/src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php similarity index 80% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php rename to src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php index a3f0ecba7..b18e87262 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/Console/ConsoleSource.php +++ b/src/Bundle/DependencyInjection/Source/Console/ConsoleSource.php @@ -5,7 +5,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Console; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; -use Jose\Component\Console\EcKeyGeneratorCommand; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -20,9 +19,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('commands.php'); } @@ -35,9 +31,4 @@ public function prepend(ContainerBuilder $container, array $config): array { return []; } - - private function isEnabled(): bool - { - return class_exists(EcKeyGeneratorCommand::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Core/CoreSource.php b/src/Bundle/DependencyInjection/Source/Core/CoreSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Core/CoreSource.php rename to src/Bundle/DependencyInjection/Source/Core/CoreSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php b/src/Bundle/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php rename to src/Bundle/DependencyInjection/Source/Encryption/AbstractEncryptionSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php b/src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php similarity index 90% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php rename to src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php index 0cf06b113..913968f7d 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php +++ b/src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php @@ -4,9 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Encryption; -use function array_key_exists; -use function count; -use function in_array; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\CompressionMethodCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\EncryptionSerializerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; @@ -21,14 +18,15 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHES; use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2AESKW; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA; -use Jose\Component\Encryption\JWEBuilderFactory; -use Jose\Component\Encryption\JWEDecrypterFactory; use Jose\Component\Encryption\Serializer\JWESerializer as JWESerializerAlias; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; +use function in_array; class EncryptionSource implements SourceWithCompilerPasses { @@ -49,9 +47,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $container->registerForAutoconfiguration(JWESerializerAlias::class)->addTag('jose.jwe.serializer'); $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('jwe_services.php'); @@ -74,9 +69,6 @@ public function load(array $configs, ContainerBuilder $container): void public function getNodeDefinition(NodeDefinition $node): void { - if (! $this->isEnabled()) { - return; - } $childNode = $node->children() ->arrayNode($this->name()) ->addDefaultsIfNotSet() @@ -90,9 +82,6 @@ public function getNodeDefinition(NodeDefinition $node): void public function prepend(ContainerBuilder $container, array $config): array { - if (! $this->isEnabled()) { - return []; - } $result = []; foreach ($this->sources as $source) { $prepend = $source->prepend($container, $config); @@ -131,9 +120,4 @@ private function getAlgorithmsFiles(): array return $list; } - - private function isEnabled(): bool - { - return class_exists(JWEBuilderFactory::class) && class_exists(JWEDecrypterFactory::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEBuilder.php b/src/Bundle/DependencyInjection/Source/Encryption/JWEBuilder.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEBuilder.php rename to src/Bundle/DependencyInjection/Source/Encryption/JWEBuilder.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEDecrypter.php b/src/Bundle/DependencyInjection/Source/Encryption/JWEDecrypter.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWEDecrypter.php rename to src/Bundle/DependencyInjection/Source/Encryption/JWEDecrypter.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php b/src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWELoader.php rename to src/Bundle/DependencyInjection/Source/Encryption/JWELoader.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php b/src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/JWESerializer.php rename to src/Bundle/DependencyInjection/Source/Encryption/JWESerializer.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php similarity index 85% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php index ee71c50d5..a497b891e 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JKUSource.php +++ b/src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php @@ -5,7 +5,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; -use Jose\Component\Console\JKULoaderCommand; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -23,11 +22,11 @@ public function load(array $configs, ContainerBuilder $container): void if ($configs[$this->name()]['enabled'] === true) { $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('jku_source.php'); - if (class_exists(JKULoaderCommand::class)) { - $loader->load('jku_commands.php'); - } + $loader->load('jku_commands.php'); $container->setAlias('jose.http_client', $configs[$this->name()]['client']); - $container->setAlias('jose.request_factory', $configs[$this->name()]['request_factory']); + if (isset($configs[$this->name()]['request_factory'])) { + $container->setAlias('jose.request_factory', $configs[$this->name()]['request_factory']); + } } } @@ -45,7 +44,6 @@ public function getNodeDefinition(NodeDefinition $node): void ->end() ->scalarNode('request_factory') ->info('The request factory service.') - ->isRequired() ->end() ->end() ->end() diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php similarity index 95% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php index 142acbb4c..2e324f463 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php +++ b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource.php @@ -4,8 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement; -use function array_key_exists; -use function count; use InvalidArgumentException; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSetSource\JWKSetSource as JWKSetSourceInterface; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; @@ -14,6 +12,8 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; class JWKSetSource implements Source { @@ -52,9 +52,7 @@ public function getNodeDefinition(NodeDefinition $node): void ->useAttributeAsKey('name') ->arrayPrototype() ->validate() - ->ifTrue(function ($config): bool { - return count($config) !== 1; - }) + ->ifTrue(fn ($config): bool => count($config) !== 1) ->thenInvalid('One key set type must be set.') ->end() ->children(); @@ -84,7 +82,7 @@ private function getJWKSetSources(): array $tempContainer->registerForAutoconfiguration(JWKSetSourceInterface::class)->addTag('jose.jwkset_source'); $loader = new PhpFileLoader($tempContainer, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('jwkset_sources.php'); - $tempContainer->compile(); + $tempContainer->compile(true); $services = $tempContainer->findTaggedServiceIds('jose.jwkset_source'); $jwkset_sources = []; diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JKU.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSet.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSetSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSetSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSetSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/JWKSetSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSetSource/X5U.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php similarity index 95% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php index 94fb3191e..f3d083789 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php +++ b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource.php @@ -4,8 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement; -use function array_key_exists; -use function count; use InvalidArgumentException; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource\JWKSource as JWKSourceInterface; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; @@ -14,6 +12,8 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; class JWKSource implements Source { @@ -52,9 +52,7 @@ public function getNodeDefinition(NodeDefinition $node): void ->useAttributeAsKey('name') ->arrayPrototype() ->validate() - ->ifTrue(function ($config): bool { - return count($config) !== 1; - }) + ->ifTrue(fn ($config): bool => count($config) !== 1) ->thenInvalid('One key type must be set.') ->end() ->children(); @@ -84,7 +82,7 @@ private function getJWKSources(): array $tempContainer->registerForAutoconfiguration(JWKSourceInterface::class)->addTag('jose.jwk_source'); $loader = new PhpFileLoader($tempContainer, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('jwk_sources.php'); - $tempContainer->compile(); + $tempContainer->compile(true); $services = $tempContainer->findTaggedServiceIds('jose.jwk_source'); $jwkSources = []; diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/CertificateFile.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWK.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php index 97142000c..4d2a8843b 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php +++ b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSet.php @@ -4,8 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource; -use function is_int; -use function is_string; use Jose\Bundle\JoseFramework\DependencyInjection\Source\AbstractSource; use Jose\Component\Core\JWK; use Jose\Component\KeyManagement\JWKFactory; @@ -13,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; +use function is_int; +use function is_string; class JWKSet extends AbstractSource implements JWKSource { diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/JWKSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/JWKSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/KeyFile.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/P12.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/P12.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/P12.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/P12.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Secret.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Values.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Values.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/Values.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/Values.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKSource/X5C.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKUriSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/JWKUriSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php b/src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php similarity index 88% rename from src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php rename to src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php index 85f2403c9..94c3c6081 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/KeyManagementSource.php +++ b/src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php @@ -4,7 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement; -use function count; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\KeyAnalyzerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\KeysetAnalyzerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\KeySetControllerCompilerPass; @@ -12,12 +11,12 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\SourceWithCompilerPasses; use Jose\Component\KeyManagement\Analyzer\KeyAnalyzer; use Jose\Component\KeyManagement\Analyzer\KeysetAnalyzer; -use Jose\Component\KeyManagement\JWKFactory; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function count; class KeyManagementSource implements SourceWithCompilerPasses { @@ -38,9 +37,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $container->registerForAutoconfiguration(KeyAnalyzer::class)->addTag('jose.key_analyzer'); $container->registerForAutoconfiguration(KeysetAnalyzer::class)->addTag('jose.keyset_analyzer'); $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); @@ -55,9 +51,6 @@ public function load(array $configs, ContainerBuilder $container): void public function getNodeDefinition(NodeDefinition $node): void { - if (! $this->isEnabled()) { - return; - } foreach ($this->sources as $source) { $source->getNodeDefinition($node); } @@ -65,9 +58,6 @@ public function getNodeDefinition(NodeDefinition $node): void public function prepend(ContainerBuilder $container, array $config): array { - if (! $this->isEnabled()) { - return []; - } $result = []; foreach ($this->sources as $source) { $prepend = $source->prepend($container, $config); @@ -90,9 +80,4 @@ public function getCompilerPasses(): array new KeySetControllerCompilerPass(), ]; } - - private function isEnabled(): bool - { - return class_exists(JWKFactory::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php b/src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php similarity index 78% rename from src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php rename to src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php index 832aeb80b..2068977cf 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php +++ b/src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php @@ -4,15 +4,13 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\NestedToken; -use function array_key_exists; -use function count; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; -use Jose\Component\NestedToken\NestedTokenBuilder as JoseNestedTokenBuilder; -use Jose\Component\NestedToken\NestedTokenLoader as JoseNestedTokenLoader; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; class NestedToken implements Source { @@ -33,9 +31,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../../Resources/config')); $loader->load('nested_token.php'); @@ -48,9 +43,6 @@ public function load(array $configs, ContainerBuilder $container): void public function getNodeDefinition(NodeDefinition $node): void { - if (! $this->isEnabled()) { - return; - } $childNode = $node->children() ->arrayNode($this->name()) ->treatNullLike([]) @@ -63,9 +55,6 @@ public function getNodeDefinition(NodeDefinition $node): void public function prepend(ContainerBuilder $container, array $config): array { - if (! $this->isEnabled()) { - return []; - } $result = []; foreach ($this->sources as $source) { $prepend = $source->prepend($container, $config); @@ -76,10 +65,4 @@ public function prepend(ContainerBuilder $container, array $config): array return $result; } - - private function isEnabled(): bool - { - return class_exists(JoseNestedTokenBuilder::class) - && class_exists(JoseNestedTokenLoader::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php b/src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php rename to src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenBuilder.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php b/src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedTokenLoader.php rename to src/Bundle/DependencyInjection/Source/NestedToken/NestedTokenLoader.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/AbstractSignatureSource.php b/src/Bundle/DependencyInjection/Source/Signature/AbstractSignatureSource.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/AbstractSignatureSource.php rename to src/Bundle/DependencyInjection/Source/Signature/AbstractSignatureSource.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSBuilder.php b/src/Bundle/DependencyInjection/Source/Signature/JWSBuilder.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSBuilder.php rename to src/Bundle/DependencyInjection/Source/Signature/JWSBuilder.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php b/src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSLoader.php rename to src/Bundle/DependencyInjection/Source/Signature/JWSLoader.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php b/src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSSerializer.php rename to src/Bundle/DependencyInjection/Source/Signature/JWSSerializer.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSVerifier.php b/src/Bundle/DependencyInjection/Source/Signature/JWSVerifier.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/JWSVerifier.php rename to src/Bundle/DependencyInjection/Source/Signature/JWSVerifier.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php b/src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php similarity index 89% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php rename to src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php index 2822b4ca5..d71aaa5ea 100644 --- a/src/Bundle/JoseFramework/DependencyInjection/Source/Signature/SignatureSource.php +++ b/src/Bundle/DependencyInjection/Source/Signature/SignatureSource.php @@ -4,9 +4,6 @@ namespace Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature; -use function array_key_exists; -use function count; -use function extension_loaded; use Jose\Bundle\JoseFramework\DependencyInjection\Compiler\SignatureSerializerCompilerPass; use Jose\Bundle\JoseFramework\DependencyInjection\Source\Source; use Jose\Bundle\JoseFramework\DependencyInjection\Source\SourceWithCompilerPasses; @@ -16,13 +13,14 @@ use Jose\Component\Signature\Algorithm\HS1; use Jose\Component\Signature\Algorithm\None; use Jose\Component\Signature\Algorithm\RSAPSS; -use Jose\Component\Signature\JWSBuilderFactory; -use Jose\Component\Signature\JWSVerifierFactory; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use function array_key_exists; +use function count; +use function extension_loaded; class SignatureSource implements SourceWithCompilerPasses { @@ -43,9 +41,6 @@ public function name(): string public function load(array $configs, ContainerBuilder $container): void { - if (! $this->isEnabled()) { - return; - } $container->registerForAutoconfiguration(\Jose\Component\Signature\Serializer\JWSSerializer::class)->addTag( 'jose.jws.serializer' ); @@ -69,9 +64,6 @@ public function load(array $configs, ContainerBuilder $container): void public function getNodeDefinition(NodeDefinition $node): void { - if (! $this->isEnabled()) { - return; - } $childNode = $node->children() ->arrayNode($this->name()) ->addDefaultsIfNotSet() @@ -85,9 +77,6 @@ public function getNodeDefinition(NodeDefinition $node): void public function prepend(ContainerBuilder $container, array $config): array { - if (! $this->isEnabled()) { - return []; - } $result = []; foreach ($this->sources as $source) { $prepend = $source->prepend($container, $config); @@ -123,9 +112,4 @@ private function getAlgorithmsFiles(): array return $algorithms; } - - private function isEnabled(): bool - { - return class_exists(JWSBuilderFactory::class) && class_exists(JWSVerifierFactory::class); - } } diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/Source.php b/src/Bundle/DependencyInjection/Source/Source.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/Source.php rename to src/Bundle/DependencyInjection/Source/Source.php diff --git a/src/Bundle/JoseFramework/DependencyInjection/Source/SourceWithCompilerPasses.php b/src/Bundle/DependencyInjection/Source/SourceWithCompilerPasses.php similarity index 100% rename from src/Bundle/JoseFramework/DependencyInjection/Source/SourceWithCompilerPasses.php rename to src/Bundle/DependencyInjection/Source/SourceWithCompilerPasses.php diff --git a/src/Bundle/JoseFramework/EnvVarProcessor/KeyEnvVarProcessor.php b/src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php similarity index 95% rename from src/Bundle/JoseFramework/EnvVarProcessor/KeyEnvVarProcessor.php rename to src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php index 475a805da..6cb50ff24 100644 --- a/src/Bundle/JoseFramework/EnvVarProcessor/KeyEnvVarProcessor.php +++ b/src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php @@ -12,9 +12,6 @@ final class KeyEnvVarProcessor implements EnvVarProcessorInterface { - /** - * {@inheritdoc} - */ public function getEnv(string $prefix, string $name, Closure $getEnv): mixed { $env = $getEnv($name); diff --git a/src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php b/src/Bundle/Event/ClaimCheckedFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/ClaimCheckedFailureEvent.php rename to src/Bundle/Event/ClaimCheckedFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php b/src/Bundle/Event/ClaimCheckedSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/ClaimCheckedSuccessEvent.php rename to src/Bundle/Event/ClaimCheckedSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/HeaderCheckedFailureEvent.php b/src/Bundle/Event/HeaderCheckedFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/HeaderCheckedFailureEvent.php rename to src/Bundle/Event/HeaderCheckedFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/HeaderCheckedSuccessEvent.php b/src/Bundle/Event/HeaderCheckedSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/HeaderCheckedSuccessEvent.php rename to src/Bundle/Event/HeaderCheckedSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php b/src/Bundle/Event/JWEBuiltFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWEBuiltFailureEvent.php rename to src/Bundle/Event/JWEBuiltFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWEBuiltSuccessEvent.php b/src/Bundle/Event/JWEBuiltSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWEBuiltSuccessEvent.php rename to src/Bundle/Event/JWEBuiltSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWEDecryptionFailureEvent.php b/src/Bundle/Event/JWEDecryptionFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWEDecryptionFailureEvent.php rename to src/Bundle/Event/JWEDecryptionFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWEDecryptionSuccessEvent.php b/src/Bundle/Event/JWEDecryptionSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWEDecryptionSuccessEvent.php rename to src/Bundle/Event/JWEDecryptionSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWELoadingFailureEvent.php b/src/Bundle/Event/JWELoadingFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWELoadingFailureEvent.php rename to src/Bundle/Event/JWELoadingFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWELoadingSuccessEvent.php b/src/Bundle/Event/JWELoadingSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWELoadingSuccessEvent.php rename to src/Bundle/Event/JWELoadingSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSBuiltFailureEvent.php b/src/Bundle/Event/JWSBuiltFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSBuiltFailureEvent.php rename to src/Bundle/Event/JWSBuiltFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSBuiltSuccessEvent.php b/src/Bundle/Event/JWSBuiltSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSBuiltSuccessEvent.php rename to src/Bundle/Event/JWSBuiltSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSLoadingFailureEvent.php b/src/Bundle/Event/JWSLoadingFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSLoadingFailureEvent.php rename to src/Bundle/Event/JWSLoadingFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSLoadingSuccessEvent.php b/src/Bundle/Event/JWSLoadingSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSLoadingSuccessEvent.php rename to src/Bundle/Event/JWSLoadingSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSVerificationFailureEvent.php b/src/Bundle/Event/JWSVerificationFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSVerificationFailureEvent.php rename to src/Bundle/Event/JWSVerificationFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/JWSVerificationSuccessEvent.php b/src/Bundle/Event/JWSVerificationSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/JWSVerificationSuccessEvent.php rename to src/Bundle/Event/JWSVerificationSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Event/NestedTokenIssuedEvent.php b/src/Bundle/Event/NestedTokenIssuedEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/NestedTokenIssuedEvent.php rename to src/Bundle/Event/NestedTokenIssuedEvent.php diff --git a/src/Bundle/JoseFramework/Event/NestedTokenLoadingFailureEvent.php b/src/Bundle/Event/NestedTokenLoadingFailureEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/NestedTokenLoadingFailureEvent.php rename to src/Bundle/Event/NestedTokenLoadingFailureEvent.php diff --git a/src/Bundle/JoseFramework/Event/NestedTokenLoadingSuccessEvent.php b/src/Bundle/Event/NestedTokenLoadingSuccessEvent.php similarity index 100% rename from src/Bundle/JoseFramework/Event/NestedTokenLoadingSuccessEvent.php rename to src/Bundle/Event/NestedTokenLoadingSuccessEvent.php diff --git a/src/Bundle/JoseFramework/Helper/ConfigurationHelper.php b/src/Bundle/Helper/ConfigurationHelper.php similarity index 100% rename from src/Bundle/JoseFramework/Helper/ConfigurationHelper.php rename to src/Bundle/Helper/ConfigurationHelper.php index 9f2708615..61873e264 100644 --- a/src/Bundle/JoseFramework/Helper/ConfigurationHelper.php +++ b/src/Bundle/Helper/ConfigurationHelper.php @@ -4,8 +4,8 @@ namespace Jose\Bundle\JoseFramework\Helper; -use function is_array; use Symfony\Component\DependencyInjection\ContainerBuilder; +use function is_array; class ConfigurationHelper { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcmkw.php b/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcmkw.php deleted file mode 100644 index c9d76d078..000000000 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcmkw.php +++ /dev/null @@ -1,41 +0,0 @@ -services() - ->defaults() - ->private() - ->autoconfigure() - ->autowire(); - - $container->set(A128GCMKW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A128GCMKW', - ]); - - $container->set(A192GCMKW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A192GCMKW', - ]); - - $container->set(A256GCMKW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A256GCMKW', - ]); -}; diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aeskw.php b/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aeskw.php deleted file mode 100644 index 4283e8cf9..000000000 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aeskw.php +++ /dev/null @@ -1,41 +0,0 @@ -services() - ->defaults() - ->private() - ->autoconfigure() - ->autowire(); - - $container->set(A128KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A128KW', - ]); - - $container->set(A192KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A192KW', - ]); - - $container->set(A256KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'A256KW', - ]); -}; diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_pbes2.php b/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_pbes2.php deleted file mode 100644 index 6b77daa4e..000000000 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_pbes2.php +++ /dev/null @@ -1,41 +0,0 @@ -services() - ->defaults() - ->private() - ->autoconfigure() - ->autowire(); - - $container->set(PBES2HS256A128KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'PBES2-HS256+A128KW', - ]); - - $container->set(PBES2HS384A192KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'PBES2-HS384+A192KW', - ]); - - $container->set(PBES2HS512A256KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'PBES2-HS512+A256KW', - ]); -}; diff --git a/src/Bundle/JoseFramework/JoseFrameworkBundle.php b/src/Bundle/JoseFrameworkBundle.php similarity index 100% rename from src/Bundle/JoseFramework/JoseFrameworkBundle.php rename to src/Bundle/JoseFrameworkBundle.php diff --git a/src/Component/Checker/LICENSE b/src/Bundle/LICENSE similarity index 96% rename from src/Component/Checker/LICENSE rename to src/Bundle/LICENSE index 37cf976b1..5ab750604 100644 --- a/src/Component/Checker/LICENSE +++ b/src/Bundle/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2019 Spomky-Labs +Copyright (c) 2014-2024 Spomky-Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Bundle/JoseFramework/README.md b/src/Bundle/README.md similarity index 100% rename from src/Bundle/JoseFramework/README.md rename to src/Bundle/README.md diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aescbc.php b/src/Bundle/Resources/config/Algorithms/encryption_aescbc.php similarity index 81% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aescbc.php rename to src/Bundle/Resources/config/Algorithms/encryption_aescbc.php index de416e0e8..0cdb60f7f 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aescbc.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_aescbc.php @@ -5,16 +5,6 @@ use Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256CBCHS512; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcm.php b/src/Bundle/Resources/config/Algorithms/encryption_aesgcm.php similarity index 81% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcm.php rename to src/Bundle/Resources/config/Algorithms/encryption_aesgcm.php index ef15433d5..ae4b659d9 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_aesgcm.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_aesgcm.php @@ -5,16 +5,6 @@ use Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/Resources/config/Algorithms/encryption_aesgcmkw.php b/src/Bundle/Resources/config/Algorithms/encryption_aesgcmkw.php new file mode 100644 index 000000000..f0cc79acd --- /dev/null +++ b/src/Bundle/Resources/config/Algorithms/encryption_aesgcmkw.php @@ -0,0 +1,34 @@ +services() + ->defaults() + ->private() + ->autoconfigure() + ->autowire(); + + if (interface_exists(Wrapper::class)) { + $container->set(A128GCMKW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A128GCMKW', + ]); + + $container->set(A192GCMKW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A192GCMKW', + ]); + + $container->set(A256GCMKW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A256GCMKW', + ]); + } +}; diff --git a/src/Bundle/Resources/config/Algorithms/encryption_aeskw.php b/src/Bundle/Resources/config/Algorithms/encryption_aeskw.php new file mode 100644 index 000000000..c7e63ffad --- /dev/null +++ b/src/Bundle/Resources/config/Algorithms/encryption_aeskw.php @@ -0,0 +1,34 @@ +services() + ->defaults() + ->private() + ->autoconfigure() + ->autowire(); + + if (interface_exists(Wrapper::class)) { + $container->set(A128KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A128KW', + ]); + + $container->set(A192KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A192KW', + ]); + + $container->set(A256KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'A256KW', + ]); + } +}; diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_dir.php b/src/Bundle/Resources/config/Algorithms/encryption_dir.php similarity index 70% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_dir.php rename to src/Bundle/Resources/config/Algorithms/encryption_dir.php index ce325b364..4e77f0c37 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_dir.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_dir.php @@ -3,16 +3,6 @@ declare(strict_types=1); use Jose\Component\Encryption\Algorithm\KeyEncryption\Dir; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_ecdhes.php b/src/Bundle/Resources/config/Algorithms/encryption_ecdhes.php similarity index 52% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_ecdhes.php rename to src/Bundle/Resources/config/Algorithms/encryption_ecdhes.php index 340f5e0ea..1dafb5799 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_ecdhes.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_ecdhes.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use AESKW\Wrapper; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHES; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA192KW; @@ -10,16 +11,6 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA256KW; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { @@ -34,38 +25,40 @@ 'alias' => 'ECDH-ES', ]); - $container->set(ECDHESA128KW::class) + $container->set(ECDHSS::class) ->tag('jose.algorithm', [ - 'alias' => 'ECDH-ES+A128KW', + 'alias' => 'ECDH-SS', ]); - $container->set(ECDHESA192KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-ES+A192KW', - ]); + if (interface_exists(Wrapper::class)) { + $container->set(ECDHESA128KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-ES+A128KW', + ]); - $container->set(ECDHESA256KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-ES+A256KW', - ]); + $container->set(ECDHESA192KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-ES+A192KW', + ]); - $container->set(ECDHSS::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-SS', - ]); + $container->set(ECDHESA256KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-ES+A256KW', + ]); - $container->set(ECDHSSA128KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-SS+A128KW', - ]); + $container->set(ECDHSSA128KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-SS+A128KW', + ]); - $container->set(ECDHSSA192KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-SS+A192KW', - ]); + $container->set(ECDHSSA192KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-SS+A192KW', + ]); - $container->set(ECDHSSA256KW::class) - ->tag('jose.algorithm', [ - 'alias' => 'ECDH-SS+A256KW', - ]); + $container->set(ECDHSSA256KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'ECDH-SS+A256KW', + ]); + } }; diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental.php b/src/Bundle/Resources/config/Algorithms/encryption_experimental.php similarity index 93% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental.php rename to src/Bundle/Resources/config/Algorithms/encryption_experimental.php index b4b97ae7f..9fae6661d 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_experimental.php @@ -15,16 +15,6 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\A256CTR; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP384; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP512; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; /* diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php b/src/Bundle/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php similarity index 78% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php rename to src/Bundle/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php index 1d5d52ea0..db0dee1a9 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_experimental_chacha20_poly1305.php @@ -3,16 +3,6 @@ declare(strict_types=1); use Jose\Component\Encryption\Algorithm\KeyEncryption\Chacha20Poly1305; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; /* diff --git a/src/Bundle/Resources/config/Algorithms/encryption_pbes2.php b/src/Bundle/Resources/config/Algorithms/encryption_pbes2.php new file mode 100644 index 000000000..291972b89 --- /dev/null +++ b/src/Bundle/Resources/config/Algorithms/encryption_pbes2.php @@ -0,0 +1,34 @@ +services() + ->defaults() + ->private() + ->autoconfigure() + ->autowire(); + + if (interface_exists(Wrapper::class)) { + $container->set(PBES2HS256A128KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'PBES2-HS256+A128KW', + ]); + + $container->set(PBES2HS384A192KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'PBES2-HS384+A192KW', + ]); + + $container->set(PBES2HS512A256KW::class) + ->tag('jose.algorithm', [ + 'alias' => 'PBES2-HS512+A256KW', + ]); + } +}; diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_rsa.php b/src/Bundle/Resources/config/Algorithms/encryption_rsa.php similarity index 80% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_rsa.php rename to src/Bundle/Resources/config/Algorithms/encryption_rsa.php index d6609ddb9..e9f9d117b 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/encryption_rsa.php +++ b/src/Bundle/Resources/config/Algorithms/encryption_rsa.php @@ -5,16 +5,6 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA15; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_ecdsa.php b/src/Bundle/Resources/config/Algorithms/signature_ecdsa.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_ecdsa.php rename to src/Bundle/Resources/config/Algorithms/signature_ecdsa.php index eff24e574..fdbac9008 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_ecdsa.php +++ b/src/Bundle/Resources/config/Algorithms/signature_ecdsa.php @@ -5,16 +5,6 @@ use Jose\Component\Signature\Algorithm\ES256; use Jose\Component\Signature\Algorithm\ES384; use Jose\Component\Signature\Algorithm\ES512; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_eddsa.php b/src/Bundle/Resources/config/Algorithms/signature_eddsa.php similarity index 69% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_eddsa.php rename to src/Bundle/Resources/config/Algorithms/signature_eddsa.php index 1cb31f09c..a7a568ade 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_eddsa.php +++ b/src/Bundle/Resources/config/Algorithms/signature_eddsa.php @@ -3,16 +3,6 @@ declare(strict_types=1); use Jose\Component\Signature\Algorithm\EdDSA; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_experimental.php b/src/Bundle/Resources/config/Algorithms/signature_experimental.php similarity index 86% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_experimental.php rename to src/Bundle/Resources/config/Algorithms/signature_experimental.php index 94cde233f..7517626ed 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_experimental.php +++ b/src/Bundle/Resources/config/Algorithms/signature_experimental.php @@ -7,16 +7,6 @@ use Jose\Component\Signature\Algorithm\HS1; use Jose\Component\Signature\Algorithm\HS256_64; use Jose\Component\Signature\Algorithm\RS1; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; /* diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_hmac.php b/src/Bundle/Resources/config/Algorithms/signature_hmac.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_hmac.php rename to src/Bundle/Resources/config/Algorithms/signature_hmac.php index 7f7973e94..f88eb4e4d 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_hmac.php +++ b/src/Bundle/Resources/config/Algorithms/signature_hmac.php @@ -5,16 +5,6 @@ use Jose\Component\Signature\Algorithm\HS256; use Jose\Component\Signature\Algorithm\HS384; use Jose\Component\Signature\Algorithm\HS512; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_none.php b/src/Bundle/Resources/config/Algorithms/signature_none.php similarity index 69% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_none.php rename to src/Bundle/Resources/config/Algorithms/signature_none.php index accf7d370..0417e986a 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_none.php +++ b/src/Bundle/Resources/config/Algorithms/signature_none.php @@ -3,16 +3,6 @@ declare(strict_types=1); use Jose\Component\Signature\Algorithm\None; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_rsa.php b/src/Bundle/Resources/config/Algorithms/signature_rsa.php similarity index 86% rename from src/Bundle/JoseFramework/Resources/config/Algorithms/signature_rsa.php rename to src/Bundle/Resources/config/Algorithms/signature_rsa.php index 577dbd87a..a0fd7106c 100644 --- a/src/Bundle/JoseFramework/Resources/config/Algorithms/signature_rsa.php +++ b/src/Bundle/Resources/config/Algorithms/signature_rsa.php @@ -8,16 +8,6 @@ use Jose\Component\Signature\Algorithm\RS256; use Jose\Component\Signature\Algorithm\RS384; use Jose\Component\Signature\Algorithm\RS512; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/analyzers.php b/src/Bundle/Resources/config/analyzers.php similarity index 91% rename from src/Bundle/JoseFramework/Resources/config/analyzers.php rename to src/Bundle/Resources/config/analyzers.php index b7be33c8e..2f2cdec37 100644 --- a/src/Bundle/JoseFramework/Resources/config/analyzers.php +++ b/src/Bundle/Resources/config/analyzers.php @@ -18,16 +18,6 @@ use Jose\Component\KeyManagement\Analyzer\NoneAnalyzer; use Jose\Component\KeyManagement\Analyzer\OctAnalyzer; use Jose\Component\KeyManagement\Analyzer\UsageAnalyzer; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Jose\Component\KeyManagement\Analyzer\ZxcvbnKeyAnalyzer; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use ZxcvbnPhp\Zxcvbn; diff --git a/src/Bundle/JoseFramework/Resources/config/checkers.php b/src/Bundle/Resources/config/checkers.php similarity index 90% rename from src/Bundle/JoseFramework/Resources/config/checkers.php rename to src/Bundle/Resources/config/checkers.php index f40def59c..568db5f51 100644 --- a/src/Bundle/JoseFramework/Resources/config/checkers.php +++ b/src/Bundle/Resources/config/checkers.php @@ -11,16 +11,6 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use function Symfony\Component\DependencyInjection\Loader\Configurator\service; -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - - return function (ContainerConfigurator $container): void { $container = $container->services() ->defaults() diff --git a/src/Bundle/JoseFramework/Resources/config/commands.php b/src/Bundle/Resources/config/commands.php similarity index 92% rename from src/Bundle/JoseFramework/Resources/config/commands.php rename to src/Bundle/Resources/config/commands.php index 8a996cbb7..85f78a031 100644 --- a/src/Bundle/JoseFramework/Resources/config/commands.php +++ b/src/Bundle/Resources/config/commands.php @@ -25,16 +25,6 @@ use Jose\Component\Console\RsaKeysetGeneratorCommand; use Jose\Component\Console\SecretKeyGeneratorCommand; use Jose\Component\Console\X509CertificateLoaderCommand; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/compression_methods.php b/src/Bundle/Resources/config/compression_methods.php similarity index 75% rename from src/Bundle/JoseFramework/Resources/config/compression_methods.php rename to src/Bundle/Resources/config/compression_methods.php index a979617d1..b98fd4d9a 100644 --- a/src/Bundle/JoseFramework/Resources/config/compression_methods.php +++ b/src/Bundle/Resources/config/compression_methods.php @@ -4,16 +4,6 @@ use Jose\Component\Encryption\Compression\CompressionMethodManagerFactory; use Jose\Component\Encryption\Compression\Deflate; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/dev_services.php b/src/Bundle/Resources/config/dev_services.php similarity index 84% rename from src/Bundle/JoseFramework/Resources/config/dev_services.php rename to src/Bundle/Resources/config/dev_services.php index 0a24064d6..d36fc938a 100644 --- a/src/Bundle/JoseFramework/Resources/config/dev_services.php +++ b/src/Bundle/Resources/config/dev_services.php @@ -8,16 +8,6 @@ use Jose\Bundle\JoseFramework\DataCollector\JWECollector; use Jose\Bundle\JoseFramework\DataCollector\JWSCollector; use Jose\Bundle\JoseFramework\DataCollector\KeyCollector; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/env_var.php b/src/Bundle/Resources/config/env_var.php similarity index 67% rename from src/Bundle/JoseFramework/Resources/config/env_var.php rename to src/Bundle/Resources/config/env_var.php index 98d35edd5..2fda0b760 100644 --- a/src/Bundle/JoseFramework/Resources/config/env_var.php +++ b/src/Bundle/Resources/config/env_var.php @@ -3,16 +3,6 @@ declare(strict_types=1); use Jose\Bundle\JoseFramework\EnvVarProcessor\KeyEnvVarProcessor; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jku_commands.php b/src/Bundle/Resources/config/jku_commands.php similarity index 70% rename from src/Bundle/JoseFramework/Resources/config/jku_commands.php rename to src/Bundle/Resources/config/jku_commands.php index d5ab7711d..41c7901ec 100644 --- a/src/Bundle/JoseFramework/Resources/config/jku_commands.php +++ b/src/Bundle/Resources/config/jku_commands.php @@ -4,16 +4,6 @@ use Jose\Component\Console\JKULoaderCommand; use Jose\Component\Console\X5ULoaderCommand; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jku_source.php b/src/Bundle/Resources/config/jku_source.php similarity index 75% rename from src/Bundle/JoseFramework/Resources/config/jku_source.php rename to src/Bundle/Resources/config/jku_source.php index 9e6e58bad..889693029 100644 --- a/src/Bundle/JoseFramework/Resources/config/jku_source.php +++ b/src/Bundle/Resources/config/jku_source.php @@ -4,16 +4,6 @@ use Jose\Component\KeyManagement\JKUFactory; use Jose\Component\KeyManagement\X5UFactory; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use function Symfony\Component\DependencyInjection\Loader\Configurator\service; @@ -26,9 +16,9 @@ $container->set(JKUFactory::class) ->public() - ->args([service('jose.http_client'), service('jose.request_factory')]); + ->args([service('jose.http_client'), service('jose.request_factory') ->nullOnInvalid()]); $container->set(X5UFactory::class) ->public() - ->args([service('jose.http_client'), service('jose.request_factory')]); + ->args([service('jose.http_client'), service('jose.request_factory') ->nullOnInvalid()]); }; diff --git a/src/Bundle/JoseFramework/Resources/config/jwe_serializers.php b/src/Bundle/Resources/config/jwe_serializers.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/jwe_serializers.php rename to src/Bundle/Resources/config/jwe_serializers.php index d5fb7bb71..7d5e50b27 100644 --- a/src/Bundle/JoseFramework/Resources/config/jwe_serializers.php +++ b/src/Bundle/Resources/config/jwe_serializers.php @@ -6,16 +6,6 @@ use Jose\Component\Encryption\Serializer\JSONFlattenedSerializer; use Jose\Component\Encryption\Serializer\JSONGeneralSerializer; use Jose\Component\Encryption\Serializer\JWESerializerManagerFactory; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jwe_services.php b/src/Bundle/Resources/config/jwe_services.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/jwe_services.php rename to src/Bundle/Resources/config/jwe_services.php index be402280b..c981b4b2e 100644 --- a/src/Bundle/JoseFramework/Resources/config/jwe_services.php +++ b/src/Bundle/Resources/config/jwe_services.php @@ -6,16 +6,6 @@ use Jose\Bundle\JoseFramework\Services\JWEDecrypterFactory; use Jose\Bundle\JoseFramework\Services\JWELoaderFactory; use Jose\Component\Encryption\JWETokenSupport; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jwk_factory.php b/src/Bundle/Resources/config/jwk_factory.php similarity index 100% rename from src/Bundle/JoseFramework/Resources/config/jwk_factory.php rename to src/Bundle/Resources/config/jwk_factory.php diff --git a/src/Bundle/JoseFramework/Resources/config/jwk_services.php b/src/Bundle/Resources/config/jwk_services.php similarity index 100% rename from src/Bundle/JoseFramework/Resources/config/jwk_services.php rename to src/Bundle/Resources/config/jwk_services.php diff --git a/src/Bundle/JoseFramework/Resources/config/jwk_sources.php b/src/Bundle/Resources/config/jwk_sources.php similarity index 86% rename from src/Bundle/JoseFramework/Resources/config/jwk_sources.php rename to src/Bundle/Resources/config/jwk_sources.php index 0a74c9830..76c99b59c 100644 --- a/src/Bundle/JoseFramework/Resources/config/jwk_sources.php +++ b/src/Bundle/Resources/config/jwk_sources.php @@ -10,16 +10,6 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource\Secret; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource\Values; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSource\X5C; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jwkset_sources.php b/src/Bundle/Resources/config/jwkset_sources.php similarity index 77% rename from src/Bundle/JoseFramework/Resources/config/jwkset_sources.php rename to src/Bundle/Resources/config/jwkset_sources.php index 88238022f..b58f21af6 100644 --- a/src/Bundle/JoseFramework/Resources/config/jwkset_sources.php +++ b/src/Bundle/Resources/config/jwkset_sources.php @@ -5,16 +5,6 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSetSource\JKU; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSetSource\JWKSet; use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\JWKSetSource\X5U; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jws_serializers.php b/src/Bundle/Resources/config/jws_serializers.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/jws_serializers.php rename to src/Bundle/Resources/config/jws_serializers.php index 281dfd92a..dfbde37c1 100644 --- a/src/Bundle/JoseFramework/Resources/config/jws_serializers.php +++ b/src/Bundle/Resources/config/jws_serializers.php @@ -6,16 +6,6 @@ use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; use Jose\Component\Signature\Serializer\JWSSerializerManagerFactory; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/jws_services.php b/src/Bundle/Resources/config/jws_services.php similarity index 79% rename from src/Bundle/JoseFramework/Resources/config/jws_services.php rename to src/Bundle/Resources/config/jws_services.php index 67bf0b938..a10cf3ff1 100644 --- a/src/Bundle/JoseFramework/Resources/config/jws_services.php +++ b/src/Bundle/Resources/config/jws_services.php @@ -6,16 +6,6 @@ use Jose\Bundle\JoseFramework\Services\JWSLoaderFactory; use Jose\Bundle\JoseFramework\Services\JWSVerifierFactory; use Jose\Component\Signature\JWSTokenSupport; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/nested_token.php b/src/Bundle/Resources/config/nested_token.php similarity index 74% rename from src/Bundle/JoseFramework/Resources/config/nested_token.php rename to src/Bundle/Resources/config/nested_token.php index 6a039bb52..bad778bd5 100644 --- a/src/Bundle/JoseFramework/Resources/config/nested_token.php +++ b/src/Bundle/Resources/config/nested_token.php @@ -4,16 +4,6 @@ use Jose\Bundle\JoseFramework\Services\NestedTokenBuilderFactory; use Jose\Bundle\JoseFramework\Services\NestedTokenLoaderFactory; - -/* - * The MIT License (MIT) - * - * Copyright (c) 2014-2020 Spomky-Labs - * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ - use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $container): void { diff --git a/src/Bundle/JoseFramework/Resources/config/routing/jwkset_controller.php b/src/Bundle/Resources/config/routing/jwkset_controller.php similarity index 100% rename from src/Bundle/JoseFramework/Resources/config/routing/jwkset_controller.php rename to src/Bundle/Resources/config/routing/jwkset_controller.php diff --git a/src/Bundle/JoseFramework/Resources/config/services.php b/src/Bundle/Resources/config/services.php similarity index 100% rename from src/Bundle/JoseFramework/Resources/config/services.php rename to src/Bundle/Resources/config/services.php diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker.html.twig b/src/Bundle/Resources/views/data_collector/tab/claim_checker.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker.html.twig rename to src/Bundle/Resources/views/data_collector/tab/claim_checker.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker/checkers.html.twig b/src/Bundle/Resources/views/data_collector/tab/claim_checker/checkers.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker/checkers.html.twig rename to src/Bundle/Resources/views/data_collector/tab/claim_checker/checkers.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker/managers.html.twig b/src/Bundle/Resources/views/data_collector/tab/claim_checker/managers.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/claim_checker/managers.html.twig rename to src/Bundle/Resources/views/data_collector/tab/claim_checker/managers.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker.html.twig b/src/Bundle/Resources/views/data_collector/tab/header_checker.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker.html.twig rename to src/Bundle/Resources/views/data_collector/tab/header_checker.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker/checkers.html.twig b/src/Bundle/Resources/views/data_collector/tab/header_checker/checkers.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker/checkers.html.twig rename to src/Bundle/Resources/views/data_collector/tab/header_checker/checkers.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker/managers.html.twig b/src/Bundle/Resources/views/data_collector/tab/header_checker/managers.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/header_checker/managers.html.twig rename to src/Bundle/Resources/views/data_collector/tab/header_checker/managers.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/builders.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/builders.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/builders.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/builders.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/compression_methods.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/compression_methods.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig similarity index 90% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig index 0d1a00bae..9f8266c9c 100644 --- a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig +++ b/src/Bundle/Resources/views/data_collector/tab/jwe/content_encryption_algorithms.html.twig @@ -30,8 +30,7 @@ No algorithm. You should consider the installation of the following packages or create your own algorithm:
    -
  • web-token/jwt-encryption-algorithm-aescbc
  • -
  • web-token/jwt-encryption-algorithm-aesgcm
  • +
  • web-token/jwt-library
diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/decrypters.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/decrypters.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/decrypters.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/decrypters.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig similarity index 76% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig index fdecd4ca2..fe3200862 100644 --- a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig +++ b/src/Bundle/Resources/views/data_collector/tab/jwe/key_encryption_algorithms.html.twig @@ -29,12 +29,7 @@ No algorithm. Please consider the installation of the following packages or create your own algorithm:
    -
  • web-token/jwt-encryption-algorithm-aesgcmkw
  • -
  • web-token/jwt-encryption-algorithm-aeskw
  • -
  • web-token/jwt-encryption-algorithm-dir
  • -
  • web-token/jwt-encryption-algorithm-ecdh-es
  • -
  • web-token/jwt-encryption-algorithm-pbes2
  • -
  • web-token/jwt-encryption-algorithm-rsa
  • +
  • web-token/jwt-library
diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/loaders.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/loaders.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/loaders.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/loaders.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/serialization_modes.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/serialization_modes.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jwe/serialization_modes.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jwe/serialization_modes.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/builders.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/builders.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/builders.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/builders.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/loaders.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/loaders.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/loaders.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/loaders.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/mac_algorithms.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/mac_algorithms.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/mac_algorithms.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/mac_algorithms.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/serialization_modes.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/serialization_modes.html.twig similarity index 94% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/serialization_modes.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/serialization_modes.html.twig index 079e98f82..751d521d5 100644 --- a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/serialization_modes.html.twig +++ b/src/Bundle/Resources/views/data_collector/tab/jws/serialization_modes.html.twig @@ -20,7 +20,7 @@ {% endfor %} {% else %} - There is no serialization modes. Did you install "web-token/jwt-signature"? + There is no serialization modes. Did you install web-token/jwt-library"? {% endif %} diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/signature_algorithms.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/signature_algorithms.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/signature_algorithms.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/signature_algorithms.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/verifiers.html.twig b/src/Bundle/Resources/views/data_collector/tab/jws/verifiers.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/jws/verifiers.html.twig rename to src/Bundle/Resources/views/data_collector/tab/jws/verifiers.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/key.html.twig b/src/Bundle/Resources/views/data_collector/tab/key.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/key.html.twig rename to src/Bundle/Resources/views/data_collector/tab/key.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/keys/jwk.html.twig b/src/Bundle/Resources/views/data_collector/tab/keys/jwk.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/keys/jwk.html.twig rename to src/Bundle/Resources/views/data_collector/tab/keys/jwk.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/keys/jwkset.html.twig b/src/Bundle/Resources/views/data_collector/tab/keys/jwkset.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/tab/keys/jwkset.html.twig rename to src/Bundle/Resources/views/data_collector/tab/keys/jwkset.html.twig diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/template.html.twig b/src/Bundle/Resources/views/data_collector/template.html.twig similarity index 100% rename from src/Bundle/JoseFramework/Resources/views/data_collector/template.html.twig rename to src/Bundle/Resources/views/data_collector/template.html.twig diff --git a/src/Bundle/JoseFramework/Routing/JWKSetLoader.php b/src/Bundle/Routing/JWKSetLoader.php similarity index 94% rename from src/Bundle/JoseFramework/Routing/JWKSetLoader.php rename to src/Bundle/Routing/JWKSetLoader.php index ad2c9fffd..68ee2ea19 100644 --- a/src/Bundle/JoseFramework/Routing/JWKSetLoader.php +++ b/src/Bundle/Routing/JWKSetLoader.php @@ -29,17 +29,11 @@ public function add(string $pattern, string $name): void $this->routes->add(sprintf('jwkset_%s', $name), $route); } - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $type = null): RouteCollection { return $this->routes; } - /** - * {@inheritdoc} - */ public function supports(mixed $resource, string $type = null): bool { return $type === 'jwkset'; diff --git a/src/Bundle/JoseFramework/Serializer/JWEEncoder.php b/src/Bundle/Serializer/JWEEncoder.php similarity index 100% rename from src/Bundle/JoseFramework/Serializer/JWEEncoder.php rename to src/Bundle/Serializer/JWEEncoder.php index e13f02fc2..642a757fa 100644 --- a/src/Bundle/JoseFramework/Serializer/JWEEncoder.php +++ b/src/Bundle/Serializer/JWEEncoder.php @@ -5,18 +5,18 @@ namespace Jose\Bundle\JoseFramework\Serializer; use Exception; -use function in_array; -use function is_int; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Serializer\JWESerializerManager; use Jose\Component\Encryption\Serializer\JWESerializerManagerFactory; use LogicException; -use function mb_strtolower; use Symfony\Component\Serializer\Encoder\DecoderInterface; use Symfony\Component\Serializer\Encoder\EncoderInterface; use Symfony\Component\Serializer\Encoder\NormalizationAwareInterface; use Symfony\Component\Serializer\Exception\NotEncodableValueException; use Throwable; +use function in_array; +use function is_int; +use function mb_strtolower; final class JWEEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface { diff --git a/src/Bundle/JoseFramework/Serializer/JWESerializer.php b/src/Bundle/Serializer/JWESerializer.php similarity index 89% rename from src/Bundle/JoseFramework/Serializer/JWESerializer.php rename to src/Bundle/Serializer/JWESerializer.php index b6e249fa1..d5c9d7503 100644 --- a/src/Bundle/JoseFramework/Serializer/JWESerializer.php +++ b/src/Bundle/Serializer/JWESerializer.php @@ -4,13 +4,13 @@ namespace Jose\Bundle\JoseFramework\Serializer; -use function in_array; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Serializer\JWESerializerManager; use Jose\Component\Encryption\Serializer\JWESerializerManagerFactory; use LogicException; -use function mb_strtolower; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use function in_array; +use function mb_strtolower; final class JWESerializer implements DenormalizerInterface { @@ -26,6 +26,13 @@ public function __construct( $this->serializerManager = $serializerManager; } + public function getSupportedTypes(?string $format): array + { + return [ + JWE::class => class_exists(JWESerializerManager::class) && $this->formatSupported($format), + ]; + } + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool { return $type === JWE::class diff --git a/src/Bundle/JoseFramework/Serializer/JWSEncoder.php b/src/Bundle/Serializer/JWSEncoder.php similarity index 100% rename from src/Bundle/JoseFramework/Serializer/JWSEncoder.php rename to src/Bundle/Serializer/JWSEncoder.php index 1e10cd51b..5c3dfbbf1 100644 --- a/src/Bundle/JoseFramework/Serializer/JWSEncoder.php +++ b/src/Bundle/Serializer/JWSEncoder.php @@ -5,17 +5,17 @@ namespace Jose\Bundle\JoseFramework\Serializer; use Exception; -use function in_array; -use function is_int; use Jose\Component\Signature\JWS; use Jose\Component\Signature\Serializer\JWSSerializerManager; use Jose\Component\Signature\Serializer\JWSSerializerManagerFactory; use LogicException; -use function mb_strtolower; use Symfony\Component\Serializer\Encoder\DecoderInterface; use Symfony\Component\Serializer\Encoder\EncoderInterface; use Symfony\Component\Serializer\Encoder\NormalizationAwareInterface; use Symfony\Component\Serializer\Exception\NotEncodableValueException; +use function in_array; +use function is_int; +use function mb_strtolower; final class JWSEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface { diff --git a/src/Bundle/JoseFramework/Serializer/JWSSerializer.php b/src/Bundle/Serializer/JWSSerializer.php similarity index 89% rename from src/Bundle/JoseFramework/Serializer/JWSSerializer.php rename to src/Bundle/Serializer/JWSSerializer.php index aac2f6e63..d6a224240 100644 --- a/src/Bundle/JoseFramework/Serializer/JWSSerializer.php +++ b/src/Bundle/Serializer/JWSSerializer.php @@ -4,13 +4,13 @@ namespace Jose\Bundle\JoseFramework\Serializer; -use function in_array; use Jose\Component\Signature\JWS; use Jose\Component\Signature\Serializer\JWSSerializerManager; use Jose\Component\Signature\Serializer\JWSSerializerManagerFactory; use LogicException; -use function mb_strtolower; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use function in_array; +use function mb_strtolower; final class JWSSerializer implements DenormalizerInterface { @@ -26,6 +26,13 @@ public function __construct( $this->serializerManager = $serializerManager; } + public function getSupportedTypes(?string $format): array + { + return [ + JWS::class => class_exists(JWSSerializerManager::class) && $this->formatSupported($format), + ]; + } + public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool { return $type === JWS::class diff --git a/src/Bundle/JoseFramework/Services/ClaimCheckerManager.php b/src/Bundle/Services/ClaimCheckerManager.php similarity index 100% rename from src/Bundle/JoseFramework/Services/ClaimCheckerManager.php rename to src/Bundle/Services/ClaimCheckerManager.php diff --git a/src/Bundle/JoseFramework/Services/ClaimCheckerManagerFactory.php b/src/Bundle/Services/ClaimCheckerManagerFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/ClaimCheckerManagerFactory.php rename to src/Bundle/Services/ClaimCheckerManagerFactory.php diff --git a/src/Bundle/JoseFramework/Services/HeaderCheckerManager.php b/src/Bundle/Services/HeaderCheckerManager.php similarity index 100% rename from src/Bundle/JoseFramework/Services/HeaderCheckerManager.php rename to src/Bundle/Services/HeaderCheckerManager.php diff --git a/src/Bundle/JoseFramework/Services/HeaderCheckerManagerFactory.php b/src/Bundle/Services/HeaderCheckerManagerFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/HeaderCheckerManagerFactory.php rename to src/Bundle/Services/HeaderCheckerManagerFactory.php diff --git a/src/Bundle/JoseFramework/Services/JWEBuilder.php b/src/Bundle/Services/JWEBuilder.php similarity index 82% rename from src/Bundle/JoseFramework/Services/JWEBuilder.php rename to src/Bundle/Services/JWEBuilder.php index aef12e2ac..03e386d96 100644 --- a/src/Bundle/JoseFramework/Services/JWEBuilder.php +++ b/src/Bundle/Services/JWEBuilder.php @@ -16,12 +16,12 @@ final class JWEBuilder extends BaseJWEBuilder { public function __construct( - AlgorithmManager $keyEncryptionKeyEncryptionAlgorithmManager, - AlgorithmManager $contentEncryptionAlgorithmManager, + AlgorithmManager $algorithmManager, + null|AlgorithmManager $contentEncryptionAlgorithmManager, CompressionMethodManager $compressionManager, private readonly EventDispatcherInterface $eventDispatcher ) { - parent::__construct($keyEncryptionKeyEncryptionAlgorithmManager, $contentEncryptionAlgorithmManager, $compressionManager); + parent::__construct($algorithmManager, $contentEncryptionAlgorithmManager, $compressionManager); } public function build(): JWE diff --git a/src/Bundle/JoseFramework/Services/JWEBuilderFactory.php b/src/Bundle/Services/JWEBuilderFactory.php similarity index 66% rename from src/Bundle/JoseFramework/Services/JWEBuilderFactory.php rename to src/Bundle/Services/JWEBuilderFactory.php index ce71f7634..756f9bf5b 100644 --- a/src/Bundle/JoseFramework/Services/JWEBuilderFactory.php +++ b/src/Bundle/Services/JWEBuilderFactory.php @@ -21,23 +21,19 @@ public function __construct( * This method creates a JWEBuilder using the given algorithm aliases. * * @param string[] $keyEncryptionAlgorithms - * @param string[] $contentEncryptionAlgorithm + * @param string[] $contentEncryptionAlgorithms * @param string[] $compressionMethods */ public function create( array $keyEncryptionAlgorithms, - array $contentEncryptionAlgorithm, + array $contentEncryptionAlgorithms, array $compressionMethods ): JWEBuilder { - $keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms); - $contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($contentEncryptionAlgorithm); + $algorithmManager = $this->algorithmManagerFactory->create( + array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms) + ); $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); - return new JWEBuilder( - $keyEncryptionAlgorithmManager, - $contentEncryptionAlgorithmManager, - $compressionMethodManager, - $this->eventDispatcher - ); + return new JWEBuilder($algorithmManager, null, $compressionMethodManager, $this->eventDispatcher); } } diff --git a/src/Bundle/JoseFramework/Services/JWEDecrypter.php b/src/Bundle/Services/JWEDecrypter.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWEDecrypter.php rename to src/Bundle/Services/JWEDecrypter.php diff --git a/src/Bundle/JoseFramework/Services/JWEDecrypterFactory.php b/src/Bundle/Services/JWEDecrypterFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWEDecrypterFactory.php rename to src/Bundle/Services/JWEDecrypterFactory.php diff --git a/src/Bundle/JoseFramework/Services/JWELoader.php b/src/Bundle/Services/JWELoader.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWELoader.php rename to src/Bundle/Services/JWELoader.php diff --git a/src/Bundle/JoseFramework/Services/JWELoaderFactory.php b/src/Bundle/Services/JWELoaderFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWELoaderFactory.php rename to src/Bundle/Services/JWELoaderFactory.php diff --git a/src/Bundle/JoseFramework/Services/JWSBuilder.php b/src/Bundle/Services/JWSBuilder.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSBuilder.php rename to src/Bundle/Services/JWSBuilder.php diff --git a/src/Bundle/JoseFramework/Services/JWSBuilderFactory.php b/src/Bundle/Services/JWSBuilderFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSBuilderFactory.php rename to src/Bundle/Services/JWSBuilderFactory.php diff --git a/src/Bundle/JoseFramework/Services/JWSLoader.php b/src/Bundle/Services/JWSLoader.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSLoader.php rename to src/Bundle/Services/JWSLoader.php diff --git a/src/Bundle/JoseFramework/Services/JWSLoaderFactory.php b/src/Bundle/Services/JWSLoaderFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSLoaderFactory.php rename to src/Bundle/Services/JWSLoaderFactory.php diff --git a/src/Bundle/JoseFramework/Services/JWSVerifier.php b/src/Bundle/Services/JWSVerifier.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSVerifier.php rename to src/Bundle/Services/JWSVerifier.php diff --git a/src/Bundle/JoseFramework/Services/JWSVerifierFactory.php b/src/Bundle/Services/JWSVerifierFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/JWSVerifierFactory.php rename to src/Bundle/Services/JWSVerifierFactory.php diff --git a/src/Bundle/JoseFramework/Services/NestedTokenBuilder.php b/src/Bundle/Services/NestedTokenBuilder.php similarity index 100% rename from src/Bundle/JoseFramework/Services/NestedTokenBuilder.php rename to src/Bundle/Services/NestedTokenBuilder.php diff --git a/src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php b/src/Bundle/Services/NestedTokenBuilderFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/NestedTokenBuilderFactory.php rename to src/Bundle/Services/NestedTokenBuilderFactory.php diff --git a/src/Bundle/JoseFramework/Services/NestedTokenLoader.php b/src/Bundle/Services/NestedTokenLoader.php similarity index 100% rename from src/Bundle/JoseFramework/Services/NestedTokenLoader.php rename to src/Bundle/Services/NestedTokenLoader.php diff --git a/src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php b/src/Bundle/Services/NestedTokenLoaderFactory.php similarity index 100% rename from src/Bundle/JoseFramework/Services/NestedTokenLoaderFactory.php rename to src/Bundle/Services/NestedTokenLoaderFactory.php diff --git a/src/Bundle/JoseFramework/composer.json b/src/Bundle/composer.json similarity index 59% rename from src/Bundle/JoseFramework/composer.json rename to src/Bundle/composer.json index d430cb9b7..2bd860aa9 100644 --- a/src/Bundle/JoseFramework/composer.json +++ b/src/Bundle/composer.json @@ -40,18 +40,13 @@ "require": { "php": ">=8.1", "psr/event-dispatcher": "^1.0", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "web-token/jwt-core": "^3.2" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "web-token/jwt-library": "^3.3" }, "suggest": { - "web-token/jwt-checker": "Add header and claim checker managers as Symfony services.", - "web-token/jwt-console": "Add Keys (JWK) and Key sets (JWKSet) management commands for your Symfony console.", - "web-token/jwt-encryption": "Add Encrypted tokens (JWE) support and useful Symfony services.", - "web-token/jwt-key-mgmt": "Add Keys (JWK) and Key sets (JWKSet) management tools.", - "web-token/jwt-signature": "Add signed tokens (JWS) support and useful Symfony services.", "symfony/serializer": "Use the Symfony serializer to serialize/unserialize JWS and JWE tokens." } } diff --git a/src/Component/Console/composer.json b/src/Component/Console/composer.json deleted file mode 100644 index 07811090d..000000000 --- a/src/Component/Console/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "web-token/jwt-console", - "description": "Console component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-console/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Console\\": "" - } - }, - "require": { - "php": ">=8.1", - "symfony/console": "^5.4|^6.0", - "web-token/jwt-key-mgmt": "^3.2" - } -} diff --git a/src/Component/Encryption/LICENSE b/src/Component/Encryption/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/Component/Encryption/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Component/Encryption/composer.json b/src/Component/Encryption/composer.json deleted file mode 100644 index 8710f3570..000000000 --- a/src/Component/Encryption/composer.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "web-token/jwt-encryption", - "description": "Encryption component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-encryption/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\": "" - } - }, - "require": { - "php": ">=8.1", - "web-token/jwt-core": "^3.2" - }, - "suggest": { - "web-token/jwt-encryption-algorithm-aescbc": "AES CBC Based Content Encryption Algorithms", - "web-token/jwt-encryption-algorithm-aesgcm": "AES GCM Based Content Encryption Algorithms", - "web-token/jwt-encryption-algorithm-aesgcmkw": "AES GCM Key Wrapping Based Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-aeskw": "AES Key Wrapping Based Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-dir": "Direct Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-ecdh-es": "ECDH-ES Based Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-pbes2": "PBES2 Based Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-rsa": "RSA Based Key Encryption Algorithms", - "web-token/jwt-encryption-algorithm-experimental": "Experimental Key and Signature Algorithms" - } -} diff --git a/src/Component/KeyManagement/.github/FUNDING.yml b/src/Component/KeyManagement/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/Component/KeyManagement/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/Component/KeyManagement/LICENSE b/src/Component/KeyManagement/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/Component/KeyManagement/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Component/KeyManagement/UrlKeySetFactory.php b/src/Component/KeyManagement/UrlKeySetFactory.php deleted file mode 100644 index 7598669b1..000000000 --- a/src/Component/KeyManagement/UrlKeySetFactory.php +++ /dev/null @@ -1,37 +0,0 @@ -requestFactory->createRequest('GET', $url); - foreach ($header as $k => $v) { - $request = $request->withHeader($k, $v); - } - $response = $this->client->sendRequest($request); - - if ($response->getStatusCode() >= 400) { - throw new RuntimeException('Unable to get the key set.', $response->getStatusCode()); - } - - return $response->getBody() - ->getContents(); - } -} diff --git a/src/Component/KeyManagement/composer.json b/src/Component/KeyManagement/composer.json deleted file mode 100644 index 87144a633..000000000 --- a/src/Component/KeyManagement/composer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "web-token/jwt-key-mgmt", - "description": "Key Management component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-key-mgmt/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\KeyManagement\\": "" - } - }, - "require": { - "php": ">=8.1", - "ext-openssl": "*", - "psr/http-factory": "^1.0", - "psr/http-client": "^1.0", - "web-token/jwt-core": "^3.2" - }, - "suggest": { - "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", - "web-token/jwt-util-ecc": "To use EC key analyzers.", - "php-http/message-factory": "To enable JKU/X5U support.", - "php-http/httplug": "To enable JKU/X5U support." - } -} diff --git a/src/Component/NestedToken/.github/FUNDING.yml b/src/Component/NestedToken/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/Component/NestedToken/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/Component/NestedToken/LICENSE b/src/Component/NestedToken/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/Component/NestedToken/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Component/NestedToken/composer.json b/src/Component/NestedToken/composer.json deleted file mode 100644 index d96bcdfde..000000000 --- a/src/Component/NestedToken/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "web-token/jwt-nested-token", - "description": "Nested Token component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-nested-token/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\NestedToken\\": "" - } - }, - "require": { - "php": ">=8.1", - "web-token/jwt-encryption": "^3.2", - "web-token/jwt-signature": "^3.2" - } -} diff --git a/src/Component/Signature/.github/FUNDING.yml b/src/Component/Signature/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/Component/Signature/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/Component/Signature/LICENSE b/src/Component/Signature/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/Component/Signature/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Component/Signature/composer.json b/src/Component/Signature/composer.json deleted file mode 100644 index 5e42529df..000000000 --- a/src/Component/Signature/composer.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "web-token/jwt-signature", - "description": "Signature component of the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-signature/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\": "" - } - }, - "require": { - "php": ">=8.1", - "web-token/jwt-core": "^3.2" - }, - "suggest": { - "web-token/jwt-signature-algorithm-ecdsa": "ECDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-eddsa": "EdDSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-hmac": "HMAC Based Signature Algorithms", - "web-token/jwt-signature-algorithm-none": "None Signature Algorithm", - "web-token/jwt-signature-algorithm-rsa": "RSA Based Signature Algorithms", - "web-token/jwt-signature-algorithm-experimental": "Experimental Signature Algorithms" - } -} diff --git a/packs/signature/.github/CONTRIBUTING.md b/src/Deprecated/Checker/.github/CONTRIBUTING.md similarity index 100% rename from packs/signature/.github/CONTRIBUTING.md rename to src/Deprecated/Checker/.github/CONTRIBUTING.md diff --git a/src/Component/Checker/.github/FUNDING.yml b/src/Deprecated/Checker/.github/FUNDING.yml similarity index 62% rename from src/Component/Checker/.github/FUNDING.yml rename to src/Deprecated/Checker/.github/FUNDING.yml index 7e2ca0e7e..726574c1f 100644 --- a/src/Component/Checker/.github/FUNDING.yml +++ b/src/Deprecated/Checker/.github/FUNDING.yml @@ -1 +1,2 @@ +github: Spomky patreon: FlorentMorselli diff --git a/packs/signature/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Checker/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from packs/signature/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Checker/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Checker/.github/stale.yml b/src/Deprecated/Checker/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Checker/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Component/Console/LICENSE b/src/Deprecated/Checker/LICENSE similarity index 96% rename from src/Component/Console/LICENSE rename to src/Deprecated/Checker/LICENSE index 37cf976b1..5ab750604 100644 --- a/src/Component/Console/LICENSE +++ b/src/Deprecated/Checker/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2019 Spomky-Labs +Copyright (c) 2014-2024 Spomky-Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Component/Checker/README.md b/src/Deprecated/Checker/README.md similarity index 100% rename from src/Component/Checker/README.md rename to src/Deprecated/Checker/README.md diff --git a/src/Component/Checker/composer.json b/src/Deprecated/Checker/composer.json similarity index 71% rename from src/Component/Checker/composer.json rename to src/Deprecated/Checker/composer.json index 3c4440027..c12eb0323 100644 --- a/src/Component/Checker/composer.json +++ b/src/Deprecated/Checker/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-checker", - "description": "Checker component of the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -29,17 +29,12 @@ }, { "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-checker/contributors" + "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Checker\\": "" - } - }, "require": { "php": ">=8.1", "psr/clock": "^1.0", - "web-token/jwt-core": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/Bundle/JoseFramework/.github/CONTRIBUTING.md b/src/Deprecated/Console/.github/CONTRIBUTING.md similarity index 100% rename from src/Bundle/JoseFramework/.github/CONTRIBUTING.md rename to src/Deprecated/Console/.github/CONTRIBUTING.md diff --git a/src/Component/Console/.github/FUNDING.yml b/src/Deprecated/Console/.github/FUNDING.yml similarity index 62% rename from src/Component/Console/.github/FUNDING.yml rename to src/Deprecated/Console/.github/FUNDING.yml index 7e2ca0e7e..726574c1f 100644 --- a/src/Component/Console/.github/FUNDING.yml +++ b/src/Deprecated/Console/.github/FUNDING.yml @@ -1 +1,2 @@ +github: Spomky patreon: FlorentMorselli diff --git a/src/Bundle/JoseFramework/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Console/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Bundle/JoseFramework/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Console/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Console/.github/stale.yml b/src/Deprecated/Console/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Console/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Bundle/JoseFramework/LICENSE b/src/Deprecated/Console/LICENSE similarity index 96% rename from src/Bundle/JoseFramework/LICENSE rename to src/Deprecated/Console/LICENSE index 37cf976b1..5ab750604 100644 --- a/src/Bundle/JoseFramework/LICENSE +++ b/src/Deprecated/Console/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2019 Spomky-Labs +Copyright (c) 2014-2024 Spomky-Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Component/Console/README.md b/src/Deprecated/Console/README.md similarity index 100% rename from src/Component/Console/README.md rename to src/Deprecated/Console/README.md diff --git a/src/Deprecated/Console/composer.json b/src/Deprecated/Console/composer.json new file mode 100644 index 000000000..6a897507e --- /dev/null +++ b/src/Deprecated/Console/composer.json @@ -0,0 +1,40 @@ +{ + "name": "web-token/jwt-console", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "symfony/console": "^5.4|^6.0|^7.0", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/Component/Checker/.github/CONTRIBUTING.md b/src/Deprecated/Core/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/Checker/.github/CONTRIBUTING.md rename to src/Deprecated/Core/.github/CONTRIBUTING.md diff --git a/src/Component/Core/.github/FUNDING.yml b/src/Deprecated/Core/.github/FUNDING.yml similarity index 62% rename from src/Component/Core/.github/FUNDING.yml rename to src/Deprecated/Core/.github/FUNDING.yml index 7e2ca0e7e..726574c1f 100644 --- a/src/Component/Core/.github/FUNDING.yml +++ b/src/Deprecated/Core/.github/FUNDING.yml @@ -1 +1,2 @@ +github: Spomky patreon: FlorentMorselli diff --git a/src/Component/Checker/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Core/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/Checker/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Core/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Core/.github/stale.yml b/src/Deprecated/Core/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Core/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Component/Core/LICENSE b/src/Deprecated/Core/LICENSE similarity index 96% rename from src/Component/Core/LICENSE rename to src/Deprecated/Core/LICENSE index 37cf976b1..5ab750604 100644 --- a/src/Component/Core/LICENSE +++ b/src/Deprecated/Core/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2019 Spomky-Labs +Copyright (c) 2014-2024 Spomky-Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Component/Core/README.md b/src/Deprecated/Core/README.md similarity index 100% rename from src/Component/Core/README.md rename to src/Deprecated/Core/README.md diff --git a/src/Component/Core/composer.json b/src/Deprecated/Core/composer.json similarity index 69% rename from src/Component/Core/composer.json rename to src/Deprecated/Core/composer.json index 7e5cfa509..6bfeada3e 100644 --- a/src/Component/Core/composer.json +++ b/src/Deprecated/Core/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-core", - "description": "Core component of the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,20 +32,13 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Core\\": "" - } - }, "require": { "php": ">=8.1", "ext-json": "*", "ext-mbstring": "*", - "brick/math": "^0.9|^0.10|^0.11", - "paragonie/constant_time_encoding": "^2.4", - "spomky-labs/pki-framework": "^1.0" - }, - "conflict": { - "spomky-labs/jose": "*" + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "paragonie/constant_time_encoding": "^2.6", + "spomky-labs/pki-framework": "^1.0", + "web-token/jwt-library": "^3.3" } } diff --git a/src/Component/Console/.github/CONTRIBUTING.md b/src/Deprecated/Ecc/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/Console/.github/CONTRIBUTING.md rename to src/Deprecated/Ecc/.github/CONTRIBUTING.md diff --git a/src/Component/Encryption/.github/FUNDING.yml b/src/Deprecated/Ecc/.github/FUNDING.yml similarity index 62% rename from src/Component/Encryption/.github/FUNDING.yml rename to src/Deprecated/Ecc/.github/FUNDING.yml index 7e2ca0e7e..726574c1f 100644 --- a/src/Component/Encryption/.github/FUNDING.yml +++ b/src/Deprecated/Ecc/.github/FUNDING.yml @@ -1 +1,2 @@ +github: Spomky patreon: FlorentMorselli diff --git a/src/Component/Console/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Ecc/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/Console/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Ecc/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Ecc/.github/stale.yml b/src/Deprecated/Ecc/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Ecc/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/Ecc/LICENSE b/src/Deprecated/Ecc/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/Ecc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Ecc/README.md b/src/Deprecated/Ecc/README.md similarity index 100% rename from src/Ecc/README.md rename to src/Deprecated/Ecc/README.md diff --git a/src/Deprecated/Ecc/composer.json b/src/Deprecated/Ecc/composer.json new file mode 100644 index 000000000..473a9d4d1 --- /dev/null +++ b/src/Deprecated/Ecc/composer.json @@ -0,0 +1,40 @@ +{ + "name": "web-token/jwt-util-ecc", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/Component/Core/.github/CONTRIBUTING.md b/src/Deprecated/Encryption/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/Core/.github/CONTRIBUTING.md rename to src/Deprecated/Encryption/.github/CONTRIBUTING.md diff --git a/src/Deprecated/Encryption/.github/FUNDING.yml b/src/Deprecated/Encryption/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/Encryption/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Component/Core/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Encryption/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/Core/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Encryption/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Encryption/.github/stale.yml b/src/Deprecated/Encryption/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Encryption/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/Encryption/LICENSE b/src/Deprecated/Encryption/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/Encryption/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Component/Encryption/README.md b/src/Deprecated/Encryption/README.md similarity index 100% rename from src/Component/Encryption/README.md rename to src/Deprecated/Encryption/README.md diff --git a/src/Deprecated/Encryption/composer.json b/src/Deprecated/Encryption/composer.json new file mode 100644 index 000000000..2130537b5 --- /dev/null +++ b/src/Deprecated/Encryption/composer.json @@ -0,0 +1,39 @@ +{ + "name": "web-token/jwt-encryption", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/Component/Encryption/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/Encryption/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Component/Encryption/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/Encryption/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/README.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/README.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/README.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/README.md diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json similarity index 75% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json index 450d996d1..a85bbf00d 100644 --- a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESCBC/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-aescbc", - "description": "AES CBC Based Content Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,9 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\ContentEncryption\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/Component/KeyManagement/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/KeyManagement/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Component/KeyManagement/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/KeyManagement/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/README.md b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/README.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/README.md rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/README.md diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json similarity index 75% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json rename to src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json index 5a7286ec9..7243b7a82 100644 --- a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/ContentEncryption/AESGCM/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-aesgcm", - "description": "AES GCM Based Content Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,9 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\ContentEncryption\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/Component/NestedToken/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/NestedToken/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/Experimental/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/Experimental/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Component/NestedToken/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/NestedToken/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/Experimental/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/Experimental/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/Experimental/LICENSE b/src/Deprecated/EncryptionAlgorithm/Experimental/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/Experimental/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/Experimental/README.md b/src/Deprecated/EncryptionAlgorithm/Experimental/README.md similarity index 100% rename from src/EncryptionAlgorithm/Experimental/README.md rename to src/Deprecated/EncryptionAlgorithm/Experimental/README.md diff --git a/src/EncryptionAlgorithm/Experimental/composer.json b/src/Deprecated/EncryptionAlgorithm/Experimental/composer.json similarity index 75% rename from src/EncryptionAlgorithm/Experimental/composer.json rename to src/Deprecated/EncryptionAlgorithm/Experimental/composer.json index d74e29ab6..9228cbf52 100644 --- a/src/EncryptionAlgorithm/Experimental/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/Experimental/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-experimental", - "description": "Experimental Key and Content Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-experimental instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,9 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", - "web-token/jwt-encryption-algorithm-rsa": "^3.2" + "web-token/jwt-experimental": "^3.3" } } diff --git a/src/Component/Signature/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/CONTRIBUTING.md similarity index 100% rename from src/Component/Signature/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Component/Signature/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Component/Signature/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/README.md diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json similarity index 76% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json index 4c65d9534..59bc200c4 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESGCMKW/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-aesgcmkw", - "description": "AES GCM Key Wrapping Based Key Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,15 +32,10 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", "spomky-labs/aes-key-wrap": "^7.0", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/Ecc/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/CONTRIBUTING.md similarity index 100% rename from src/Ecc/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Ecc/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/Ecc/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/README.md diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json similarity index 76% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json index bdf1a4c0a..49ce7f2f9 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/AESKW/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-aeskw", - "description": "AES Key Wrapping Based Key Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,15 +32,10 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", "spomky-labs/aes-key-wrap": "^7.0", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/Direct/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/README.md diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/composer.json similarity index 76% rename from src/EncryptionAlgorithm/KeyEncryption/Direct/composer.json rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/composer.json index 644f2fe49..e5c372b82 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/Direct/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/Direct/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-dir", - "description": "Direct Key Encryption Algorithm the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,13 +32,8 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, "require": { "php": ">=8.1", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/README.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json new file mode 100644 index 000000000..625b1355c --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json @@ -0,0 +1,41 @@ +{ + "name": "web-token/jwt-encryption-algorithm-ecdh-es", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "ext-openssl": "*", + "spomky-labs/aes-key-wrap": "^7.0", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/Experimental/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/Experimental/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/README.md diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json similarity index 75% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json index eb722c215..ee64732ab 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/PBES2/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-encryption-algorithm-pbes2", - "description": "PBES2* Based Key Encryption Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,13 +32,8 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, "require": { "php": ">=8.1", - "web-token/jwt-encryption": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/CONTRIBUTING.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/CONTRIBUTING.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/CONTRIBUTING.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/stale.yml b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/README.md b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/README.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/README.md rename to src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/README.md diff --git a/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/composer.json b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/composer.json new file mode 100644 index 000000000..f74be2179 --- /dev/null +++ b/src/Deprecated/EncryptionAlgorithm/KeyEncryption/RSA/composer.json @@ -0,0 +1,42 @@ +{ + "name": "web-token/jwt-encryption-algorithm-rsa", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "ext-openssl": "*", + "symfony/polyfill-mbstring": "^1.12", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/CONTRIBUTING.md b/src/Deprecated/KeyManagement/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/CONTRIBUTING.md rename to src/Deprecated/KeyManagement/.github/CONTRIBUTING.md diff --git a/src/Deprecated/KeyManagement/.github/FUNDING.yml b/src/Deprecated/KeyManagement/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/KeyManagement/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/KeyManagement/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/KeyManagement/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/KeyManagement/.github/stale.yml b/src/Deprecated/KeyManagement/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/KeyManagement/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/KeyManagement/LICENSE b/src/Deprecated/KeyManagement/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/KeyManagement/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Component/KeyManagement/README.md b/src/Deprecated/KeyManagement/README.md similarity index 100% rename from src/Component/KeyManagement/README.md rename to src/Deprecated/KeyManagement/README.md diff --git a/src/Deprecated/KeyManagement/composer.json b/src/Deprecated/KeyManagement/composer.json new file mode 100644 index 000000000..6257e2edf --- /dev/null +++ b/src/Deprecated/KeyManagement/composer.json @@ -0,0 +1,42 @@ +{ + "name": "web-token/jwt-key-mgmt", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "ext-openssl": "*", + "psr/http-factory": "^1.0", + "psr/http-client": "^1.0", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/.github/CONTRIBUTING.md b/src/Deprecated/NestedToken/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/Direct/.github/CONTRIBUTING.md rename to src/Deprecated/NestedToken/.github/CONTRIBUTING.md diff --git a/src/Deprecated/NestedToken/.github/FUNDING.yml b/src/Deprecated/NestedToken/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/NestedToken/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/NestedToken/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/Direct/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/NestedToken/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/NestedToken/.github/stale.yml b/src/Deprecated/NestedToken/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/NestedToken/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/NestedToken/LICENSE b/src/Deprecated/NestedToken/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/NestedToken/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Component/NestedToken/README.md b/src/Deprecated/NestedToken/README.md similarity index 100% rename from src/Component/NestedToken/README.md rename to src/Deprecated/NestedToken/README.md diff --git a/src/Deprecated/NestedToken/composer.json b/src/Deprecated/NestedToken/composer.json new file mode 100644 index 000000000..1fcfe2024 --- /dev/null +++ b/src/Deprecated/NestedToken/composer.json @@ -0,0 +1,39 @@ +{ + "name": "web-token/jwt-nested-token", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/CONTRIBUTING.md b/src/Deprecated/Pack/Encryption/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/CONTRIBUTING.md rename to src/Deprecated/Pack/Encryption/.github/CONTRIBUTING.md diff --git a/packs/encryption/.github/FUNDING.yml b/src/Deprecated/Pack/Encryption/.github/FUNDING.yml similarity index 100% rename from packs/encryption/.github/FUNDING.yml rename to src/Deprecated/Pack/Encryption/.github/FUNDING.yml diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Pack/Encryption/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Pack/Encryption/.github/PULL_REQUEST_TEMPLATE.md diff --git a/packs/encryption/README.md b/src/Deprecated/Pack/Encryption/README.md similarity index 100% rename from packs/encryption/README.md rename to src/Deprecated/Pack/Encryption/README.md diff --git a/src/Deprecated/Pack/Encryption/composer.json b/src/Deprecated/Pack/Encryption/composer.json new file mode 100644 index 000000000..4fc593eb3 --- /dev/null +++ b/src/Deprecated/Pack/Encryption/composer.json @@ -0,0 +1,10 @@ +{ + "name": "web-token/encryption-pack", + "type": "symfony-pack", + "license": "MIT", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "require": { + "web-token/jwt-library": "^3.3", + "web-token/jwt-experimental": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/CONTRIBUTING.md b/src/Deprecated/Pack/Signature/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/CONTRIBUTING.md rename to src/Deprecated/Pack/Signature/.github/CONTRIBUTING.md diff --git a/packs/signature/.github/FUNDING.yml b/src/Deprecated/Pack/Signature/.github/FUNDING.yml similarity index 100% rename from packs/signature/.github/FUNDING.yml rename to src/Deprecated/Pack/Signature/.github/FUNDING.yml diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Pack/Signature/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Pack/Signature/.github/PULL_REQUEST_TEMPLATE.md diff --git a/packs/signature/README.md b/src/Deprecated/Pack/Signature/README.md similarity index 100% rename from packs/signature/README.md rename to src/Deprecated/Pack/Signature/README.md diff --git a/src/Deprecated/Pack/Signature/composer.json b/src/Deprecated/Pack/Signature/composer.json new file mode 100644 index 000000000..a18afc6f1 --- /dev/null +++ b/src/Deprecated/Pack/Signature/composer.json @@ -0,0 +1,10 @@ +{ + "name": "web-token/signature-pack", + "type": "symfony-pack", + "license": "MIT", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "require": { + "web-token/jwt-library": "^3.3", + "web-token/jwt-experimental": "^3.3" + } +} diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/.github/CONTRIBUTING.md b/src/Deprecated/Signature/.github/CONTRIBUTING.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/.github/CONTRIBUTING.md rename to src/Deprecated/Signature/.github/CONTRIBUTING.md diff --git a/src/Deprecated/Signature/.github/FUNDING.yml b/src/Deprecated/Signature/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/Signature/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/Signature/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/Signature/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/Signature/.github/stale.yml b/src/Deprecated/Signature/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/Signature/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/Signature/LICENSE b/src/Deprecated/Signature/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/Signature/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Component/Signature/README.md b/src/Deprecated/Signature/README.md similarity index 100% rename from src/Component/Signature/README.md rename to src/Deprecated/Signature/README.md diff --git a/src/Deprecated/Signature/composer.json b/src/Deprecated/Signature/composer.json new file mode 100644 index 000000000..7dad9daa1 --- /dev/null +++ b/src/Deprecated/Signature/composer.json @@ -0,0 +1,39 @@ +{ + "name": "web-token/jwt-signature", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/SignatureAlgorithm/ECDSA/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/ECDSA/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/ECDSA/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/ECDSA/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/ECDSA/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/ECDSA/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/ECDSA/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/ECDSA/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/ECDSA/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/ECDSA/LICENSE b/src/Deprecated/SignatureAlgorithm/ECDSA/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/ECDSA/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/ECDSA/README.md b/src/Deprecated/SignatureAlgorithm/ECDSA/README.md similarity index 100% rename from src/SignatureAlgorithm/ECDSA/README.md rename to src/Deprecated/SignatureAlgorithm/ECDSA/README.md diff --git a/src/SignatureAlgorithm/ECDSA/composer.json b/src/Deprecated/SignatureAlgorithm/ECDSA/composer.json similarity index 77% rename from src/SignatureAlgorithm/ECDSA/composer.json rename to src/Deprecated/SignatureAlgorithm/ECDSA/composer.json index 9b629f444..8d5a6657e 100644 --- a/src/SignatureAlgorithm/ECDSA/composer.json +++ b/src/Deprecated/SignatureAlgorithm/ECDSA/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-signature-algorithm-ecdsa", - "description": "ECDSA Based Signature Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,9 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", "ext-openssl": "*", - "web-token/jwt-signature": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/SignatureAlgorithm/EdDSA/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/EdDSA/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/EdDSA/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/EdDSA/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/EdDSA/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/EdDSA/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/EdDSA/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/EdDSA/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/EdDSA/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/EdDSA/LICENSE b/src/Deprecated/SignatureAlgorithm/EdDSA/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/EdDSA/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/EdDSA/README.md b/src/Deprecated/SignatureAlgorithm/EdDSA/README.md similarity index 100% rename from src/SignatureAlgorithm/EdDSA/README.md rename to src/Deprecated/SignatureAlgorithm/EdDSA/README.md diff --git a/src/SignatureAlgorithm/EdDSA/composer.json b/src/Deprecated/SignatureAlgorithm/EdDSA/composer.json similarity index 78% rename from src/SignatureAlgorithm/EdDSA/composer.json rename to src/Deprecated/SignatureAlgorithm/EdDSA/composer.json index a5595bc58..f572be837 100644 --- a/src/SignatureAlgorithm/EdDSA/composer.json +++ b/src/Deprecated/SignatureAlgorithm/EdDSA/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-signature-algorithm-eddsa", - "description": "EdDSA Signature Algorithm the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,10 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", "ext-sodium": "*", - "web-token/jwt-signature": "^3.2" + "paragonie/sodium_compat": "^1.20", + "web-token/jwt-library": "^3.3" } } diff --git a/src/SignatureAlgorithm/Experimental/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/Experimental/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/Experimental/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/Experimental/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/Experimental/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/Experimental/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/Experimental/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/Experimental/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/Experimental/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/Experimental/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/Experimental/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/Experimental/LICENSE b/src/Deprecated/SignatureAlgorithm/Experimental/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/Experimental/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/Experimental/README.md b/src/Deprecated/SignatureAlgorithm/Experimental/README.md similarity index 100% rename from src/SignatureAlgorithm/Experimental/README.md rename to src/Deprecated/SignatureAlgorithm/Experimental/README.md diff --git a/src/SignatureAlgorithm/Experimental/composer.json b/src/Deprecated/SignatureAlgorithm/Experimental/composer.json similarity index 72% rename from src/SignatureAlgorithm/Experimental/composer.json rename to src/Deprecated/SignatureAlgorithm/Experimental/composer.json index e60d7f76a..481492f19 100644 --- a/src/SignatureAlgorithm/Experimental/composer.json +++ b/src/Deprecated/SignatureAlgorithm/Experimental/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-signature-algorithm-experimental", - "description": "Experimental Signature Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-experimental instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,14 +32,8 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", - "web-token/jwt-signature-algorithm-rsa": "^3.2", - "web-token/jwt-signature-algorithm-hmac": "^3.2" + "web-token/jwt-experimental": "^3.3" } } diff --git a/src/SignatureAlgorithm/HMAC/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/HMAC/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/HMAC/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/HMAC/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/HMAC/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/HMAC/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/HMAC/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/HMAC/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/HMAC/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/HMAC/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/HMAC/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/HMAC/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/HMAC/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/HMAC/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/HMAC/LICENSE b/src/Deprecated/SignatureAlgorithm/HMAC/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/HMAC/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/HMAC/README.md b/src/Deprecated/SignatureAlgorithm/HMAC/README.md similarity index 100% rename from src/SignatureAlgorithm/HMAC/README.md rename to src/Deprecated/SignatureAlgorithm/HMAC/README.md diff --git a/src/SignatureAlgorithm/HMAC/composer.json b/src/Deprecated/SignatureAlgorithm/HMAC/composer.json similarity index 77% rename from src/SignatureAlgorithm/HMAC/composer.json rename to src/Deprecated/SignatureAlgorithm/HMAC/composer.json index 8418443eb..f57315c85 100644 --- a/src/SignatureAlgorithm/HMAC/composer.json +++ b/src/Deprecated/SignatureAlgorithm/HMAC/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-signature-algorithm-hmac", - "description": "HMAC Based Signature Algorithms the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,13 +32,8 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", - "web-token/jwt-signature": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/SignatureAlgorithm/None/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/None/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/None/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/None/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/None/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/None/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/None/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/None/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/None/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/None/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/None/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/None/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/None/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/None/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/None/LICENSE b/src/Deprecated/SignatureAlgorithm/None/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/None/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/None/README.md b/src/Deprecated/SignatureAlgorithm/None/README.md similarity index 100% rename from src/SignatureAlgorithm/None/README.md rename to src/Deprecated/SignatureAlgorithm/None/README.md diff --git a/src/SignatureAlgorithm/None/composer.json b/src/Deprecated/SignatureAlgorithm/None/composer.json similarity index 77% rename from src/SignatureAlgorithm/None/composer.json rename to src/Deprecated/SignatureAlgorithm/None/composer.json index 31cc9777e..e5d9d8150 100644 --- a/src/SignatureAlgorithm/None/composer.json +++ b/src/Deprecated/SignatureAlgorithm/None/composer.json @@ -1,6 +1,6 @@ { "name": "web-token/jwt-signature-algorithm-none", - "description": "None Signature Algorithm the JWT Framework.", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", "type": "library", "license": "MIT", "keywords": [ @@ -32,13 +32,8 @@ "homepage": "https://github.com/web-token/jwt-framework/contributors" } ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, "require": { "php": ">=8.1", - "web-token/jwt-signature": "^3.2" + "web-token/jwt-library": "^3.3" } } diff --git a/src/SignatureAlgorithm/RSA/.github/CONTRIBUTING.md b/src/Deprecated/SignatureAlgorithm/RSA/.github/CONTRIBUTING.md similarity index 100% rename from src/SignatureAlgorithm/RSA/.github/CONTRIBUTING.md rename to src/Deprecated/SignatureAlgorithm/RSA/.github/CONTRIBUTING.md diff --git a/src/Deprecated/SignatureAlgorithm/RSA/.github/FUNDING.yml b/src/Deprecated/SignatureAlgorithm/RSA/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/RSA/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/RSA/.github/PULL_REQUEST_TEMPLATE.md b/src/Deprecated/SignatureAlgorithm/RSA/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from src/SignatureAlgorithm/RSA/.github/PULL_REQUEST_TEMPLATE.md rename to src/Deprecated/SignatureAlgorithm/RSA/.github/PULL_REQUEST_TEMPLATE.md diff --git a/src/Deprecated/SignatureAlgorithm/RSA/.github/stale.yml b/src/Deprecated/SignatureAlgorithm/RSA/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/RSA/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Deprecated/SignatureAlgorithm/RSA/LICENSE b/src/Deprecated/SignatureAlgorithm/RSA/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/RSA/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SignatureAlgorithm/RSA/README.md b/src/Deprecated/SignatureAlgorithm/RSA/README.md similarity index 100% rename from src/SignatureAlgorithm/RSA/README.md rename to src/Deprecated/SignatureAlgorithm/RSA/README.md diff --git a/src/Deprecated/SignatureAlgorithm/RSA/composer.json b/src/Deprecated/SignatureAlgorithm/RSA/composer.json new file mode 100644 index 000000000..78c770c5f --- /dev/null +++ b/src/Deprecated/SignatureAlgorithm/RSA/composer.json @@ -0,0 +1,41 @@ +{ + "name": "web-token/jwt-signature-algorithm-rsa", + "description": "[DEPRECATED] Please use web-token/jwt-library instead.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "require": { + "php": ">=8.1", + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "ext-openssl": "*", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/Ecc/.github/FUNDING.yml b/src/Ecc/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/Ecc/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/Ecc/LICENSE b/src/Ecc/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/Ecc/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/Ecc/composer.json b/src/Ecc/composer.json deleted file mode 100644 index eca633810..000000000 --- a/src/Ecc/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "web-token/jwt-util-ecc", - "description": "ECC Tools for the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Core\\Util\\Ecc\\": "" - } - }, - "require": { - "php": ">=8.1", - "brick/math": "^0.9|^0.10|^0.11" - }, - "suggest": { - "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance", - "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance" - } -} diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml b/src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE b/src/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml b/src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE b/src/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/Experimental/.github/FUNDING.yml b/src/EncryptionAlgorithm/Experimental/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/Experimental/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/Experimental/LICENSE b/src/EncryptionAlgorithm/Experimental/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/Experimental/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/AESKW/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/AESKW/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/Direct/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/Direct/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json b/src/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json deleted file mode 100644 index 127f460b0..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "web-token/jwt-encryption-algorithm-ecdh-es", - "description": "ECDH-ES Based Key Encryption Algorithms the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, - "suggest": { - "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys" - }, - "require": { - "php": ">=8.1", - "ext-openssl": "*", - "spomky-labs/aes-key-wrap": "^7.0", - "web-token/jwt-encryption": "^3.2", - "web-token/jwt-util-ecc": "^3.2" - } -} diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/PBES2/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/PBES2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml b/src/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/RSA/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE b/src/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/RSA/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/composer.json b/src/EncryptionAlgorithm/KeyEncryption/RSA/composer.json deleted file mode 100644 index 3c5b78bf0..000000000 --- a/src/EncryptionAlgorithm/KeyEncryption/RSA/composer.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "web-token/jwt-encryption-algorithm-rsa", - "description": "RSA Based Key Encryption Algorithms the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": "" - } - }, - "require": { - "php": ">=8.1", - "brick/math": "^0.9|^0.10|^0.11", - "ext-openssl": "*", - "symfony/polyfill-mbstring": "^1.12", - "web-token/jwt-encryption": "^3.2" - }, - "suggest": { - "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance", - "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance" - } -} diff --git a/src/Experimental/.github/CONTRIBUTING.md b/src/Experimental/.github/CONTRIBUTING.md new file mode 100644 index 000000000..5e80b426f --- /dev/null +++ b/src/Experimental/.github/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing + +This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is +READ ONLY. +Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/src/Experimental/.github/FUNDING.yml b/src/Experimental/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Experimental/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Experimental/.github/PULL_REQUEST_TEMPLATE.md b/src/Experimental/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..d4ff96cb4 --- /dev/null +++ b/src/Experimental/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ +Please do not submit any Pull Requests here. It will be automatically closed. + +You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/src/Experimental/.github/stale.yml b/src/Experimental/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Experimental/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_128.php b/src/Experimental/ContentEncryption/A128CCM_16_128.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_128.php rename to src/Experimental/ContentEncryption/A128CCM_16_128.php index 68c7c54ca..484ca59c8 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_128.php +++ b/src/Experimental/ContentEncryption/A128CCM_16_128.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A128CCM_16_128 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_64.php b/src/Experimental/ContentEncryption/A128CCM_16_64.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_64.php rename to src/Experimental/ContentEncryption/A128CCM_16_64.php index 01249ec20..561cda321 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_16_64.php +++ b/src/Experimental/ContentEncryption/A128CCM_16_64.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A128CCM_16_64 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_128.php b/src/Experimental/ContentEncryption/A128CCM_64_128.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_128.php rename to src/Experimental/ContentEncryption/A128CCM_64_128.php index ecb30a958..14399f4dc 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_128.php +++ b/src/Experimental/ContentEncryption/A128CCM_64_128.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A128CCM_64_128 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_64.php b/src/Experimental/ContentEncryption/A128CCM_64_64.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_64.php rename to src/Experimental/ContentEncryption/A128CCM_64_64.php index 674b03446..40bc3d01d 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A128CCM_64_64.php +++ b/src/Experimental/ContentEncryption/A128CCM_64_64.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A128CCM_64_64 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_128.php b/src/Experimental/ContentEncryption/A256CCM_16_128.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_128.php rename to src/Experimental/ContentEncryption/A256CCM_16_128.php index 7f4e2f264..766007889 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_128.php +++ b/src/Experimental/ContentEncryption/A256CCM_16_128.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A256CCM_16_128 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_64.php b/src/Experimental/ContentEncryption/A256CCM_16_64.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_64.php rename to src/Experimental/ContentEncryption/A256CCM_16_64.php index 3626ff94c..e5efca0d3 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_16_64.php +++ b/src/Experimental/ContentEncryption/A256CCM_16_64.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A256CCM_16_64 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_128.php b/src/Experimental/ContentEncryption/A256CCM_64_128.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_128.php rename to src/Experimental/ContentEncryption/A256CCM_64_128.php index ce7415513..d83c3f51c 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_128.php +++ b/src/Experimental/ContentEncryption/A256CCM_64_128.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A256CCM_64_128 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_64.php b/src/Experimental/ContentEncryption/A256CCM_64_64.php similarity index 87% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_64.php rename to src/Experimental/ContentEncryption/A256CCM_64_64.php index 8abdef698..13aa1f076 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/A256CCM_64_64.php +++ b/src/Experimental/ContentEncryption/A256CCM_64_64.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; final class A256CCM_64_64 extends AESCCM { diff --git a/src/EncryptionAlgorithm/Experimental/ContentEncryption/AESCCM.php b/src/Experimental/ContentEncryption/AESCCM.php similarity index 96% rename from src/EncryptionAlgorithm/Experimental/ContentEncryption/AESCCM.php rename to src/Experimental/ContentEncryption/AESCCM.php index 78e7cdab6..5c2c31d33 100644 --- a/src/EncryptionAlgorithm/Experimental/ContentEncryption/AESCCM.php +++ b/src/Experimental/ContentEncryption/AESCCM.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Experimental\ContentEncryption; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; -use const OPENSSL_RAW_DATA; use RuntimeException; +use const OPENSSL_RAW_DATA; abstract class AESCCM implements ContentEncryptionAlgorithm { diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A128CTR.php b/src/Experimental/KeyEncryption/A128CTR.php similarity index 79% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/A128CTR.php rename to src/Experimental/KeyEncryption/A128CTR.php index 778785387..27dc8366a 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A128CTR.php +++ b/src/Experimental/KeyEncryption/A128CTR.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; final class A128CTR extends AESCTR { diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A192CTR.php b/src/Experimental/KeyEncryption/A192CTR.php similarity index 79% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/A192CTR.php rename to src/Experimental/KeyEncryption/A192CTR.php index 2cab2f9dc..d8e8bd191 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A192CTR.php +++ b/src/Experimental/KeyEncryption/A192CTR.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; final class A192CTR extends AESCTR { diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A256CTR.php b/src/Experimental/KeyEncryption/A256CTR.php similarity index 79% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/A256CTR.php rename to src/Experimental/KeyEncryption/A256CTR.php index 6550090bb..b020f0c27 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/A256CTR.php +++ b/src/Experimental/KeyEncryption/A256CTR.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; final class A256CTR extends AESCTR { diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/AESCTR.php b/src/Experimental/KeyEncryption/AESCTR.php similarity index 91% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/AESCTR.php rename to src/Experimental/KeyEncryption/AESCTR.php index 35d062cb3..76fd00f07 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/AESCTR.php +++ b/src/Experimental/KeyEncryption/AESCTR.php @@ -2,15 +2,16 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; -use const OPENSSL_RAW_DATA; +use Jose\Component\Encryption\Algorithm\KeyEncryption\KeyEncryption; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function in_array; +use function is_string; +use const OPENSSL_RAW_DATA; abstract class AESCTR implements KeyEncryption { @@ -47,7 +48,7 @@ public function decryptKey(JWK $key, string $encrypted_cek, array $header): stri $k = $this->getKey($key); isset($header['iv']) || throw new InvalidArgumentException('The header parameter "iv" is missing.'); is_string($header['iv']) || throw new InvalidArgumentException('The header parameter "iv" is not valid.'); - $iv = Base64UrlSafe::decode($header['iv']); + $iv = Base64UrlSafe::decodeNoPadding($header['iv']); $result = openssl_decrypt($encrypted_cek, $this->getMode(), $k, OPENSSL_RAW_DATA, $iv); if ($result === false) { @@ -77,6 +78,6 @@ private function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } } diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/Chacha20Poly1305.php b/src/Experimental/KeyEncryption/Chacha20Poly1305.php similarity index 92% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/Chacha20Poly1305.php rename to src/Experimental/KeyEncryption/Chacha20Poly1305.php index f7d5e3db7..947a7c834 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/Chacha20Poly1305.php +++ b/src/Experimental/KeyEncryption/Chacha20Poly1305.php @@ -2,16 +2,17 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; +use Jose\Component\Encryption\Algorithm\KeyEncryption\KeyEncryption; use LogicException; -use const OPENSSL_RAW_DATA; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function in_array; +use function is_string; +use const OPENSSL_RAW_DATA; final class Chacha20Poly1305 implements KeyEncryption { @@ -61,7 +62,7 @@ public function decryptKey(JWK $key, string $encrypted_cek, array $header): stri $k = $this->getKey($key); isset($header['nonce']) || throw new InvalidArgumentException('The header parameter "nonce" is missing.'); is_string($header['nonce']) || throw new InvalidArgumentException('The header parameter "nonce" is not valid.'); - $nonce = Base64UrlSafe::decode($header['nonce']); + $nonce = Base64UrlSafe::decodeNoPadding($header['nonce']); if (mb_strlen($nonce, '8bit') !== 12) { throw new InvalidArgumentException('The header parameter "nonce" is not valid.'); } @@ -92,6 +93,6 @@ private function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } } diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP384.php b/src/Experimental/KeyEncryption/RSAOAEP384.php similarity index 79% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP384.php rename to src/Experimental/KeyEncryption/RSAOAEP384.php index 70eda9456..03863fb50 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP384.php +++ b/src/Experimental/KeyEncryption/RSAOAEP384.php @@ -2,8 +2,9 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; +use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA; use Jose\Component\Encryption\Algorithm\KeyEncryption\Util\RSACrypt; final class RSAOAEP384 extends RSA diff --git a/src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP512.php b/src/Experimental/KeyEncryption/RSAOAEP512.php similarity index 79% rename from src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP512.php rename to src/Experimental/KeyEncryption/RSAOAEP512.php index 37aaf3ec0..3c6b6e8a3 100644 --- a/src/EncryptionAlgorithm/Experimental/KeyEncryption/RSAOAEP512.php +++ b/src/Experimental/KeyEncryption/RSAOAEP512.php @@ -2,8 +2,9 @@ declare(strict_types=1); -namespace Jose\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Experimental\KeyEncryption; +use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA; use Jose\Component\Encryption\Algorithm\KeyEncryption\Util\RSACrypt; final class RSAOAEP512 extends RSA diff --git a/src/Experimental/LICENSE b/src/Experimental/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Experimental/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Experimental/README.md b/src/Experimental/README.md new file mode 100644 index 000000000..0a2b05ce5 --- /dev/null +++ b/src/Experimental/README.md @@ -0,0 +1,16 @@ +Experimental Signature Algorithms For JWT-Framework +=================================================== + +This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is +READ ONLY. + +**Please do not submit any Pull Request here.** +You should go to [the main repository](https://github.com/web-token/jwt-framework) instead. + +# Documentation + +The official documentation is available as https://web-token.spomky-labs.com/ + +# Licence + +This software is release under [MIT licence](LICENSE). diff --git a/src/SignatureAlgorithm/Experimental/Blake2b.php b/src/Experimental/Signature/Blake2b.php similarity index 79% rename from src/SignatureAlgorithm/Experimental/Blake2b.php rename to src/Experimental/Signature/Blake2b.php index 92e6ddb8c..73cd75792 100644 --- a/src/SignatureAlgorithm/Experimental/Blake2b.php +++ b/src/Experimental/Signature/Blake2b.php @@ -2,13 +2,16 @@ declare(strict_types=1); -namespace Jose\Component\Signature\Algorithm; +namespace Jose\Experimental\Signature; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; +use Jose\Component\Signature\Algorithm\MacAlgorithm; use ParagonIE\ConstantTime\Base64UrlSafe; +use RuntimeException; +use function extension_loaded; +use function in_array; +use function is_string; /** * @see \Jose\Tests\Component\Signature\Algorithm\Blake2bTest @@ -17,6 +20,13 @@ final class Blake2b implements MacAlgorithm { private const MINIMUM_KEY_LENGTH = 32; + public function __construct() + { + if (! extension_loaded('sodium')) { + throw new RuntimeException('Please install the Sodium extension'); + } + } + public function allowedKeyTypes(): array { return ['oct']; @@ -51,7 +61,7 @@ private function getKey(JWK $key): string if (! is_string($k)) { throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - $key = Base64UrlSafe::decode($k); + $key = Base64UrlSafe::decodeNoPadding($k); if (mb_strlen($key, '8bit') < self::MINIMUM_KEY_LENGTH) { throw new InvalidArgumentException('Key provided is shorter than 256 bits.'); } diff --git a/src/SignatureAlgorithm/Experimental/ES256K.php b/src/Experimental/Signature/ES256K.php similarity index 78% rename from src/SignatureAlgorithm/Experimental/ES256K.php rename to src/Experimental/Signature/ES256K.php index bcca85944..d365356b6 100644 --- a/src/SignatureAlgorithm/Experimental/ES256K.php +++ b/src/Experimental/Signature/ES256K.php @@ -2,7 +2,9 @@ declare(strict_types=1); -namespace Jose\Component\Signature\Algorithm; +namespace Jose\Experimental\Signature; + +use Jose\Component\Signature\Algorithm\ECDSA; final class ES256K extends ECDSA { diff --git a/src/SignatureAlgorithm/Experimental/HS1.php b/src/Experimental/Signature/HS1.php similarity index 72% rename from src/SignatureAlgorithm/Experimental/HS1.php rename to src/Experimental/Signature/HS1.php index 7b409a21d..56bb95457 100644 --- a/src/SignatureAlgorithm/Experimental/HS1.php +++ b/src/Experimental/Signature/HS1.php @@ -2,7 +2,9 @@ declare(strict_types=1); -namespace Jose\Component\Signature\Algorithm; +namespace Jose\Experimental\Signature; + +use Jose\Component\Signature\Algorithm\HMAC; final class HS1 extends HMAC { diff --git a/src/SignatureAlgorithm/Experimental/HS256_64.php b/src/Experimental/Signature/HS256_64.php similarity index 83% rename from src/SignatureAlgorithm/Experimental/HS256_64.php rename to src/Experimental/Signature/HS256_64.php index f5618dc65..fee13591f 100644 --- a/src/SignatureAlgorithm/Experimental/HS256_64.php +++ b/src/Experimental/Signature/HS256_64.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace Jose\Component\Signature\Algorithm; +namespace Jose\Experimental\Signature; use Jose\Component\Core\JWK; +use Jose\Component\Signature\Algorithm\HMAC; final class HS256_64 extends HMAC { diff --git a/src/SignatureAlgorithm/Experimental/RS1.php b/src/Experimental/Signature/RS1.php similarity index 71% rename from src/SignatureAlgorithm/Experimental/RS1.php rename to src/Experimental/Signature/RS1.php index a000073b6..a8cc7b916 100644 --- a/src/SignatureAlgorithm/Experimental/RS1.php +++ b/src/Experimental/Signature/RS1.php @@ -2,7 +2,9 @@ declare(strict_types=1); -namespace Jose\Component\Signature\Algorithm; +namespace Jose\Experimental\Signature; + +use Jose\Component\Signature\Algorithm\RSAPKCS1; final class RS1 extends RSAPKCS1 { diff --git a/src/Experimental/composer.json b/src/Experimental/composer.json new file mode 100644 index 000000000..394f915ce --- /dev/null +++ b/src/Experimental/composer.json @@ -0,0 +1,45 @@ +{ + "name": "web-token/jwt-experimental", + "description": "Experimental Algorithms the JWT Framework.", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "autoload": { + "psr-4": { + "Jose\\Experimental\\": "" + } + }, + "require": { + "php": ">=8.1", + "ext-openssl": "*", + "web-token/jwt-library": "^3.3" + } +} diff --git a/src/Library/.github/CONTRIBUTING.md b/src/Library/.github/CONTRIBUTING.md new file mode 100644 index 000000000..5e80b426f --- /dev/null +++ b/src/Library/.github/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing + +This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is +READ ONLY. +Please do not submit any Pull Requests here. It will be automatically closed. diff --git a/src/Library/.github/FUNDING.yml b/src/Library/.github/FUNDING.yml new file mode 100644 index 000000000..726574c1f --- /dev/null +++ b/src/Library/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Spomky +patreon: FlorentMorselli diff --git a/src/Library/.github/PULL_REQUEST_TEMPLATE.md b/src/Library/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..d4ff96cb4 --- /dev/null +++ b/src/Library/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ +Please do not submit any Pull Requests here. It will be automatically closed. + +You should submit it here: https://github.com/web-token/jwt-framework/pulls diff --git a/src/Library/.github/stale.yml b/src/Library/.github/stale.yml new file mode 100644 index 000000000..3c84124dd --- /dev/null +++ b/src/Library/.github/stale.yml @@ -0,0 +1,8 @@ +daysUntilStale: 60 +daysUntilClose: 7 +staleLabel: wontfix +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +closeComment: false diff --git a/src/Component/Checker/AlgorithmChecker.php b/src/Library/Checker/AlgorithmChecker.php similarity index 96% rename from src/Component/Checker/AlgorithmChecker.php rename to src/Library/Checker/AlgorithmChecker.php index bed911947..c2d7d0319 100644 --- a/src/Component/Checker/AlgorithmChecker.php +++ b/src/Library/Checker/AlgorithmChecker.php @@ -24,9 +24,6 @@ public function __construct( ) { } - /** - * {@inheritdoc} - */ public function checkHeader(mixed $value): void { if (! is_string($value)) { diff --git a/src/Component/Checker/AudienceChecker.php b/src/Library/Checker/AudienceChecker.php similarity index 95% rename from src/Component/Checker/AudienceChecker.php rename to src/Library/Checker/AudienceChecker.php index 2994869f5..995a94c9d 100644 --- a/src/Component/Checker/AudienceChecker.php +++ b/src/Library/Checker/AudienceChecker.php @@ -22,17 +22,11 @@ public function __construct( ) { } - /** - * {@inheritdoc} - */ public function checkClaim(mixed $value): void { $this->checkValue($value, InvalidClaimException::class); } - /** - * {@inheritdoc} - */ public function checkHeader(mixed $value): void { $this->checkValue($value, InvalidHeaderException::class); diff --git a/src/Library/Checker/CallableChecker.php b/src/Library/Checker/CallableChecker.php new file mode 100644 index 000000000..9f51b8c14 --- /dev/null +++ b/src/Library/Checker/CallableChecker.php @@ -0,0 +1,58 @@ +callable)) { // @phpstan-ignore-line + throw new InvalidArgumentException('The $callable argument must be a callable.'); + } + } + + public function checkClaim(mixed $value): void + { + if (call_user_func($this->callable, $value) !== true) { + throw new InvalidClaimException(sprintf('The "%s" claim is invalid.', $this->key), $this->key, $value); + } + } + + public function supportedClaim(): string + { + return $this->key; + } + + public function checkHeader(mixed $value): void + { + if (call_user_func($this->callable, $value) !== true) { + throw new InvalidHeaderException(sprintf('The "%s" header is invalid.', $this->key), $this->key, $value); + } + } + + public function supportedHeader(): string + { + return $this->key; + } + + public function protectedHeaderOnly(): bool + { + return $this->protectedHeaderOnly; + } +} diff --git a/src/Component/Checker/ClaimChecker.php b/src/Library/Checker/ClaimChecker.php similarity index 100% rename from src/Component/Checker/ClaimChecker.php rename to src/Library/Checker/ClaimChecker.php diff --git a/src/Component/Checker/ClaimCheckerManager.php b/src/Library/Checker/ClaimCheckerManager.php similarity index 100% rename from src/Component/Checker/ClaimCheckerManager.php rename to src/Library/Checker/ClaimCheckerManager.php diff --git a/src/Component/Checker/ClaimCheckerManagerFactory.php b/src/Library/Checker/ClaimCheckerManagerFactory.php similarity index 100% rename from src/Component/Checker/ClaimCheckerManagerFactory.php rename to src/Library/Checker/ClaimCheckerManagerFactory.php diff --git a/src/Component/Checker/ClaimExceptionInterface.php b/src/Library/Checker/ClaimExceptionInterface.php similarity index 100% rename from src/Component/Checker/ClaimExceptionInterface.php rename to src/Library/Checker/ClaimExceptionInterface.php diff --git a/src/Component/Checker/ExpirationTimeChecker.php b/src/Library/Checker/ExpirationTimeChecker.php similarity index 95% rename from src/Component/Checker/ExpirationTimeChecker.php rename to src/Library/Checker/ExpirationTimeChecker.php index 7d43bbed6..f016d399c 100644 --- a/src/Component/Checker/ExpirationTimeChecker.php +++ b/src/Library/Checker/ExpirationTimeChecker.php @@ -4,9 +4,9 @@ namespace Jose\Component\Checker; +use Psr\Clock\ClockInterface; use function is_float; use function is_int; -use Psr\Clock\ClockInterface; /** * This class is a claim checker. When the "exp" is present, it will compare the value with the current timestamp. @@ -24,8 +24,8 @@ public function __construct( ) { if ($clock === null) { trigger_deprecation( - 'web-token/jwt-checker', - '3.2.0', + 'web-token/jwt-library', + '3.3.0', 'The parameter "$clock" will become mandatory in 4.0.0. Please set a valid PSR Clock implementation instead of "null".' ); $clock = new InternalClock(); @@ -33,9 +33,6 @@ public function __construct( $this->clock = $clock; } - /** - * {@inheritdoc} - */ public function checkClaim(mixed $value): void { if (! is_float($value) && ! is_int($value)) { diff --git a/src/Component/Checker/HeaderChecker.php b/src/Library/Checker/HeaderChecker.php similarity index 100% rename from src/Component/Checker/HeaderChecker.php rename to src/Library/Checker/HeaderChecker.php diff --git a/src/Component/Checker/HeaderCheckerManager.php b/src/Library/Checker/HeaderCheckerManager.php similarity index 100% rename from src/Component/Checker/HeaderCheckerManager.php rename to src/Library/Checker/HeaderCheckerManager.php index 4f1c9bdb1..124bfe920 100644 --- a/src/Component/Checker/HeaderCheckerManager.php +++ b/src/Library/Checker/HeaderCheckerManager.php @@ -4,11 +4,11 @@ namespace Jose\Component\Checker; +use InvalidArgumentException; +use Jose\Component\Core\JWT; use function array_key_exists; use function count; -use InvalidArgumentException; use function is_array; -use Jose\Component\Core\JWT; class HeaderCheckerManager { diff --git a/src/Component/Checker/HeaderCheckerManagerFactory.php b/src/Library/Checker/HeaderCheckerManagerFactory.php similarity index 100% rename from src/Component/Checker/HeaderCheckerManagerFactory.php rename to src/Library/Checker/HeaderCheckerManagerFactory.php diff --git a/src/Component/Checker/InternalClock.php b/src/Library/Checker/InternalClock.php similarity index 100% rename from src/Component/Checker/InternalClock.php rename to src/Library/Checker/InternalClock.php diff --git a/src/Component/Checker/InvalidClaimException.php b/src/Library/Checker/InvalidClaimException.php similarity index 100% rename from src/Component/Checker/InvalidClaimException.php rename to src/Library/Checker/InvalidClaimException.php diff --git a/src/Component/Checker/InvalidHeaderException.php b/src/Library/Checker/InvalidHeaderException.php similarity index 100% rename from src/Component/Checker/InvalidHeaderException.php rename to src/Library/Checker/InvalidHeaderException.php diff --git a/src/Library/Checker/IsEqualChecker.php b/src/Library/Checker/IsEqualChecker.php new file mode 100644 index 000000000..d826475ca --- /dev/null +++ b/src/Library/Checker/IsEqualChecker.php @@ -0,0 +1,53 @@ +value) { + throw new InvalidClaimException(sprintf('The "%s" claim is invalid.', $this->key), $this->key, $value); + } + } + + public function supportedClaim(): string + { + return $this->key; + } + + public function checkHeader(mixed $value): void + { + if ($value !== $this->value) { + throw new InvalidHeaderException(sprintf('The "%s" header is invalid.', $this->key), $this->key, $value); + } + } + + public function supportedHeader(): string + { + return $this->key; + } + + public function protectedHeaderOnly(): bool + { + return $this->protectedHeaderOnly; + } +} diff --git a/src/Component/Checker/IssuedAtChecker.php b/src/Library/Checker/IssuedAtChecker.php similarity index 95% rename from src/Component/Checker/IssuedAtChecker.php rename to src/Library/Checker/IssuedAtChecker.php index b71c7d0b4..4ed0fd204 100644 --- a/src/Component/Checker/IssuedAtChecker.php +++ b/src/Library/Checker/IssuedAtChecker.php @@ -4,9 +4,9 @@ namespace Jose\Component\Checker; +use Psr\Clock\ClockInterface; use function is_float; use function is_int; -use Psr\Clock\ClockInterface; /** * This class is a claim checker. When the "iat" is present, it will compare the value with the current timestamp. @@ -24,8 +24,8 @@ public function __construct( ) { if ($clock === null) { trigger_deprecation( - 'web-token/jwt-checker', - '3.2.0', + 'web-token/jwt-library', + '3.3.0', 'The parameter "$clock" will become mandatory in 4.0.0. Please set a valid PSR Clock implementation instead of "null".' ); $clock = new InternalClock(); @@ -33,9 +33,6 @@ public function __construct( $this->clock = $clock; } - /** - * {@inheritdoc} - */ public function checkClaim(mixed $value): void { if (! is_float($value) && ! is_int($value)) { diff --git a/src/Component/Checker/IssuerChecker.php b/src/Library/Checker/IssuerChecker.php similarity index 100% rename from src/Component/Checker/IssuerChecker.php rename to src/Library/Checker/IssuerChecker.php diff --git a/src/Component/Checker/MissingMandatoryClaimException.php b/src/Library/Checker/MissingMandatoryClaimException.php similarity index 100% rename from src/Component/Checker/MissingMandatoryClaimException.php rename to src/Library/Checker/MissingMandatoryClaimException.php diff --git a/src/Component/Checker/MissingMandatoryHeaderParameterException.php b/src/Library/Checker/MissingMandatoryHeaderParameterException.php similarity index 100% rename from src/Component/Checker/MissingMandatoryHeaderParameterException.php rename to src/Library/Checker/MissingMandatoryHeaderParameterException.php diff --git a/src/Component/Checker/NotBeforeChecker.php b/src/Library/Checker/NotBeforeChecker.php similarity index 95% rename from src/Component/Checker/NotBeforeChecker.php rename to src/Library/Checker/NotBeforeChecker.php index 95599f4ac..c5b6adaf8 100644 --- a/src/Component/Checker/NotBeforeChecker.php +++ b/src/Library/Checker/NotBeforeChecker.php @@ -4,9 +4,9 @@ namespace Jose\Component\Checker; +use Psr\Clock\ClockInterface; use function is_float; use function is_int; -use Psr\Clock\ClockInterface; /** * This class is a claim checker. When the "nbf" is present, it will compare the value with the current timestamp. @@ -24,8 +24,8 @@ public function __construct( ) { if ($clock === null) { trigger_deprecation( - 'web-token/jwt-checker', - '3.2.0', + 'web-token/jwt-library', + '3.3.0', 'The parameter "$clock" will become mandatory in 4.0.0. Please set a valid PSR Clock implementation instead of "null".' ); $clock = new InternalClock(); @@ -33,9 +33,6 @@ public function __construct( $this->clock = $clock; } - /** - * {@inheritdoc} - */ public function checkClaim(mixed $value): void { if (! is_float($value) && ! is_int($value)) { diff --git a/src/Component/Checker/TokenTypeSupport.php b/src/Library/Checker/TokenTypeSupport.php similarity index 100% rename from src/Component/Checker/TokenTypeSupport.php rename to src/Library/Checker/TokenTypeSupport.php diff --git a/src/Component/Checker/UnencodedPayloadChecker.php b/src/Library/Checker/UnencodedPayloadChecker.php similarity index 95% rename from src/Component/Checker/UnencodedPayloadChecker.php rename to src/Library/Checker/UnencodedPayloadChecker.php index 0a94c37c3..91f79a224 100644 --- a/src/Component/Checker/UnencodedPayloadChecker.php +++ b/src/Library/Checker/UnencodedPayloadChecker.php @@ -15,9 +15,6 @@ final class UnencodedPayloadChecker implements HeaderChecker { private const HEADER_NAME = 'b64'; - /** - * {@inheritdoc} - */ public function checkHeader(mixed $value): void { if (! is_bool($value)) { diff --git a/src/Component/Console/AddKeyIntoKeysetCommand.php b/src/Library/Console/AddKeyIntoKeysetCommand.php similarity index 94% rename from src/Component/Console/AddKeyIntoKeysetCommand.php rename to src/Library/Console/AddKeyIntoKeysetCommand.php index 2604b4bca..0748bc685 100644 --- a/src/Component/Console/AddKeyIntoKeysetCommand.php +++ b/src/Library/Console/AddKeyIntoKeysetCommand.php @@ -5,15 +5,17 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'keyset:add:key', description: 'Add a key into a key set.',)] final class AddKeyIntoKeysetCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:add:key'; diff --git a/src/Component/Console/EcKeyGeneratorCommand.php b/src/Library/Console/EcKeyGeneratorCommand.php similarity index 89% rename from src/Component/Console/EcKeyGeneratorCommand.php rename to src/Library/Console/EcKeyGeneratorCommand.php index 71eab8306..42ff88a74 100644 --- a/src/Component/Console/EcKeyGeneratorCommand.php +++ b/src/Library/Console/EcKeyGeneratorCommand.php @@ -5,12 +5,14 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'key:generate:ec', description: 'Generate an EC key (JWK format)',)] final class EcKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:ec'; diff --git a/src/Component/Console/EcKeysetGeneratorCommand.php b/src/Library/Console/EcKeysetGeneratorCommand.php similarity index 91% rename from src/Component/Console/EcKeysetGeneratorCommand.php rename to src/Library/Console/EcKeysetGeneratorCommand.php index 0bb058f70..5dfab7c32 100644 --- a/src/Component/Console/EcKeysetGeneratorCommand.php +++ b/src/Library/Console/EcKeysetGeneratorCommand.php @@ -5,13 +5,15 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWKSet; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'keyset:generate:ec', description: 'Generate an EC key set (JWKSet format)',)] final class EcKeysetGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'keyset:generate:ec'; diff --git a/src/Component/Console/GeneratorCommand.php b/src/Library/Console/GeneratorCommand.php similarity index 100% rename from src/Component/Console/GeneratorCommand.php rename to src/Library/Console/GeneratorCommand.php index 83fd3a02b..8f4f58cb4 100644 --- a/src/Component/Console/GeneratorCommand.php +++ b/src/Library/Console/GeneratorCommand.php @@ -5,11 +5,11 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_bool; use Jose\Component\KeyManagement\JWKFactory; use ParagonIE\ConstantTime\Base64UrlSafe; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; +use function is_bool; abstract class GeneratorCommand extends ObjectOutputCommand { diff --git a/src/Component/Console/GetThumbprintCommand.php b/src/Library/Console/GetThumbprintCommand.php similarity index 91% rename from src/Component/Console/GetThumbprintCommand.php rename to src/Library/Console/GetThumbprintCommand.php index a8d8eb648..31e0cdf53 100644 --- a/src/Component/Console/GetThumbprintCommand.php +++ b/src/Library/Console/GetThumbprintCommand.php @@ -5,15 +5,17 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'key:thumbprint', description: 'Get the thumbprint of a JWK key.',)] final class GetThumbprintCommand extends ObjectOutputCommand { protected static $defaultName = 'key:thumbprint'; diff --git a/src/Component/Console/JKULoaderCommand.php b/src/Library/Console/JKULoaderCommand.php similarity index 90% rename from src/Component/Console/JKULoaderCommand.php rename to src/Library/Console/JKULoaderCommand.php index a2303db2e..94d2f2ef9 100644 --- a/src/Component/Console/JKULoaderCommand.php +++ b/src/Library/Console/JKULoaderCommand.php @@ -5,12 +5,14 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JKUFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'keyset:load:jku', description: 'Loads a key set from an url.',)] final class JKULoaderCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:load:jku'; diff --git a/src/Component/Console/KeyAnalyzerCommand.php b/src/Library/Console/KeyAnalyzerCommand.php similarity index 95% rename from src/Component/Console/KeyAnalyzerCommand.php rename to src/Library/Console/KeyAnalyzerCommand.php index 9c4bed0a9..368fdfa65 100644 --- a/src/Component/Console/KeyAnalyzerCommand.php +++ b/src/Library/Console/KeyAnalyzerCommand.php @@ -5,17 +5,19 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'key:analyze', description: 'JWK quality analyzer.',)] final class KeyAnalyzerCommand extends Command { protected static $defaultName = 'key:analyze'; diff --git a/src/Component/Console/KeyFileLoaderCommand.php b/src/Library/Console/KeyFileLoaderCommand.php similarity index 91% rename from src/Component/Console/KeyFileLoaderCommand.php rename to src/Library/Console/KeyFileLoaderCommand.php index 8c1a23bab..6ed746762 100644 --- a/src/Component/Console/KeyFileLoaderCommand.php +++ b/src/Library/Console/KeyFileLoaderCommand.php @@ -5,13 +5,15 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'key:load:key', description: 'Loads a key from a key file (JWK format)',)] final class KeyFileLoaderCommand extends GeneratorCommand { protected static $defaultName = 'key:load:key'; diff --git a/src/Component/Console/KeysetAnalyzerCommand.php b/src/Library/Console/KeysetAnalyzerCommand.php similarity index 96% rename from src/Component/Console/KeysetAnalyzerCommand.php rename to src/Library/Console/KeysetAnalyzerCommand.php index d33e8ce46..826afa0c3 100644 --- a/src/Component/Console/KeysetAnalyzerCommand.php +++ b/src/Library/Console/KeysetAnalyzerCommand.php @@ -5,19 +5,21 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager; use Jose\Component\KeyManagement\Analyzer\KeysetAnalyzerManager; use Jose\Component\KeyManagement\Analyzer\MessageBag; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.',)] final class KeysetAnalyzerCommand extends Command { protected static $defaultName = 'keyset:analyze'; diff --git a/src/Component/Console/MergeKeysetCommand.php b/src/Library/Console/MergeKeysetCommand.php similarity index 92% rename from src/Component/Console/MergeKeysetCommand.php rename to src/Library/Console/MergeKeysetCommand.php index 4e692703d..a558ba694 100644 --- a/src/Component/Console/MergeKeysetCommand.php +++ b/src/Library/Console/MergeKeysetCommand.php @@ -5,13 +5,15 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +#[AsCommand(name: 'keyset:merge', description: 'Merge several key sets into one.',)] final class MergeKeysetCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:merge'; diff --git a/src/Component/Console/NoneKeyGeneratorCommand.php b/src/Library/Console/NoneKeyGeneratorCommand.php similarity index 83% rename from src/Component/Console/NoneKeyGeneratorCommand.php rename to src/Library/Console/NoneKeyGeneratorCommand.php index 0b00c776f..86dd6cf91 100644 --- a/src/Component/Console/NoneKeyGeneratorCommand.php +++ b/src/Library/Console/NoneKeyGeneratorCommand.php @@ -8,6 +8,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand( + name: 'key:generate:none', + description: 'Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.', +)] final class NoneKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:none'; diff --git a/src/Component/Console/ObjectOutputCommand.php b/src/Library/Console/ObjectOutputCommand.php similarity index 100% rename from src/Component/Console/ObjectOutputCommand.php rename to src/Library/Console/ObjectOutputCommand.php diff --git a/src/Component/Console/OctKeyGeneratorCommand.php b/src/Library/Console/OctKeyGeneratorCommand.php similarity index 88% rename from src/Component/Console/OctKeyGeneratorCommand.php rename to src/Library/Console/OctKeyGeneratorCommand.php index 499bb561b..2601ebf9b 100644 --- a/src/Component/Console/OctKeyGeneratorCommand.php +++ b/src/Library/Console/OctKeyGeneratorCommand.php @@ -6,10 +6,12 @@ use InvalidArgumentException; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'key:generate:oct', description: 'Generate an octet key (JWK format)',)] final class OctKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:oct'; diff --git a/src/Component/Console/OctKeysetGeneratorCommand.php b/src/Library/Console/OctKeysetGeneratorCommand.php similarity index 90% rename from src/Component/Console/OctKeysetGeneratorCommand.php rename to src/Library/Console/OctKeysetGeneratorCommand.php index 61156528c..e7dd92fae 100644 --- a/src/Component/Console/OctKeysetGeneratorCommand.php +++ b/src/Library/Console/OctKeysetGeneratorCommand.php @@ -7,10 +7,12 @@ use InvalidArgumentException; use Jose\Component\Core\JWKSet; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'keyset:generate:oct', description: 'Generate a key set with octet keys (JWK format)',)] final class OctKeysetGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'keyset:generate:oct'; diff --git a/src/Component/Console/OkpKeyGeneratorCommand.php b/src/Library/Console/OkpKeyGeneratorCommand.php similarity index 88% rename from src/Component/Console/OkpKeyGeneratorCommand.php rename to src/Library/Console/OkpKeyGeneratorCommand.php index 2dc947ba1..195efb7df 100644 --- a/src/Component/Console/OkpKeyGeneratorCommand.php +++ b/src/Library/Console/OkpKeyGeneratorCommand.php @@ -5,12 +5,14 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'key:generate:okp', description: 'Generate an Octet Key Pair key (JWK format)',)] final class OkpKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:okp'; diff --git a/src/Component/Console/OkpKeysetGeneratorCommand.php b/src/Library/Console/OkpKeysetGeneratorCommand.php similarity index 89% rename from src/Component/Console/OkpKeysetGeneratorCommand.php rename to src/Library/Console/OkpKeysetGeneratorCommand.php index 4d78fe246..a98dfd382 100644 --- a/src/Component/Console/OkpKeysetGeneratorCommand.php +++ b/src/Library/Console/OkpKeysetGeneratorCommand.php @@ -5,13 +5,18 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWKSet; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand( + name: 'keyset:generate:okp', + description: 'Generate a key set with Octet Key Pairs keys (JWKSet format)', +)] final class OkpKeysetGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'keyset:generate:okp'; diff --git a/src/Component/Console/OptimizeRsaKeyCommand.php b/src/Library/Console/OptimizeRsaKeyCommand.php similarity index 89% rename from src/Component/Console/OptimizeRsaKeyCommand.php rename to src/Library/Console/OptimizeRsaKeyCommand.php index bd2a9da62..693bc41d2 100644 --- a/src/Component/Console/OptimizeRsaKeyCommand.php +++ b/src/Library/Console/OptimizeRsaKeyCommand.php @@ -5,15 +5,17 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\KeyManagement\KeyConverter\RSAKey; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'key:optimize', description: 'Optimize a RSA key by calculating additional primes (CRT).',)] final class OptimizeRsaKeyCommand extends ObjectOutputCommand { protected static $defaultName = 'key:optimize'; diff --git a/src/Component/Console/P12CertificateLoaderCommand.php b/src/Library/Console/P12CertificateLoaderCommand.php similarity index 91% rename from src/Component/Console/P12CertificateLoaderCommand.php rename to src/Library/Console/P12CertificateLoaderCommand.php index 065c3a4a5..92cfccddb 100644 --- a/src/Component/Console/P12CertificateLoaderCommand.php +++ b/src/Library/Console/P12CertificateLoaderCommand.php @@ -5,13 +5,15 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'key:load:p12', description: 'Load a key from a P12 certificate file.',)] final class P12CertificateLoaderCommand extends GeneratorCommand { protected static $defaultName = 'key:load:p12'; diff --git a/src/Component/Console/PemConverterCommand.php b/src/Library/Console/PemConverterCommand.php similarity index 91% rename from src/Component/Console/PemConverterCommand.php rename to src/Library/Console/PemConverterCommand.php index f73b5071e..1fcb957bd 100644 --- a/src/Component/Console/PemConverterCommand.php +++ b/src/Library/Console/PemConverterCommand.php @@ -5,16 +5,18 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\ECKey; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Core\Util\RSAKey; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand(name: 'key:convert:pkcs1', description: 'Converts a RSA or EC key into PKCS#1 key.',)] final class PemConverterCommand extends ObjectOutputCommand { protected static $defaultName = 'key:convert:pkcs1'; diff --git a/src/Component/Console/PublicKeyCommand.php b/src/Library/Console/PublicKeyCommand.php similarity index 90% rename from src/Component/Console/PublicKeyCommand.php rename to src/Library/Console/PublicKeyCommand.php index 8d593ddc8..81bd93fb9 100644 --- a/src/Component/Console/PublicKeyCommand.php +++ b/src/Library/Console/PublicKeyCommand.php @@ -5,14 +5,18 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand( + name: 'key:convert:public', + description: 'Convert a private key into public key. Symmetric keys (shared keys) are not changed.', +)] final class PublicKeyCommand extends ObjectOutputCommand { protected static $defaultName = 'key:convert:public'; diff --git a/src/Component/Console/PublicKeysetCommand.php b/src/Library/Console/PublicKeysetCommand.php similarity index 88% rename from src/Component/Console/PublicKeysetCommand.php rename to src/Library/Console/PublicKeysetCommand.php index 1b2a537ab..474ebb0ac 100644 --- a/src/Component/Console/PublicKeysetCommand.php +++ b/src/Library/Console/PublicKeysetCommand.php @@ -5,14 +5,19 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_array; +use function is_string; +#[AsCommand( + name: 'keyset:convert:public', + description: 'Convert private keys in a key set into public keys. Symmetric keys (shared keys) are not changed.', +)] final class PublicKeysetCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:convert:public'; diff --git a/src/Component/Console/RotateKeysetCommand.php b/src/Library/Console/RotateKeysetCommand.php similarity index 94% rename from src/Component/Console/RotateKeysetCommand.php rename to src/Library/Console/RotateKeysetCommand.php index d5e9c4f44..d2451f6a8 100644 --- a/src/Component/Console/RotateKeysetCommand.php +++ b/src/Library/Console/RotateKeysetCommand.php @@ -4,17 +4,19 @@ namespace Jose\Component\Console; -use function count; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function count; +use function is_array; +use function is_string; +#[AsCommand(name: 'keyset:rotate', description: 'Rotate a key set.',)] final class RotateKeysetCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:rotate'; diff --git a/src/Component/Console/RsaKeyGeneratorCommand.php b/src/Library/Console/RsaKeyGeneratorCommand.php similarity index 88% rename from src/Component/Console/RsaKeyGeneratorCommand.php rename to src/Library/Console/RsaKeyGeneratorCommand.php index 2dcebdced..409158c47 100644 --- a/src/Component/Console/RsaKeyGeneratorCommand.php +++ b/src/Library/Console/RsaKeyGeneratorCommand.php @@ -6,10 +6,12 @@ use InvalidArgumentException; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'key:generate:rsa', description: 'Generate a RSA key (JWK format)',)] final class RsaKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:rsa'; diff --git a/src/Component/Console/RsaKeysetGeneratorCommand.php b/src/Library/Console/RsaKeysetGeneratorCommand.php similarity index 90% rename from src/Component/Console/RsaKeysetGeneratorCommand.php rename to src/Library/Console/RsaKeysetGeneratorCommand.php index 612bfcb54..adf309e0e 100644 --- a/src/Component/Console/RsaKeysetGeneratorCommand.php +++ b/src/Library/Console/RsaKeysetGeneratorCommand.php @@ -7,10 +7,12 @@ use InvalidArgumentException; use Jose\Component\Core\JWKSet; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'keyset:generate:rsa', description: 'Generate a key set with RSA keys (JWK format)',)] final class RsaKeysetGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'keyset:generate:rsa'; diff --git a/src/Component/Console/SecretKeyGeneratorCommand.php b/src/Library/Console/SecretKeyGeneratorCommand.php similarity index 90% rename from src/Component/Console/SecretKeyGeneratorCommand.php rename to src/Library/Console/SecretKeyGeneratorCommand.php index 3f50630eb..9db7a74a4 100644 --- a/src/Component/Console/SecretKeyGeneratorCommand.php +++ b/src/Library/Console/SecretKeyGeneratorCommand.php @@ -5,14 +5,19 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_bool; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use function is_bool; +use function is_string; +#[AsCommand( + name: 'key:generate:from_secret', + description: 'Generate an octet key (JWK format) using an existing secret', +)] final class SecretKeyGeneratorCommand extends GeneratorCommand { protected static $defaultName = 'key:generate:from_secret'; diff --git a/src/Component/Console/X509CertificateLoaderCommand.php b/src/Library/Console/X509CertificateLoaderCommand.php similarity index 90% rename from src/Component/Console/X509CertificateLoaderCommand.php rename to src/Library/Console/X509CertificateLoaderCommand.php index afeaad56e..d26e2d2ff 100644 --- a/src/Component/Console/X509CertificateLoaderCommand.php +++ b/src/Library/Console/X509CertificateLoaderCommand.php @@ -5,12 +5,14 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\JWKFactory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'key:load:x509', description: 'Load a key from a X.509 certificate file.',)] final class X509CertificateLoaderCommand extends GeneratorCommand { protected static $defaultName = 'key:load:x509'; diff --git a/src/Component/Console/X5ULoaderCommand.php b/src/Library/Console/X5ULoaderCommand.php similarity index 94% rename from src/Component/Console/X5ULoaderCommand.php rename to src/Library/Console/X5ULoaderCommand.php index 2c6897606..2592c5ba2 100644 --- a/src/Component/Console/X5ULoaderCommand.php +++ b/src/Library/Console/X5ULoaderCommand.php @@ -5,12 +5,13 @@ namespace Jose\Component\Console; use InvalidArgumentException; -use function is_string; use Jose\Component\KeyManagement\X5UFactory; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function is_string; +#[AsCommand(name: 'keyset:load:x5u', description: 'Loads a key set from an url.',)] final class X5ULoaderCommand extends ObjectOutputCommand { protected static $defaultName = 'keyset:load:x5u'; diff --git a/src/Component/Core/Algorithm.php b/src/Library/Core/Algorithm.php similarity index 100% rename from src/Component/Core/Algorithm.php rename to src/Library/Core/Algorithm.php diff --git a/src/Component/Core/AlgorithmManager.php b/src/Library/Core/AlgorithmManager.php similarity index 88% rename from src/Component/Core/AlgorithmManager.php rename to src/Library/Core/AlgorithmManager.php index 1b353e256..147921b5e 100644 --- a/src/Component/Core/AlgorithmManager.php +++ b/src/Library/Core/AlgorithmManager.php @@ -4,11 +4,14 @@ namespace Jose\Component\Core; -use function array_key_exists; use InvalidArgumentException; +use function array_key_exists; class AlgorithmManager { + /** + * @var array + */ private array $algorithms = []; /** @@ -31,6 +34,14 @@ public function has(string $algorithm): bool return array_key_exists($algorithm, $this->algorithms); } + /** + * @return array + */ + public function all(): array + { + return $this->algorithms; + } + /** * Returns the list of names of supported algorithms. * diff --git a/src/Component/Core/AlgorithmManagerFactory.php b/src/Library/Core/AlgorithmManagerFactory.php similarity index 88% rename from src/Component/Core/AlgorithmManagerFactory.php rename to src/Library/Core/AlgorithmManagerFactory.php index a9c6b5155..3854e668f 100644 --- a/src/Component/Core/AlgorithmManagerFactory.php +++ b/src/Library/Core/AlgorithmManagerFactory.php @@ -14,6 +14,16 @@ class AlgorithmManagerFactory { private array $algorithms = []; + /** + * @param Algorithm[] $algorithms + */ + public function __construct(array $algorithms = []) + { + foreach ($algorithms as $algorithm) { + $this->add($algorithm->name(), $algorithm); + } + } + /** * Adds an algorithm. * diff --git a/src/Component/Core/JWK.php b/src/Library/Core/JWK.php similarity index 100% rename from src/Component/Core/JWK.php rename to src/Library/Core/JWK.php index 61b01ab0a..9685becf5 100644 --- a/src/Component/Core/JWK.php +++ b/src/Library/Core/JWK.php @@ -4,15 +4,15 @@ namespace Jose\Component\Core; +use InvalidArgumentException; +use JsonSerializable; +use ParagonIE\ConstantTime\Base64UrlSafe; use function array_key_exists; use function in_array; -use InvalidArgumentException; use function is_array; use const JSON_THROW_ON_ERROR; use const JSON_UNESCAPED_SLASHES; use const JSON_UNESCAPED_UNICODE; -use JsonSerializable; -use ParagonIE\ConstantTime\Base64UrlSafe; /** * @see \Jose\Tests\Component\Core\JWKTest diff --git a/src/Component/Core/JWKSet.php b/src/Library/Core/JWKSet.php similarity index 100% rename from src/Component/Core/JWKSet.php rename to src/Library/Core/JWKSet.php index b9d3472c7..87e8ca022 100644 --- a/src/Component/Core/JWKSet.php +++ b/src/Library/Core/JWKSet.php @@ -4,18 +4,18 @@ namespace Jose\Component\Core; -use function array_key_exists; use ArrayIterator; -use function count; -use const COUNT_NORMAL; use Countable; -use function in_array; use InvalidArgumentException; -use function is_array; use IteratorAggregate; -use const JSON_THROW_ON_ERROR; use JsonSerializable; use Traversable; +use function array_key_exists; +use function count; +use function in_array; +use function is_array; +use const COUNT_NORMAL; +use const JSON_THROW_ON_ERROR; class JWKSet implements Countable, IteratorAggregate, JsonSerializable { diff --git a/src/Component/Core/JWT.php b/src/Library/Core/JWT.php similarity index 100% rename from src/Component/Core/JWT.php rename to src/Library/Core/JWT.php diff --git a/src/Component/Core/Util/BigInteger.php b/src/Library/Core/Util/BigInteger.php similarity index 100% rename from src/Component/Core/Util/BigInteger.php rename to src/Library/Core/Util/BigInteger.php index 43ce62ed4..5bbea7c2a 100644 --- a/src/Component/Core/Util/BigInteger.php +++ b/src/Library/Core/Util/BigInteger.php @@ -5,8 +5,8 @@ namespace Jose\Component\Core\Util; use Brick\Math\BigInteger as BrickBigInteger; -use function chr; use InvalidArgumentException; +use function chr; /** * @internal diff --git a/src/Component/Core/Util/ECKey.php b/src/Library/Core/Util/ECKey.php similarity index 94% rename from src/Component/Core/Util/ECKey.php rename to src/Library/Core/Util/ECKey.php index 31a0bb748..6cef96876 100644 --- a/src/Component/Core/Util/ECKey.php +++ b/src/Library/Core/Util/ECKey.php @@ -4,15 +4,15 @@ namespace Jose\Component\Core\Util; -use function extension_loaded; use InvalidArgumentException; +use Jose\Component\Core\JWK; +use ParagonIE\ConstantTime\Base64UrlSafe; +use RuntimeException; +use function extension_loaded; use function is_array; use function is_string; -use Jose\Component\Core\JWK; use const OPENSSL_KEYTYPE_EC; -use ParagonIE\ConstantTime\Base64UrlSafe; use const PHP_EOL; -use RuntimeException; use const STR_PAD_LEFT; /** @@ -203,7 +203,7 @@ private static function p256PrivateKey(JWK $jwk): string if (! is_string($d)) { throw new InvalidArgumentException('Unable to get the private key'); } - $d = unpack('H*', str_pad(Base64UrlSafe::decode($d), 32, "\0", STR_PAD_LEFT)); + $d = unpack('H*', str_pad(Base64UrlSafe::decodeNoPadding($d), 32, "\0", STR_PAD_LEFT)); if (! is_array($d) || ! isset($d[1])) { throw new InvalidArgumentException('Unable to get the private key'); } @@ -229,7 +229,7 @@ private static function p256KPrivateKey(JWK $jwk): string if (! is_string($d)) { throw new InvalidArgumentException('Unable to get the private key'); } - $d = unpack('H*', str_pad(Base64UrlSafe::decode($d), 32, "\0", STR_PAD_LEFT)); + $d = unpack('H*', str_pad(Base64UrlSafe::decodeNoPadding($d), 32, "\0", STR_PAD_LEFT)); if (! is_array($d) || ! isset($d[1])) { throw new InvalidArgumentException('Unable to get the private key'); } @@ -255,7 +255,7 @@ private static function p384PrivateKey(JWK $jwk): string if (! is_string($d)) { throw new InvalidArgumentException('Unable to get the private key'); } - $d = unpack('H*', str_pad(Base64UrlSafe::decode($d), 48, "\0", STR_PAD_LEFT)); + $d = unpack('H*', str_pad(Base64UrlSafe::decodeNoPadding($d), 48, "\0", STR_PAD_LEFT)); if (! is_array($d) || ! isset($d[1])) { throw new InvalidArgumentException('Unable to get the private key'); } @@ -281,7 +281,7 @@ private static function p521PrivateKey(JWK $jwk): string if (! is_string($d)) { throw new InvalidArgumentException('Unable to get the private key'); } - $d = unpack('H*', str_pad(Base64UrlSafe::decode($d), 66, "\0", STR_PAD_LEFT)); + $d = unpack('H*', str_pad(Base64UrlSafe::decodeNoPadding($d), 66, "\0", STR_PAD_LEFT)); if (! is_array($d) || ! isset($d[1])) { throw new InvalidArgumentException('Unable to get the private key'); } @@ -317,9 +317,12 @@ private static function getKey(JWK $jwk): string if (! is_string($y)) { throw new InvalidArgumentException('Unable to get the public key'); } + $binX = ltrim(Base64UrlSafe::decodeNoPadding($x), "\0"); + $binY = ltrim(Base64UrlSafe::decodeNoPadding($y), "\0"); return "\04" - . str_pad(Base64UrlSafe::decode($x), $length, "\0", STR_PAD_LEFT) - . str_pad(Base64UrlSafe::decode($y), $length, "\0", STR_PAD_LEFT); + . str_pad($binX, $length, "\0", STR_PAD_LEFT) + . str_pad($binY, $length, "\0", STR_PAD_LEFT) + ; } } diff --git a/src/Component/Core/Util/ECSignature.php b/src/Library/Core/Util/ECSignature.php similarity index 96% rename from src/Component/Core/Util/ECSignature.php rename to src/Library/Core/Util/ECSignature.php index 1d6ac0aa3..4ca1c0c10 100644 --- a/src/Component/Core/Util/ECSignature.php +++ b/src/Library/Core/Util/ECSignature.php @@ -73,7 +73,9 @@ public static function fromAsn1(string $signature, int $length): string $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); - $bin = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT)); + $bin = hex2bin( + str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT) + ); if (! is_string($bin)) { throw new InvalidArgumentException('Unable to parse the data'); } diff --git a/src/Ecc/Curve.php b/src/Library/Core/Util/Ecc/Curve.php similarity index 100% rename from src/Ecc/Curve.php rename to src/Library/Core/Util/Ecc/Curve.php index 3e6b75cb3..59be935bf 100644 --- a/src/Ecc/Curve.php +++ b/src/Library/Core/Util/Ecc/Curve.php @@ -6,8 +6,8 @@ use Brick\Math\BigInteger; use RuntimeException; -use const STR_PAD_LEFT; use Stringable; +use const STR_PAD_LEFT; /** * @internal diff --git a/src/Ecc/EcDH.php b/src/Library/Core/Util/Ecc/EcDH.php similarity index 100% rename from src/Ecc/EcDH.php rename to src/Library/Core/Util/Ecc/EcDH.php diff --git a/src/Ecc/Math.php b/src/Library/Core/Util/Ecc/Math.php similarity index 100% rename from src/Ecc/Math.php rename to src/Library/Core/Util/Ecc/Math.php diff --git a/src/Ecc/ModularArithmetic.php b/src/Library/Core/Util/Ecc/ModularArithmetic.php similarity index 100% rename from src/Ecc/ModularArithmetic.php rename to src/Library/Core/Util/Ecc/ModularArithmetic.php diff --git a/src/Ecc/NistCurve.php b/src/Library/Core/Util/Ecc/NistCurve.php similarity index 100% rename from src/Ecc/NistCurve.php rename to src/Library/Core/Util/Ecc/NistCurve.php diff --git a/src/Ecc/Point.php b/src/Library/Core/Util/Ecc/Point.php similarity index 100% rename from src/Ecc/Point.php rename to src/Library/Core/Util/Ecc/Point.php diff --git a/src/Ecc/PrivateKey.php b/src/Library/Core/Util/Ecc/PrivateKey.php similarity index 100% rename from src/Ecc/PrivateKey.php rename to src/Library/Core/Util/Ecc/PrivateKey.php diff --git a/src/Ecc/PublicKey.php b/src/Library/Core/Util/Ecc/PublicKey.php similarity index 100% rename from src/Ecc/PublicKey.php rename to src/Library/Core/Util/Ecc/PublicKey.php diff --git a/src/Component/Core/Util/Hash.php b/src/Library/Core/Util/Hash.php similarity index 100% rename from src/Component/Core/Util/Hash.php rename to src/Library/Core/Util/Hash.php diff --git a/src/Component/Core/Util/JsonConverter.php b/src/Library/Core/Util/JsonConverter.php similarity index 51% rename from src/Component/Core/Util/JsonConverter.php rename to src/Library/Core/Util/JsonConverter.php index a401ebac3..d51c9777c 100644 --- a/src/Component/Core/Util/JsonConverter.php +++ b/src/Library/Core/Util/JsonConverter.php @@ -4,11 +4,11 @@ namespace Jose\Component\Core\Util; +use InvalidArgumentException; +use Throwable; use const JSON_THROW_ON_ERROR; use const JSON_UNESCAPED_SLASHES; use const JSON_UNESCAPED_UNICODE; -use RuntimeException; -use Throwable; final class JsonConverter { @@ -17,12 +17,21 @@ public static function encode(mixed $payload): string try { return json_encode($payload, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } catch (Throwable $throwable) { - throw new RuntimeException('Invalid content.', $throwable->getCode(), $throwable); + throw new InvalidArgumentException('Invalid content.', $throwable->getCode(), $throwable); } } public static function decode(string $payload): mixed { - return json_decode($payload, true, 512, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + try { + return json_decode( + $payload, + true, + 512, + JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + ); + } catch (Throwable $throwable) { + throw new InvalidArgumentException('Unsupported input.', $throwable->getCode(), $throwable); + } } } diff --git a/src/Component/Core/Util/KeyChecker.php b/src/Library/Core/Util/KeyChecker.php similarity index 100% rename from src/Component/Core/Util/KeyChecker.php rename to src/Library/Core/Util/KeyChecker.php index 5bacd6a2c..8e902e650 100644 --- a/src/Component/Core/Util/KeyChecker.php +++ b/src/Library/Core/Util/KeyChecker.php @@ -4,11 +4,11 @@ namespace Jose\Component\Core\Util; -use function in_array; use InvalidArgumentException; +use Jose\Component\Core\JWK; +use function in_array; use function is_array; use function is_string; -use Jose\Component\Core\JWK; /** * @internal diff --git a/src/Component/Core/Util/RSAKey.php b/src/Library/Core/Util/RSAKey.php similarity index 98% rename from src/Component/Core/Util/RSAKey.php rename to src/Library/Core/Util/RSAKey.php index 395c64811..7b47d5cc5 100644 --- a/src/Component/Core/Util/RSAKey.php +++ b/src/Library/Core/Util/RSAKey.php @@ -4,10 +4,7 @@ namespace Jose\Component\Core\Util; -use function array_key_exists; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; @@ -19,6 +16,9 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\Asymmetric\RSAEncryptionAlgorithmIdentifier; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RSA\RSAPrivateKey; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RSA\RSAPublicKey; +use function array_key_exists; +use function count; +use function is_array; /** * @internal @@ -229,12 +229,12 @@ private function populateBigIntegers(): void private function convertBase64StringToBigInteger(string $value): BigInteger { - return BigInteger::createFromBinaryString(Base64UrlSafe::decode($value)); + return BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($value)); } private function fromBase64ToInteger(string $value): string { - $unpacked = unpack('H*', Base64UrlSafe::decode($value)); + $unpacked = unpack('H*', Base64UrlSafe::decodeNoPadding($value)); if (! is_array($unpacked) || count($unpacked) === 0) { throw new InvalidArgumentException('Unable to get the private key'); } diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/A128CBCHS256.php b/src/Library/Encryption/Algorithm/ContentEncryption/A128CBCHS256.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/A128CBCHS256.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A128CBCHS256.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/A128GCM.php b/src/Library/Encryption/Algorithm/ContentEncryption/A128GCM.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/A128GCM.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A128GCM.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/A192CBCHS384.php b/src/Library/Encryption/Algorithm/ContentEncryption/A192CBCHS384.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/A192CBCHS384.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A192CBCHS384.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/A192GCM.php b/src/Library/Encryption/Algorithm/ContentEncryption/A192GCM.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/A192GCM.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A192GCM.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/A256CBCHS512.php b/src/Library/Encryption/Algorithm/ContentEncryption/A256CBCHS512.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/A256CBCHS512.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A256CBCHS512.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/A256GCM.php b/src/Library/Encryption/Algorithm/ContentEncryption/A256GCM.php similarity index 100% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/A256GCM.php rename to src/Library/Encryption/Algorithm/ContentEncryption/A256GCM.php diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBCHS.php b/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php similarity index 93% rename from src/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBCHS.php rename to src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php index 1e57d97f1..8395db17e 100644 --- a/src/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBCHS.php +++ b/src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php @@ -5,12 +5,20 @@ namespace Jose\Component\Encryption\Algorithm\ContentEncryption; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; -use const OPENSSL_RAW_DATA; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function extension_loaded; +use const OPENSSL_RAW_DATA; abstract class AESCBCHS implements ContentEncryptionAlgorithm { + public function __construct() + { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } + } + public function allowedKeyTypes(): array { return []; //Irrelevant diff --git a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCM.php b/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php similarity index 89% rename from src/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCM.php rename to src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php index 9437f9760..c939df464 100644 --- a/src/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCM.php +++ b/src/Library/Encryption/Algorithm/ContentEncryption/AESGCM.php @@ -5,12 +5,20 @@ namespace Jose\Component\Encryption\Algorithm\ContentEncryption; use Jose\Component\Encryption\Algorithm\ContentEncryptionAlgorithm; -use const OPENSSL_RAW_DATA; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function extension_loaded; +use const OPENSSL_RAW_DATA; abstract class AESGCM implements ContentEncryptionAlgorithm { + public function __construct() + { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } + } + public function allowedKeyTypes(): array { return []; //Irrelevant diff --git a/src/Component/Encryption/Algorithm/ContentEncryptionAlgorithm.php b/src/Library/Encryption/Algorithm/ContentEncryptionAlgorithm.php similarity index 100% rename from src/Component/Encryption/Algorithm/ContentEncryptionAlgorithm.php rename to src/Library/Encryption/Algorithm/ContentEncryptionAlgorithm.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A128GCMKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A128GCMKW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A128GCMKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A128GCMKW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/A128KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A128KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/A128KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A128KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A192GCMKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A192GCMKW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A192GCMKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A192GCMKW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/A192KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A192KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/A192KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A192KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A256GCMKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A256GCMKW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/A256GCMKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A256GCMKW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/A256KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/A256KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/A256KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/A256KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php similarity index 81% rename from src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php index cf17be409..82db172ca 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AESGCMKW.php @@ -4,16 +4,28 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; -use function in_array; +use AESKW\Wrapper as WrapperInterface; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; -use const OPENSSL_RAW_DATA; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function extension_loaded; +use function in_array; +use function is_string; +use const OPENSSL_RAW_DATA; abstract class AESGCMKW implements KeyWrapping { + public function __construct() + { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } + if (! interface_exists(WrapperInterface::class)) { + throw new RuntimeException('Please install "spomky-labs/aes-key-wrap" to use AES-KW algorithms'); + } + } + public function allowedKeyTypes(): array { return ['oct']; @@ -53,8 +65,8 @@ public function unwrapKey(JWK $key, string $encrypted_cek, array $completeHeader 'Parameter "tag" is missing.' ); - $tag = Base64UrlSafe::decode($completeHeader['tag']); - $iv = Base64UrlSafe::decode($completeHeader['iv']); + $tag = Base64UrlSafe::decodeNoPadding($completeHeader['tag']); + $iv = Base64UrlSafe::decodeNoPadding($completeHeader['iv']); $mode = sprintf('aes-%d-gcm', $this->getKeySize()); $cek = openssl_decrypt($encrypted_cek, $mode, $kek, OPENSSL_RAW_DATA, $iv, $tag, ''); @@ -83,7 +95,7 @@ protected function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } abstract protected function getKeySize(): int; diff --git a/src/EncryptionAlgorithm/KeyEncryption/AESKW/AESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php similarity index 85% rename from src/EncryptionAlgorithm/KeyEncryption/AESKW/AESKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php index f72b67627..909f2a1e1 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/AESKW/AESKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AESKW.php @@ -5,14 +5,22 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; use AESKW\Wrapper as WrapperInterface; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use RuntimeException; +use function in_array; +use function is_string; abstract class AESKW implements KeyWrapping { + public function __construct() + { + if (! interface_exists(WrapperInterface::class)) { + throw new RuntimeException('Please install "spomky-labs/aes-key-wrap" to use AES-KW algorithms'); + } + } + public function allowedKeyTypes(): array { return ['oct']; @@ -61,6 +69,6 @@ private function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } } diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDH.php b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php similarity index 93% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDH.php rename to src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php index 124644c4a..9027a8e74 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDH.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php @@ -4,14 +4,8 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; -use function array_key_exists; use Brick\Math\BigInteger; -use function extension_loaded; -use function function_exists; -use function in_array; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\Ecc\Curve; use Jose\Component\Core\Util\Ecc\EcDH; @@ -22,6 +16,12 @@ use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use Throwable; +use function array_key_exists; +use function extension_loaded; +use function function_exists; +use function in_array; +use function is_array; +use function is_string; abstract class AbstractECDH implements KeyAgreement { @@ -62,11 +62,6 @@ public function getAgreementKey( return ConcatKDF::generate($agreed_key, $algorithm, $encryptionKeyLength, $apu, $apv); } - public function name(): string - { - return 'ECDH-ES'; - } - public function getKeyManagementMode(): string { return self::MODE_AGREEMENT; @@ -121,6 +116,7 @@ protected function calculateAgreementKey(JWK $private_key, JWK $public_key): str return $this->convertDecToBin(EcDH::computeSharedKey($curve, $pub_key, $priv_key)); case 'X25519': + $this->checkSodiumExtensionIsAvailable(); $x = $public_key->get('x'); if (! is_string($x)) { throw new InvalidArgumentException('Invalid key parameter "x"'); @@ -129,8 +125,8 @@ protected function calculateAgreementKey(JWK $private_key, JWK $public_key): str if (! is_string($d)) { throw new InvalidArgumentException('Invalid key parameter "d"'); } - $sKey = Base64UrlSafe::decode($d); - $recipientPublickey = Base64UrlSafe::decode($x); + $sKey = Base64UrlSafe::decodeNoPadding($d); + $recipientPublickey = Base64UrlSafe::decodeNoPadding($x); return sodium_crypto_scalarmult($sKey, $recipientPublickey); @@ -155,23 +151,11 @@ protected function getKeysFromPublicKey( if (! is_string($crv)) { throw new InvalidArgumentException('Invalid key parameter "crv"'); } - switch ($crv) { - case 'P-256': - case 'P-384': - case 'P-521': - $private_key = $senderKey ?? ECKey::createECKey($crv); - - break; - - case 'X25519': - $this->checkSodiumExtensionIsAvailable(); - $private_key = $senderKey ?? $this->createOKPKey('X25519'); - - break; - - default: - throw new InvalidArgumentException(sprintf('The curve "%s" is not supported', $crv)); - } + $private_key = match ($crv) { + 'P-256', 'P-384', 'P-521' => $senderKey ?? ECKey::createECKey($crv), + 'X25519' => $senderKey ?? $this->createOKPKey('X25519'), + default => throw new InvalidArgumentException(sprintf('The curve "%s" is not supported', $crv)), + }; $epk = $private_key->toPublic() ->all(); $additional_header_values['epk'] = $epk; @@ -260,7 +244,7 @@ private function getCurve(string $crv): Curve private function convertBase64ToBigInteger(string $value): BigInteger { - $data = unpack('H*', Base64UrlSafe::decode($value)); + $data = unpack('H*', Base64UrlSafe::decodeNoPadding($value)); if (! is_array($data) || ! isset($data[1]) || ! is_string($data[1])) { throw new InvalidArgumentException('Unable to convert base64 to integer'); } diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDHAESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDHAESKW.php similarity index 53% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDHAESKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDHAESKW.php index 4f8b268d8..4aa6f0f7d 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/AbstractECDHAESKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDHAESKW.php @@ -4,12 +4,18 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; -use AESKW\A128KW; -use AESKW\A192KW; -use AESKW\A256KW; +use AESKW\Wrapper as WrapperInterface; +use RuntimeException; abstract class AbstractECDHAESKW implements KeyAgreementWithKeyWrapping { + public function __construct() + { + if (! interface_exists(WrapperInterface::class)) { + throw new RuntimeException('Please install "spomky-labs/aes-key-wrap" to use AES-KW algorithms'); + } + } + public function allowedKeyTypes(): array { return ['EC', 'OKP']; @@ -20,7 +26,7 @@ public function getKeyManagementMode(): string return self::MODE_WRAP; } - abstract protected function getWrapper(): A128KW|A192KW|A256KW; + abstract protected function getWrapper(): WrapperInterface; abstract protected function getKeyLength(): int; } diff --git a/src/EncryptionAlgorithm/KeyEncryption/Direct/Dir.php b/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php similarity index 95% rename from src/EncryptionAlgorithm/KeyEncryption/Direct/Dir.php rename to src/Library/Encryption/Algorithm/KeyEncryption/Dir.php index 6409bb003..d01ec4921 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/Direct/Dir.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/Dir.php @@ -4,11 +4,11 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use function in_array; +use function is_string; final class Dir implements DirectEncryption { @@ -25,7 +25,7 @@ public function getCEK(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } public function name(): string diff --git a/src/Component/Encryption/Algorithm/KeyEncryption/DirectEncryption.php b/src/Library/Encryption/Algorithm/KeyEncryption/DirectEncryption.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryption/DirectEncryption.php rename to src/Library/Encryption/Algorithm/KeyEncryption/DirectEncryption.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHES.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHES.php similarity index 65% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHES.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHES.php index 8cd5ae9ed..f83a300c0 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHES.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHES.php @@ -6,4 +6,8 @@ final class ECDHES extends AbstractECDH { + public function name(): string + { + return 'ECDH-ES'; + } } diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA128KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA128KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA128KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA128KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA192KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA192KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA192KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA192KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA256KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA256KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESA256KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHESA256KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESAESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHESAESKW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESAESKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHESAESKW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSS.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSS.php similarity index 93% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSS.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHSS.php index 1af2e6d0c..50b832a81 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSS.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSS.php @@ -9,6 +9,11 @@ final class ECDHSS extends AbstractECDH { + public function name(): string + { + return 'ECDH-SS'; + } + /** * @param array $complete_header * @param array $additional_header_values diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA128KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA128KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA128KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA128KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA192KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA192KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA192KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA192KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA256KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA256KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSA256KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSA256KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSAESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSAESKW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHSSAESKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/ECDHSSAESKW.php diff --git a/src/Component/Encryption/Algorithm/KeyEncryption/KeyAgreement.php b/src/Library/Encryption/Algorithm/KeyEncryption/KeyAgreement.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryption/KeyAgreement.php rename to src/Library/Encryption/Algorithm/KeyEncryption/KeyAgreement.php diff --git a/src/Component/Encryption/Algorithm/KeyEncryption/KeyAgreementWithKeyWrapping.php b/src/Library/Encryption/Algorithm/KeyEncryption/KeyAgreementWithKeyWrapping.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryption/KeyAgreementWithKeyWrapping.php rename to src/Library/Encryption/Algorithm/KeyEncryption/KeyAgreementWithKeyWrapping.php diff --git a/src/Component/Encryption/Algorithm/KeyEncryption/KeyEncryption.php b/src/Library/Encryption/Algorithm/KeyEncryption/KeyEncryption.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryption/KeyEncryption.php rename to src/Library/Encryption/Algorithm/KeyEncryption/KeyEncryption.php diff --git a/src/Component/Encryption/Algorithm/KeyEncryption/KeyWrapping.php b/src/Library/Encryption/Algorithm/KeyEncryption/KeyWrapping.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryption/KeyWrapping.php rename to src/Library/Encryption/Algorithm/KeyEncryption/KeyWrapping.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2AESKW.php b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php similarity index 93% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2AESKW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php index 1891bbb01..a8222fc65 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2AESKW.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2AESKW.php @@ -7,12 +7,14 @@ use AESKW\A128KW; use AESKW\A192KW; use AESKW\A256KW; -use function in_array; +use AESKW\Wrapper as WrapperInterface; use InvalidArgumentException; -use function is_int; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use RuntimeException; +use function in_array; +use function is_int; +use function is_string; abstract class PBES2AESKW implements KeyWrapping { @@ -20,6 +22,9 @@ public function __construct( private readonly int $salt_size = 64, private readonly int $nb_count = 4096 ) { + if (! interface_exists(WrapperInterface::class)) { + throw new RuntimeException('Please install "spomky-labs/aes-key-wrap" to use AES-KW algorithms'); + } } public function allowedKeyTypes(): array @@ -69,7 +74,7 @@ public function unwrapKey(JWK $key, string $encrypted_cek, array $completeHeader $key_size = $this->getKeySize(); $p2s = $completeHeader['p2s']; is_string($p2s) || throw new InvalidArgumentException('Invalid salt.'); - $salt = $completeHeader['alg'] . "\x00" . Base64UrlSafe::decode($p2s); + $salt = $completeHeader['alg'] . "\x00" . Base64UrlSafe::decodeNoPadding($p2s); $count = $completeHeader['p2c']; is_int($count) || throw new InvalidArgumentException('Invalid counter.'); @@ -96,7 +101,7 @@ protected function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } /** diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS256A128KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS256A128KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS256A128KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS256A128KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS384A192KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS384A192KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS384A192KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS384A192KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS512A256KW.php b/src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS512A256KW.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2HS512A256KW.php rename to src/Library/Encryption/Algorithm/KeyEncryption/PBES2HS512A256KW.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/RSA.php b/src/Library/Encryption/Algorithm/KeyEncryption/RSA.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/RSA.php rename to src/Library/Encryption/Algorithm/KeyEncryption/RSA.php index 57c48f436..1d5de916a 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/RSA/RSA.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/RSA.php @@ -4,11 +4,11 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption; -use function in_array; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\RSAKey; use Jose\Component\Encryption\Algorithm\KeyEncryption\Util\RSACrypt; +use function in_array; abstract class RSA implements KeyEncryption { diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/RSA15.php b/src/Library/Encryption/Algorithm/KeyEncryption/RSA15.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/RSA15.php rename to src/Library/Encryption/Algorithm/KeyEncryption/RSA15.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/RSAOAEP.php b/src/Library/Encryption/Algorithm/KeyEncryption/RSAOAEP.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/RSAOAEP.php rename to src/Library/Encryption/Algorithm/KeyEncryption/RSAOAEP.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/RSAOAEP256.php b/src/Library/Encryption/Algorithm/KeyEncryption/RSAOAEP256.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/RSAOAEP256.php rename to src/Library/Encryption/Algorithm/KeyEncryption/RSAOAEP256.php diff --git a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/Util/ConcatKDF.php b/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php similarity index 93% rename from src/EncryptionAlgorithm/KeyEncryption/ECDHES/Util/ConcatKDF.php rename to src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php index b7e8eba35..f753b6cc3 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/ECDHES/Util/ConcatKDF.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/Util/ConcatKDF.php @@ -31,8 +31,8 @@ public static function generate( string $apu = '', string $apv = '' ): string { - $apu = ! self::isEmpty($apu) ? Base64UrlSafe::decode($apu) : ''; - $apv = ! self::isEmpty($apv) ? Base64UrlSafe::decode($apv) : ''; + $apu = ! self::isEmpty($apu) ? Base64UrlSafe::decodeNoPadding($apu) : ''; + $apv = ! self::isEmpty($apv) ? Base64UrlSafe::decodeNoPadding($apv) : ''; $encryption_segments = [ self::toInt32Bits(1), // Round number 1 $Z, // Z (shared secret) diff --git a/src/EncryptionAlgorithm/KeyEncryption/RSA/Util/RSACrypt.php b/src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php similarity index 100% rename from src/EncryptionAlgorithm/KeyEncryption/RSA/Util/RSACrypt.php rename to src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php index c4a6bac09..e53f85aa1 100644 --- a/src/EncryptionAlgorithm/KeyEncryption/RSA/Util/RSACrypt.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php @@ -4,15 +4,15 @@ namespace Jose\Component\Encryption\Algorithm\KeyEncryption\Util; -use function chr; -use function count; use InvalidArgumentException; use Jose\Component\Core\Util\BigInteger; use Jose\Component\Core\Util\Hash; use Jose\Component\Core\Util\RSAKey; use LogicException; -use function ord; use RuntimeException; +use function chr; +use function count; +use function ord; use const STR_PAD_LEFT; /** diff --git a/src/Component/Encryption/Algorithm/KeyEncryptionAlgorithm.php b/src/Library/Encryption/Algorithm/KeyEncryptionAlgorithm.php similarity index 100% rename from src/Component/Encryption/Algorithm/KeyEncryptionAlgorithm.php rename to src/Library/Encryption/Algorithm/KeyEncryptionAlgorithm.php diff --git a/src/Component/Encryption/Compression/CompressionMethod.php b/src/Library/Encryption/Compression/CompressionMethod.php similarity index 100% rename from src/Component/Encryption/Compression/CompressionMethod.php rename to src/Library/Encryption/Compression/CompressionMethod.php diff --git a/src/Component/Encryption/Compression/CompressionMethodManager.php b/src/Library/Encryption/Compression/CompressionMethodManager.php similarity index 100% rename from src/Component/Encryption/Compression/CompressionMethodManager.php rename to src/Library/Encryption/Compression/CompressionMethodManager.php index a73b7589b..8a51e6a6b 100644 --- a/src/Component/Encryption/Compression/CompressionMethodManager.php +++ b/src/Library/Encryption/Compression/CompressionMethodManager.php @@ -4,8 +4,8 @@ namespace Jose\Component\Encryption\Compression; -use function array_key_exists; use InvalidArgumentException; +use function array_key_exists; class CompressionMethodManager { diff --git a/src/Component/Encryption/Compression/CompressionMethodManagerFactory.php b/src/Library/Encryption/Compression/CompressionMethodManagerFactory.php similarity index 100% rename from src/Component/Encryption/Compression/CompressionMethodManagerFactory.php rename to src/Library/Encryption/Compression/CompressionMethodManagerFactory.php diff --git a/src/Component/Encryption/Compression/Deflate.php b/src/Library/Encryption/Compression/Deflate.php similarity index 100% rename from src/Component/Encryption/Compression/Deflate.php rename to src/Library/Encryption/Compression/Deflate.php index 963c9b0fb..3f8796851 100644 --- a/src/Component/Encryption/Compression/Deflate.php +++ b/src/Library/Encryption/Compression/Deflate.php @@ -5,8 +5,8 @@ namespace Jose\Component\Encryption\Compression; use InvalidArgumentException; -use function is_string; use Throwable; +use function is_string; final class Deflate implements CompressionMethod { diff --git a/src/Component/Encryption/JWE.php b/src/Library/Encryption/JWE.php similarity index 99% rename from src/Component/Encryption/JWE.php rename to src/Library/Encryption/JWE.php index ef1ced795..199085cd9 100644 --- a/src/Component/Encryption/JWE.php +++ b/src/Library/Encryption/JWE.php @@ -4,10 +4,10 @@ namespace Jose\Component\Encryption; -use function array_key_exists; -use function count; use InvalidArgumentException; use Jose\Component\Core\JWT; +use function array_key_exists; +use function count; class JWE implements JWT { @@ -82,7 +82,7 @@ public function getRecipient(int $id): Recipient /** * Returns the ciphertext. This method will return null is the JWE has not yet been encrypted. * - * @return string|null The cyphertext + * @return string|null The ciphertext */ public function getCiphertext(): ?string { diff --git a/src/Component/Encryption/JWEBuilder.php b/src/Library/Encryption/JWEBuilder.php similarity index 92% rename from src/Component/Encryption/JWEBuilder.php rename to src/Library/Encryption/JWEBuilder.php index 609cf94b2..73827c9c5 100644 --- a/src/Component/Encryption/JWEBuilder.php +++ b/src/Library/Encryption/JWEBuilder.php @@ -4,10 +4,7 @@ namespace Jose\Component\Encryption; -use function array_key_exists; -use function count; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; @@ -24,6 +21,9 @@ use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function array_key_exists; +use function count; +use function is_string; class JWEBuilder { @@ -45,11 +45,37 @@ class JWEBuilder private ?ContentEncryptionAlgorithm $contentEncryptionAlgorithm = null; + private readonly AlgorithmManager $keyEncryptionAlgorithmManager; + + private readonly AlgorithmManager $contentEncryptionAlgorithmManager; + public function __construct( - private readonly AlgorithmManager $keyEncryptionAlgorithmManager, - private readonly AlgorithmManager $contentEncryptionAlgorithmManager, + AlgorithmManager $algorithmManager, + null|AlgorithmManager $contentEncryptionAlgorithmManager, private readonly CompressionMethodManager $compressionManager ) { + if ($contentEncryptionAlgorithmManager !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$contentEncryptionAlgorithmManager" is deprecated and will be removed in 4.0.0. Please set all algorithms in the first argument and set "null" instead.' + ); + $this->keyEncryptionAlgorithmManager = $algorithmManager; + $this->contentEncryptionAlgorithmManager = $contentEncryptionAlgorithmManager; + } else { + $keyEncryptionAlgorithms = []; + $contentEncryptionAlgorithms = []; + foreach ($algorithmManager->all() as $algorithm) { + if ($algorithm instanceof KeyEncryptionAlgorithm) { + $keyEncryptionAlgorithms[] = $algorithm; + } + if ($algorithm instanceof ContentEncryptionAlgorithm) { + $contentEncryptionAlgorithms[] = $algorithm; + } + } + $this->keyEncryptionAlgorithmManager = new AlgorithmManager($keyEncryptionAlgorithms); + $this->contentEncryptionAlgorithmManager = new AlgorithmManager($contentEncryptionAlgorithms); + } } /** @@ -191,7 +217,7 @@ public function addRecipient(JWK $recipientKey, array $recipientHeader = []): se return $clone; } - //TODO: Verify if the key is compatible with the key encrytion algorithm like is done to the ECDH-ES + //TODO: Verify if the key is compatible with the key encryption algorithm like is done to the ECDH-ES /** * Set the sender JWK to be used instead of the internal generated JWK */ @@ -315,9 +341,6 @@ private function encryptJWE(string $cek, string $encodedSharedProtectedHeader): return [$ciphertext, $iv, $tag]; } - /** - * @return string - */ private function preparePayload(): ?string { $prepared = $this->payload; @@ -484,7 +507,7 @@ private function determineCEK(array &$additionalHeader): string throw new RuntimeException('Invalid key.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); default: throw new InvalidArgumentException(sprintf( diff --git a/src/Component/Encryption/JWEBuilderFactory.php b/src/Library/Encryption/JWEBuilderFactory.php similarity index 100% rename from src/Component/Encryption/JWEBuilderFactory.php rename to src/Library/Encryption/JWEBuilderFactory.php diff --git a/src/Component/Encryption/JWEDecrypter.php b/src/Library/Encryption/JWEDecrypter.php similarity index 87% rename from src/Component/Encryption/JWEDecrypter.php rename to src/Library/Encryption/JWEDecrypter.php index 8ba11c23d..e688112ef 100644 --- a/src/Component/Encryption/JWEDecrypter.php +++ b/src/Library/Encryption/JWEDecrypter.php @@ -4,9 +4,7 @@ namespace Jose\Component\Encryption; -use function array_key_exists; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\Algorithm; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -21,14 +19,42 @@ use Jose\Component\Encryption\Algorithm\KeyEncryptionAlgorithm; use Jose\Component\Encryption\Compression\CompressionMethodManager; use Throwable; +use function array_key_exists; +use function is_string; class JWEDecrypter { + private readonly AlgorithmManager $keyEncryptionAlgorithmManager; + + private readonly AlgorithmManager $contentEncryptionAlgorithmManager; + public function __construct( - private readonly AlgorithmManager $keyEncryptionAlgorithmManager, - private readonly AlgorithmManager $contentEncryptionAlgorithmManager, + AlgorithmManager $algorithmManager, + null|AlgorithmManager $contentEncryptionAlgorithmManager, private readonly CompressionMethodManager $compressionMethodManager ) { + if ($contentEncryptionAlgorithmManager !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$contentEncryptionAlgorithmManager" is deprecated and will be removed in 4.0.0. Please set all algorithms in the first argument and set "null" instead.' + ); + $this->keyEncryptionAlgorithmManager = $algorithmManager; + $this->contentEncryptionAlgorithmManager = $contentEncryptionAlgorithmManager; + } else { + $keyEncryptionAlgorithms = []; + $contentEncryptionAlgorithms = []; + foreach ($algorithmManager->all() as $key => $algorithm) { + if ($algorithm instanceof KeyEncryptionAlgorithm) { + $keyEncryptionAlgorithms[$key] = $algorithm; + } + if ($algorithm instanceof ContentEncryptionAlgorithm) { + $contentEncryptionAlgorithms[$key] = $algorithm; + } + } + $this->keyEncryptionAlgorithmManager = new AlgorithmManager($keyEncryptionAlgorithms); + $this->contentEncryptionAlgorithmManager = new AlgorithmManager($contentEncryptionAlgorithms); + } } /** diff --git a/src/Component/Encryption/JWEDecrypterFactory.php b/src/Library/Encryption/JWEDecrypterFactory.php similarity index 72% rename from src/Component/Encryption/JWEDecrypterFactory.php rename to src/Library/Encryption/JWEDecrypterFactory.php index 074b756f0..a61ef3bae 100644 --- a/src/Component/Encryption/JWEDecrypterFactory.php +++ b/src/Library/Encryption/JWEDecrypterFactory.php @@ -28,14 +28,11 @@ public function create( array $contentEncryptionAlgorithms, array $compressionMethods ): JWEDecrypter { - $keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms); - $contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($contentEncryptionAlgorithms); + $algorithmManager = $this->algorithmManagerFactory->create( + array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms) + ); $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); - return new JWEDecrypter( - $keyEncryptionAlgorithmManager, - $contentEncryptionAlgorithmManager, - $compressionMethodManager - ); + return new JWEDecrypter($algorithmManager, null, $compressionMethodManager); } } diff --git a/src/Component/Encryption/JWELoader.php b/src/Library/Encryption/JWELoader.php similarity index 97% rename from src/Component/Encryption/JWELoader.php rename to src/Library/Encryption/JWELoader.php index 9a6647fb7..c3b261581 100644 --- a/src/Component/Encryption/JWELoader.php +++ b/src/Library/Encryption/JWELoader.php @@ -11,6 +11,9 @@ use RuntimeException; use Throwable; +/** + * @see \Jose\Tests\Component\Encryption\JWELoaderTest + */ class JWELoader { public function __construct( diff --git a/src/Component/Encryption/JWELoaderFactory.php b/src/Library/Encryption/JWELoaderFactory.php similarity index 100% rename from src/Component/Encryption/JWELoaderFactory.php rename to src/Library/Encryption/JWELoaderFactory.php diff --git a/src/Component/Encryption/JWETokenSupport.php b/src/Library/Encryption/JWETokenSupport.php similarity index 100% rename from src/Component/Encryption/JWETokenSupport.php rename to src/Library/Encryption/JWETokenSupport.php diff --git a/src/Component/Encryption/Recipient.php b/src/Library/Encryption/Recipient.php similarity index 100% rename from src/Component/Encryption/Recipient.php rename to src/Library/Encryption/Recipient.php index 6e06b7279..37502e130 100644 --- a/src/Component/Encryption/Recipient.php +++ b/src/Library/Encryption/Recipient.php @@ -4,8 +4,8 @@ namespace Jose\Component\Encryption; -use function array_key_exists; use InvalidArgumentException; +use function array_key_exists; /** * @internal diff --git a/src/Component/Encryption/Serializer/CompactSerializer.php b/src/Library/Encryption/Serializer/CompactSerializer.php similarity index 89% rename from src/Component/Encryption/Serializer/CompactSerializer.php rename to src/Library/Encryption/Serializer/CompactSerializer.php index 9e1bf9833..ba015e8a1 100644 --- a/src/Component/Encryption/Serializer/CompactSerializer.php +++ b/src/Library/Encryption/Serializer/CompactSerializer.php @@ -4,15 +4,15 @@ namespace Jose\Component\Encryption\Serializer; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; +use function count; +use function is_array; final class CompactSerializer implements JWESerializer { @@ -58,14 +58,16 @@ public function unserialize(string $input): JWE try { $encodedSharedProtectedHeader = $parts[0]; - $sharedProtectedHeader = JsonConverter::decode(Base64UrlSafe::decode($encodedSharedProtectedHeader)); + $sharedProtectedHeader = JsonConverter::decode( + Base64UrlSafe::decodeNoPadding($encodedSharedProtectedHeader) + ); if (! is_array($sharedProtectedHeader)) { throw new InvalidArgumentException('Unsupported input.'); } - $encryptedKey = $parts[1] === '' ? null : Base64UrlSafe::decode($parts[1]); - $iv = Base64UrlSafe::decode($parts[2]); - $ciphertext = Base64UrlSafe::decode($parts[3]); - $tag = Base64UrlSafe::decode($parts[4]); + $encryptedKey = $parts[1] === '' ? null : Base64UrlSafe::decodeNoPadding($parts[1]); + $iv = Base64UrlSafe::decodeNoPadding($parts[2]); + $ciphertext = Base64UrlSafe::decodeNoPadding($parts[3]); + $tag = Base64UrlSafe::decodeNoPadding($parts[4]); return new JWE( $ciphertext, diff --git a/src/Component/Encryption/Serializer/JSONFlattenedSerializer.php b/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php similarity index 89% rename from src/Component/Encryption/Serializer/JSONFlattenedSerializer.php rename to src/Library/Encryption/Serializer/JSONFlattenedSerializer.php index 353692acb..6ecf28e3e 100644 --- a/src/Component/Encryption/Serializer/JSONFlattenedSerializer.php +++ b/src/Library/Encryption/Serializer/JSONFlattenedSerializer.php @@ -4,14 +4,14 @@ namespace Jose\Component\Encryption\Serializer; -use function array_key_exists; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; use ParagonIE\ConstantTime\Base64UrlSafe; +use function array_key_exists; +use function count; +use function is_array; final class JSONFlattenedSerializer implements JWESerializer { @@ -65,12 +65,14 @@ public function unserialize(string $input): JWE } $this->checkData($data); - $ciphertext = Base64UrlSafe::decode($data['ciphertext']); - $iv = Base64UrlSafe::decode($data['iv']); - $tag = Base64UrlSafe::decode($data['tag']); - $aad = array_key_exists('aad', $data) ? Base64UrlSafe::decode($data['aad']) : null; + $ciphertext = Base64UrlSafe::decodeNoPadding($data['ciphertext']); + $iv = Base64UrlSafe::decodeNoPadding($data['iv']); + $tag = Base64UrlSafe::decodeNoPadding($data['tag']); + $aad = array_key_exists('aad', $data) ? Base64UrlSafe::decodeNoPadding($data['aad']) : null; [$encodedSharedProtectedHeader, $sharedProtectedHeader, $sharedHeader] = $this->processHeaders($data); - $encryptedKey = array_key_exists('encrypted_key', $data) ? Base64UrlSafe::decode($data['encrypted_key']) : null; + $encryptedKey = array_key_exists('encrypted_key', $data) ? Base64UrlSafe::decodeNoPadding( + $data['encrypted_key'] + ) : null; $header = array_key_exists('header', $data) ? $data['header'] : []; return new JWE( @@ -96,7 +98,7 @@ private function processHeaders(array $data): array { $encodedSharedProtectedHeader = array_key_exists('protected', $data) ? $data['protected'] : null; $sharedProtectedHeader = $encodedSharedProtectedHeader ? JsonConverter::decode( - Base64UrlSafe::decode($encodedSharedProtectedHeader) + Base64UrlSafe::decodeNoPadding($encodedSharedProtectedHeader) ) : []; $sharedHeader = $data['unprotected'] ?? []; diff --git a/src/Component/Encryption/Serializer/JSONGeneralSerializer.php b/src/Library/Encryption/Serializer/JSONGeneralSerializer.php similarity index 91% rename from src/Component/Encryption/Serializer/JSONGeneralSerializer.php rename to src/Library/Encryption/Serializer/JSONGeneralSerializer.php index 0449a72c2..96f23dc0a 100644 --- a/src/Component/Encryption/Serializer/JSONGeneralSerializer.php +++ b/src/Library/Encryption/Serializer/JSONGeneralSerializer.php @@ -4,15 +4,15 @@ namespace Jose\Component\Encryption\Serializer; -use function array_key_exists; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\Recipient; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; +use function array_key_exists; +use function count; +use function is_array; final class JSONGeneralSerializer implements JWESerializer { @@ -71,10 +71,10 @@ public function unserialize(string $input): JWE } $this->checkData($data); - $ciphertext = Base64UrlSafe::decode($data['ciphertext']); - $iv = Base64UrlSafe::decode($data['iv']); - $tag = Base64UrlSafe::decode($data['tag']); - $aad = array_key_exists('aad', $data) ? Base64UrlSafe::decode($data['aad']) : null; + $ciphertext = Base64UrlSafe::decodeNoPadding($data['ciphertext']); + $iv = Base64UrlSafe::decodeNoPadding($data['iv']); + $tag = Base64UrlSafe::decodeNoPadding($data['tag']); + $aad = array_key_exists('aad', $data) ? Base64UrlSafe::decodeNoPadding($data['aad']) : null; [$encodedSharedProtectedHeader, $sharedProtectedHeader, $sharedHeader] = $this->processHeaders($data); $recipients = []; foreach ($data['recipients'] as $recipient) { @@ -103,7 +103,7 @@ private function checkData(?array $data): void private function processRecipient(array $recipient): array { - $encryptedKey = array_key_exists('encrypted_key', $recipient) ? Base64UrlSafe::decode( + $encryptedKey = array_key_exists('encrypted_key', $recipient) ? Base64UrlSafe::decodeNoPadding( $recipient['encrypted_key'] ) : null; $header = array_key_exists('header', $recipient) ? $recipient['header'] : []; @@ -115,7 +115,7 @@ private function processHeaders(array $data): array { $encodedSharedProtectedHeader = array_key_exists('protected', $data) ? $data['protected'] : null; $sharedProtectedHeader = $encodedSharedProtectedHeader ? JsonConverter::decode( - Base64UrlSafe::decode($encodedSharedProtectedHeader) + Base64UrlSafe::decodeNoPadding($encodedSharedProtectedHeader) ) : []; $sharedHeader = array_key_exists('unprotected', $data) ? $data['unprotected'] : []; diff --git a/src/Component/Encryption/Serializer/JWESerializer.php b/src/Library/Encryption/Serializer/JWESerializer.php similarity index 100% rename from src/Component/Encryption/Serializer/JWESerializer.php rename to src/Library/Encryption/Serializer/JWESerializer.php diff --git a/src/Component/Encryption/Serializer/JWESerializerManager.php b/src/Library/Encryption/Serializer/JWESerializerManager.php similarity index 100% rename from src/Component/Encryption/Serializer/JWESerializerManager.php rename to src/Library/Encryption/Serializer/JWESerializerManager.php diff --git a/src/Component/Encryption/Serializer/JWESerializerManagerFactory.php b/src/Library/Encryption/Serializer/JWESerializerManagerFactory.php similarity index 100% rename from src/Component/Encryption/Serializer/JWESerializerManagerFactory.php rename to src/Library/Encryption/Serializer/JWESerializerManagerFactory.php diff --git a/src/Component/KeyManagement/Analyzer/AlgorithmAnalyzer.php b/src/Library/KeyManagement/Analyzer/AlgorithmAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/AlgorithmAnalyzer.php rename to src/Library/KeyManagement/Analyzer/AlgorithmAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/ES256KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ES256KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/ES256KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/ES256KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/ES384KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ES384KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/ES384KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/ES384KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/ES512KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ES512KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/ES512KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/ES512KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/ESKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php similarity index 84% rename from src/Component/KeyManagement/Analyzer/ESKeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php index 4044a093d..2c0038618 100644 --- a/src/Component/KeyManagement/Analyzer/ESKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/ESKeyAnalyzer.php @@ -5,22 +5,13 @@ namespace Jose\Component\KeyManagement\Analyzer; use Brick\Math\BigInteger; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\Ecc\Curve; -use Jose\Component\Core\Util\Ecc\NistCurve; use ParagonIE\ConstantTime\Base64UrlSafe; -use RuntimeException; +use function is_string; abstract class ESKeyAnalyzer implements KeyAnalyzer { - public function __construct() - { - if (! class_exists(NistCurve::class)) { - throw new RuntimeException('Please install web-token/jwt-util-ecc to use this key analyzer'); - } - } - public function analyze(JWK $jwk, MessageBag $bag): void { if ($jwk->get('kty') !== 'EC') { @@ -40,7 +31,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void return; } - $x = Base64UrlSafe::decode($x); + $x = Base64UrlSafe::decodeNoPadding($x); $xLength = 8 * mb_strlen($x, '8bit'); $y = $jwk->get('y'); if (! is_string($y)) { @@ -48,7 +39,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void return; } - $y = Base64UrlSafe::decode($y); + $y = Base64UrlSafe::decodeNoPadding($y); $yLength = 8 * mb_strlen($y, '8bit'); if ($yLength !== $xLength || $yLength !== $this->getKeySize()) { $bag->add( diff --git a/src/Component/KeyManagement/Analyzer/HS256KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/HS256KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/HS256KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/HS256KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/HS384KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/HS384KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/HS384KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/HS384KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/HS512KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/HS512KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/HS512KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/HS512KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/HSKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php similarity index 95% rename from src/Component/KeyManagement/Analyzer/HSKeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php index 1116fc15f..0e283a5a0 100644 --- a/src/Component/KeyManagement/Analyzer/HSKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/HSKeyAnalyzer.php @@ -4,9 +4,9 @@ namespace Jose\Component\KeyManagement\Analyzer; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use function is_string; abstract class HSKeyAnalyzer implements KeyAnalyzer { @@ -24,7 +24,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void return; } - $k = Base64UrlSafe::decode($k); + $k = Base64UrlSafe::decodeNoPadding($k); $kLength = 8 * mb_strlen($k, '8bit'); if ($kLength < $this->getMinimumKeySize()) { $bag->add( diff --git a/src/Component/KeyManagement/Analyzer/KeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/KeyAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/KeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/KeyAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/KeyAnalyzerManager.php b/src/Library/KeyManagement/Analyzer/KeyAnalyzerManager.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/KeyAnalyzerManager.php rename to src/Library/KeyManagement/Analyzer/KeyAnalyzerManager.php diff --git a/src/Component/KeyManagement/Analyzer/KeyIdentifierAnalyzer.php b/src/Library/KeyManagement/Analyzer/KeyIdentifierAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/KeyIdentifierAnalyzer.php rename to src/Library/KeyManagement/Analyzer/KeyIdentifierAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/KeysetAnalyzer.php b/src/Library/KeyManagement/Analyzer/KeysetAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/KeysetAnalyzer.php rename to src/Library/KeyManagement/Analyzer/KeysetAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/KeysetAnalyzerManager.php b/src/Library/KeyManagement/Analyzer/KeysetAnalyzerManager.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/KeysetAnalyzerManager.php rename to src/Library/KeyManagement/Analyzer/KeysetAnalyzerManager.php diff --git a/src/Component/KeyManagement/Analyzer/Message.php b/src/Library/KeyManagement/Analyzer/Message.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/Message.php rename to src/Library/KeyManagement/Analyzer/Message.php diff --git a/src/Component/KeyManagement/Analyzer/MessageBag.php b/src/Library/KeyManagement/Analyzer/MessageBag.php similarity index 89% rename from src/Component/KeyManagement/Analyzer/MessageBag.php rename to src/Library/KeyManagement/Analyzer/MessageBag.php index 3a5b8c86f..453fcd285 100644 --- a/src/Component/KeyManagement/Analyzer/MessageBag.php +++ b/src/Library/KeyManagement/Analyzer/MessageBag.php @@ -5,11 +5,11 @@ namespace Jose\Component\KeyManagement\Analyzer; use ArrayIterator; -use function count; use Countable; use IteratorAggregate; use JsonSerializable; use Traversable; +use function count; class MessageBag implements JsonSerializable, IteratorAggregate, Countable { @@ -36,25 +36,16 @@ public function all(): array return $this->messages; } - /** - * {@inheritdoc} - */ public function jsonSerialize(): array { return array_values($this->messages); } - /** - * {@inheritdoc} - */ public function count(): int { return count($this->messages); } - /** - * {@inheritdoc} - */ public function getIterator(): Traversable { return new ArrayIterator($this->messages); diff --git a/src/Component/KeyManagement/Analyzer/MixedKeyTypes.php b/src/Library/KeyManagement/Analyzer/MixedKeyTypes.php similarity index 96% rename from src/Component/KeyManagement/Analyzer/MixedKeyTypes.php rename to src/Library/KeyManagement/Analyzer/MixedKeyTypes.php index 812e7c87a..5c473348b 100644 --- a/src/Component/KeyManagement/Analyzer/MixedKeyTypes.php +++ b/src/Library/KeyManagement/Analyzer/MixedKeyTypes.php @@ -34,7 +34,7 @@ public function analyze(JWKSet $jwkset, MessageBag $bag): void } if ($hasAsymmetricKeys && $hasSymmetricKeys) { - $bag->add(Message::medium('This key set mixes symmetric and assymetric keys.')); + $bag->add(Message::medium('This key set mixes symmetric and asymmetric keys.')); } } } diff --git a/src/Component/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php b/src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php rename to src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php diff --git a/src/Component/KeyManagement/Analyzer/NoneAnalyzer.php b/src/Library/KeyManagement/Analyzer/NoneAnalyzer.php similarity index 100% rename from src/Component/KeyManagement/Analyzer/NoneAnalyzer.php rename to src/Library/KeyManagement/Analyzer/NoneAnalyzer.php diff --git a/src/Component/KeyManagement/Analyzer/OctAnalyzer.php b/src/Library/KeyManagement/Analyzer/OctAnalyzer.php similarity index 93% rename from src/Component/KeyManagement/Analyzer/OctAnalyzer.php rename to src/Library/KeyManagement/Analyzer/OctAnalyzer.php index 9f866341e..240517933 100644 --- a/src/Component/KeyManagement/Analyzer/OctAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/OctAnalyzer.php @@ -4,9 +4,9 @@ namespace Jose\Component\KeyManagement\Analyzer; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use function is_string; final class OctAnalyzer implements KeyAnalyzer { @@ -21,7 +21,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void return; } - $k = Base64UrlSafe::decode($k); + $k = Base64UrlSafe::decodeNoPadding($k); $kLength = 8 * mb_strlen($k, '8bit'); if ($kLength < 128) { $bag->add(Message::high('The key length is less than 128 bits.')); diff --git a/src/Component/KeyManagement/Analyzer/RsaAnalyzer.php b/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php similarity index 92% rename from src/Component/KeyManagement/Analyzer/RsaAnalyzer.php rename to src/Library/KeyManagement/Analyzer/RsaAnalyzer.php index 34c3a3969..43f0b1f58 100644 --- a/src/Component/KeyManagement/Analyzer/RsaAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/RsaAnalyzer.php @@ -5,10 +5,10 @@ namespace Jose\Component\KeyManagement\Analyzer; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use function is_array; +use function is_string; final class RsaAnalyzer implements KeyAnalyzer { @@ -30,7 +30,7 @@ private function checkExponent(JWK $jwk, MessageBag $bag): void return; } - $exponent = unpack('l', str_pad(Base64UrlSafe::decode($e), 4, "\0")); + $exponent = unpack('l', str_pad(Base64UrlSafe::decodeNoPadding($e), 4, "\0")); if (! is_array($exponent) || ! isset($exponent[1])) { throw new InvalidArgumentException('Unable to get the private key'); } @@ -47,7 +47,7 @@ private function checkModulus(JWK $jwk, MessageBag $bag): void return; } - $n = 8 * mb_strlen(Base64UrlSafe::decode($n), '8bit'); + $n = 8 * mb_strlen(Base64UrlSafe::decodeNoPadding($n), '8bit'); if ($n < 2048) { $bag->add(Message::high('The key length is less than 2048 bits.')); } diff --git a/src/Component/KeyManagement/Analyzer/UsageAnalyzer.php b/src/Library/KeyManagement/Analyzer/UsageAnalyzer.php similarity index 92% rename from src/Component/KeyManagement/Analyzer/UsageAnalyzer.php rename to src/Library/KeyManagement/Analyzer/UsageAnalyzer.php index 323d93b0c..e30ae9638 100644 --- a/src/Component/KeyManagement/Analyzer/UsageAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/UsageAnalyzer.php @@ -4,8 +4,8 @@ namespace Jose\Component\KeyManagement\Analyzer; -use function in_array; use Jose\Component\Core\JWK; +use function in_array; final class UsageAnalyzer implements KeyAnalyzer { @@ -30,7 +30,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void Message::high(sprintf( 'The parameter "key_ops" has an unsupported value "%s". Please use one of the following values: %s.', $jwk->get('key_ops'), - implode(', ', ['verify', 'sign', 'encryp', 'decrypt', 'wrapKey', 'unwrapKey']) + implode(', ', ['verify', 'sign', 'encrypt', 'decrypt', 'wrapKey', 'unwrapKey']) )) ); } diff --git a/src/Component/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php b/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php similarity index 96% rename from src/Component/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php rename to src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php index fbdfa9b13..2f5ccb9ab 100644 --- a/src/Component/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php +++ b/src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php @@ -4,11 +4,11 @@ namespace Jose\Component\KeyManagement\Analyzer; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; use ZxcvbnPhp\Zxcvbn; +use function is_string; final class ZxcvbnKeyAnalyzer implements KeyAnalyzer { @@ -23,7 +23,7 @@ public function analyze(JWK $jwk, MessageBag $bag): void return; } - $k = Base64UrlSafe::decode($k); + $k = Base64UrlSafe::decodeNoPadding($k); if (! class_exists(Zxcvbn::class)) { return; } diff --git a/src/Component/KeyManagement/JKUFactory.php b/src/Library/KeyManagement/JKUFactory.php similarity index 100% rename from src/Component/KeyManagement/JKUFactory.php rename to src/Library/KeyManagement/JKUFactory.php index 28f7564e9..745232045 100644 --- a/src/Component/KeyManagement/JKUFactory.php +++ b/src/Library/KeyManagement/JKUFactory.php @@ -4,10 +4,10 @@ namespace Jose\Component\KeyManagement; -use function is_array; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; use RuntimeException; +use function is_array; class JKUFactory extends UrlKeySetFactory { diff --git a/src/Component/KeyManagement/JWKFactory.php b/src/Library/KeyManagement/JWKFactory.php similarity index 97% rename from src/Component/KeyManagement/JWKFactory.php rename to src/Library/KeyManagement/JWKFactory.php index fe3108103..bf42b0277 100644 --- a/src/Component/KeyManagement/JWKFactory.php +++ b/src/Library/KeyManagement/JWKFactory.php @@ -4,22 +4,22 @@ namespace Jose\Component\KeyManagement; -use function array_key_exists; -use function extension_loaded; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\ECKey; use Jose\Component\KeyManagement\KeyConverter\KeyConverter; use Jose\Component\KeyManagement\KeyConverter\RSAKey; -use const JSON_THROW_ON_ERROR; -use const OPENSSL_KEYTYPE_RSA; use OpenSSLCertificate; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; use Throwable; +use function array_key_exists; +use function extension_loaded; +use function is_array; +use function is_string; +use const JSON_THROW_ON_ERROR; +use const OPENSSL_KEYTYPE_RSA; /** * @see \Jose\Tests\Component\KeyManagement\JWKFactoryTest @@ -34,6 +34,9 @@ class JWKFactory */ public static function createRSAKey(int $size, array $values = []): JWK { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } if ($size % 8 !== 0) { throw new InvalidArgumentException('Invalid key size.'); } @@ -80,13 +83,8 @@ public static function createOctKey(int $size, array $values = []): JWK if ($size % 8 !== 0) { throw new InvalidArgumentException('Invalid key size.'); } - $values = [ - ...$values, - 'kty' => 'oct', - 'k' => Base64UrlSafe::encodeUnpadded(random_bytes($size / 8)), - ]; - return new JWK($values); + return self::createFromSecret(random_bytes($size / 8), $values); } /** diff --git a/src/Component/KeyManagement/KeyConverter/ECKey.php b/src/Library/KeyManagement/KeyConverter/ECKey.php similarity index 100% rename from src/Component/KeyManagement/KeyConverter/ECKey.php rename to src/Library/KeyManagement/KeyConverter/ECKey.php index cac0832c9..8ee1bfad4 100644 --- a/src/Component/KeyManagement/KeyConverter/ECKey.php +++ b/src/Library/KeyManagement/KeyConverter/ECKey.php @@ -4,14 +4,14 @@ namespace Jose\Component\KeyManagement\KeyConverter; -use function array_key_exists; use InvalidArgumentException; -use function is_string; use ParagonIE\ConstantTime\Base64UrlSafe; use SpomkyLabs\Pki\CryptoEncoding\PEM; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\EC\ECPrivateKey; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\EC\ECPublicKey; use Throwable; +use function array_key_exists; +use function is_string; /** * @internal diff --git a/src/Component/KeyManagement/KeyConverter/KeyConverter.php b/src/Library/KeyManagement/KeyConverter/KeyConverter.php similarity index 91% rename from src/Component/KeyManagement/KeyConverter/KeyConverter.php rename to src/Library/KeyManagement/KeyConverter/KeyConverter.php index 2de389c3d..82442bb7d 100644 --- a/src/Component/KeyManagement/KeyConverter/KeyConverter.php +++ b/src/Library/KeyManagement/KeyConverter/KeyConverter.php @@ -4,25 +4,29 @@ namespace Jose\Component\KeyManagement\KeyConverter; +use InvalidArgumentException; +use OpenSSLCertificate; +use ParagonIE\ConstantTime\Base64UrlSafe; +use ParagonIE\Sodium\Core\Ed25519; +use RuntimeException; +use SpomkyLabs\Pki\CryptoEncoding\PEM; +use SpomkyLabs\Pki\CryptoTypes\Asymmetric\PrivateKey; +use SpomkyLabs\Pki\CryptoTypes\Asymmetric\PublicKey; +use Throwable; use function array_key_exists; +use function assert; use function count; use function extension_loaded; use function in_array; -use InvalidArgumentException; use function is_array; use function is_string; +use const E_ERROR; +use const E_PARSE; use const OPENSSL_KEYTYPE_EC; use const OPENSSL_KEYTYPE_RSA; use const OPENSSL_RAW_DATA; -use OpenSSLCertificate; -use ParagonIE\ConstantTime\Base64UrlSafe; use const PHP_EOL; use const PREG_PATTERN_ORDER; -use RuntimeException; -use SpomkyLabs\Pki\CryptoEncoding\PEM; -use SpomkyLabs\Pki\CryptoTypes\Asymmetric\PrivateKey; -use SpomkyLabs\Pki\CryptoTypes\Asymmetric\PublicKey; -use Throwable; /** * @internal @@ -48,6 +52,7 @@ public static function loadKeyFromCertificate(string $certificate): array throw new RuntimeException('Please install the OpenSSL extension'); } + $errorReporting = error_reporting(E_ERROR | E_PARSE); try { $res = openssl_x509_read($certificate); if ($res === false) { @@ -56,6 +61,8 @@ public static function loadKeyFromCertificate(string $certificate): array } catch (Throwable) { $certificate = self::convertDerToPem($certificate); $res = openssl_x509_read($certificate); + } finally { + error_reporting($errorReporting); } if ($res === false) { throw new InvalidArgumentException('Unable to load the certificate.'); @@ -81,7 +88,7 @@ public static function loadKeyFromX509Resource(OpenSSLCertificate $res): array $values = self::loadKeyFromPEM($details['key']); openssl_x509_export($res, $out); $x5c = preg_replace('#-.*-#', '', (string) $out); - $x5c = preg_replace('~\R~', '', $x5c); + $x5c = preg_replace('~\R~', '', (string) $x5c); if (! is_string($x5c)) { throw new InvalidArgumentException('Unable to load the certificate'); } @@ -128,6 +135,9 @@ public static function loadFromKey(string $key, ?string $password = null): array */ public static function loadFromX5C(array $x5c): array { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } if (count($x5c) === 0) { throw new InvalidArgumentException('The certificate chain is empty'); } @@ -159,14 +169,14 @@ private static function loadKeyFromDER(string $der, ?string $password = null): a private static function loadKeyFromPEM(string $pem, ?string $password = null): array { - if (preg_match('#DEK-Info: (.+),(.+)#', $pem, $matches) === 1) { - $pem = self::decodePem($pem, $matches, $password); - } - if (! extension_loaded('openssl')) { throw new RuntimeException('Please install the OpenSSL extension'); } + if (preg_match('#DEK-Info: (.+),(.+)#', $pem, $matches) === 1) { + $pem = self::decodePem($pem, $matches, $password); + } + if (preg_match('#BEGIN ENCRYPTED PRIVATE KEY(.+)(.+)#', $pem) === 1) { $decrypted = openssl_pkey_get_private($pem, $password); if ($decrypted === false) { @@ -250,14 +260,31 @@ private static function tryToLoadOtherKeyTypes(string $input): array */ private static function populatePoints(PrivateKey $key, array $values): array { - if (($values['crv'] === 'Ed25519' || $values['crv'] === 'X25519') && extension_loaded('sodium')) { - $x = sodium_crypto_scalarmult_base($key->privateKeyData()); + $crv = $values['crv'] ?? null; + assert(is_string($crv), 'Unsupported key type.'); + $x = self::getPublicKey($key, $crv); + if ($x !== null) { $values['x'] = Base64UrlSafe::encodeUnpadded($x); } return $values; } + private static function getPublicKey(PrivateKey $key, string $crv): ?string + { + switch ($crv) { + case 'Ed25519': + return Ed25519::publickey_from_secretkey($key->privateKeyData()); + case 'X25519': + if (extension_loaded('sodium')) { + return sodium_crypto_scalarmult_base($key->privateKeyData()); + } + // no break + default: + return null; + } + } + private static function checkType(string $curve): void { $curves = ['Ed448ph', 'Ed25519ph', 'Ed448', 'Ed25519', 'X448', 'X25519']; diff --git a/src/Component/KeyManagement/KeyConverter/RSAKey.php b/src/Library/KeyManagement/KeyConverter/RSAKey.php similarity index 96% rename from src/Component/KeyManagement/KeyConverter/RSAKey.php rename to src/Library/KeyManagement/KeyConverter/RSAKey.php index 3f4fa462a..ff98ea376 100644 --- a/src/Component/KeyManagement/KeyConverter/RSAKey.php +++ b/src/Library/KeyManagement/KeyConverter/RSAKey.php @@ -4,15 +4,15 @@ namespace Jose\Component\KeyManagement\KeyConverter; -use function array_key_exists; -use function extension_loaded; -use function in_array; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\BigInteger; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function array_key_exists; +use function extension_loaded; +use function in_array; +use function is_array; /** * @internal @@ -135,9 +135,9 @@ private function loadJWK(array $jwk): void private function populateCRT(): void { if (! array_key_exists('p', $this->values) && ! array_key_exists('q', $this->values)) { - $d = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['d'])); - $e = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['e'])); - $n = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['n'])); + $d = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['d'])); + $e = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['e'])); + $n = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['n'])); [$p, $q] = $this->findPrimeFactors($d, $e, $n); $this->values['p'] = Base64UrlSafe::encodeUnpadded($p->toBytes()); @@ -152,9 +152,9 @@ private function populateCRT(): void } $one = BigInteger::createFromDecimal(1); - $d = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['d'])); - $p = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['p'])); - $q = BigInteger::createFromBinaryString(Base64UrlSafe::decode($this->values['q'])); + $d = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['d'])); + $p = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['p'])); + $q = BigInteger::createFromBinaryString(Base64UrlSafe::decodeNoPadding($this->values['q'])); $this->values['dp'] = Base64UrlSafe::encodeUnpadded($d->mod($p->subtract($one))->toBytes()); $this->values['dq'] = Base64UrlSafe::encodeUnpadded($d->mod($q->subtract($one))->toBytes()); diff --git a/src/Library/KeyManagement/UrlKeySetFactory.php b/src/Library/KeyManagement/UrlKeySetFactory.php new file mode 100644 index 000000000..6bd2553ca --- /dev/null +++ b/src/Library/KeyManagement/UrlKeySetFactory.php @@ -0,0 +1,88 @@ +client instanceof ClientInterface) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3', + 'Using "%s" with an instance of "%s" is deprecated, use "%s" instead.', + self::class, + ClientInterface::class, + HttpClientInterface::class + ); + } + if (! $this->client instanceof HttpClientInterface && $this->requestFactory === null) { + throw new RuntimeException(sprintf( + 'The request factory must be provided when using an instance of "%s" as client.', + ClientInterface::class + )); + } + } + + /** + * @param array $header + */ + protected function getContent(string $url, array $header = []): string + { + if ($this->client instanceof HttpClientInterface) { + return $this->sendSymfonyRequest($url, $header); + } + return $this->sendPsrRequest($url, $header); + } + + /** + * @param array $header + */ + private function sendSymfonyRequest(string $url, array $header = []): string + { + assert($this->client instanceof HttpClientInterface); + $response = $this->client->request('GET', $url, [ + 'headers' => $header, + ]); + + if ($response->getStatusCode() >= 400) { + throw new RuntimeException('Unable to get the key set.', $response->getStatusCode()); + } + + return $response->getContent(); + } + + /** + * @param array $header + */ + private function sendPsrRequest(string $url, array $header = []): string + { + assert($this->client instanceof ClientInterface); + assert($this->requestFactory instanceof RequestFactoryInterface); + $request = $this->requestFactory->createRequest('GET', $url); + foreach ($header as $k => $v) { + $request = $request->withHeader($k, $v); + } + $response = $this->client->sendRequest($request); + + if ($response->getStatusCode() >= 400) { + throw new RuntimeException('Unable to get the key set.', $response->getStatusCode()); + } + + return $response->getBody() + ->getContents(); + } +} diff --git a/src/Component/KeyManagement/X5UFactory.php b/src/Library/KeyManagement/X5UFactory.php similarity index 100% rename from src/Component/KeyManagement/X5UFactory.php rename to src/Library/KeyManagement/X5UFactory.php index 95437aa39..1eaf9bf52 100644 --- a/src/Component/KeyManagement/X5UFactory.php +++ b/src/Library/KeyManagement/X5UFactory.php @@ -4,14 +4,14 @@ namespace Jose\Component\KeyManagement; -use function is_array; -use function is_string; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\KeyManagement\KeyConverter\KeyConverter; -use const PHP_EOL; use RuntimeException; +use function is_array; +use function is_string; +use const PHP_EOL; class X5UFactory extends UrlKeySetFactory { diff --git a/src/Library/LICENSE b/src/Library/LICENSE new file mode 100644 index 000000000..5ab750604 --- /dev/null +++ b/src/Library/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2024 Spomky-Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Component/NestedToken/NestedTokenBuilder.php b/src/Library/NestedToken/NestedTokenBuilder.php similarity index 100% rename from src/Component/NestedToken/NestedTokenBuilder.php rename to src/Library/NestedToken/NestedTokenBuilder.php index c245497e6..a187d0407 100644 --- a/src/Component/NestedToken/NestedTokenBuilder.php +++ b/src/Library/NestedToken/NestedTokenBuilder.php @@ -4,14 +4,14 @@ namespace Jose\Component\NestedToken; -use function array_key_exists; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\JWK; use Jose\Component\Encryption\JWEBuilder; use Jose\Component\Encryption\Serializer\JWESerializerManager; use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\Serializer\JWSSerializerManager; +use function array_key_exists; +use function is_array; class NestedTokenBuilder { diff --git a/src/Component/NestedToken/NestedTokenBuilderFactory.php b/src/Library/NestedToken/NestedTokenBuilderFactory.php similarity index 100% rename from src/Component/NestedToken/NestedTokenBuilderFactory.php rename to src/Library/NestedToken/NestedTokenBuilderFactory.php diff --git a/src/Component/NestedToken/NestedTokenLoader.php b/src/Library/NestedToken/NestedTokenLoader.php similarity index 100% rename from src/Component/NestedToken/NestedTokenLoader.php rename to src/Library/NestedToken/NestedTokenLoader.php index b6764be83..fbb2c3d45 100644 --- a/src/Component/NestedToken/NestedTokenLoader.php +++ b/src/Library/NestedToken/NestedTokenLoader.php @@ -5,12 +5,12 @@ namespace Jose\Component\NestedToken; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWKSet; use Jose\Component\Encryption\JWE; use Jose\Component\Encryption\JWELoader; use Jose\Component\Signature\JWS; use Jose\Component\Signature\JWSLoader; +use function is_string; class NestedTokenLoader { diff --git a/src/Component/NestedToken/NestedTokenLoaderFactory.php b/src/Library/NestedToken/NestedTokenLoaderFactory.php similarity index 100% rename from src/Component/NestedToken/NestedTokenLoaderFactory.php rename to src/Library/NestedToken/NestedTokenLoaderFactory.php diff --git a/src/Library/README.md b/src/Library/README.md new file mode 100644 index 000000000..4a4ec4369 --- /dev/null +++ b/src/Library/README.md @@ -0,0 +1,16 @@ +PHP JWT Library +=============== + +This repository is a sub repository of [the JWT Framework](https://github.com/web-token/jwt-framework) project and is +READ ONLY. + +**Please do not submit any Pull Request here.** +You should go to [the main repository](https://github.com/web-token/jwt-framework) instead. + +# Documentation + +The official documentation is available as https://web-token.spomky-labs.com/ + +# Licence + +This software is release under [MIT licence](LICENSE). diff --git a/src/SignatureAlgorithm/ECDSA/ECDSA.php b/src/Library/Signature/Algorithm/ECDSA.php similarity index 91% rename from src/SignatureAlgorithm/ECDSA/ECDSA.php rename to src/Library/Signature/Algorithm/ECDSA.php index e40c0a072..3c1f2a7e2 100644 --- a/src/SignatureAlgorithm/ECDSA/ECDSA.php +++ b/src/Library/Signature/Algorithm/ECDSA.php @@ -4,19 +4,24 @@ namespace Jose\Component\Signature\Algorithm; -use function defined; -use function in_array; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\ECKey; use Jose\Component\Core\Util\ECSignature; use LogicException; +use RuntimeException; use Throwable; +use function defined; +use function extension_loaded; +use function in_array; abstract class ECDSA implements SignatureAlgorithm { public function __construct() { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } if (! defined('OPENSSL_KEYTYPE_EC')) { throw new LogicException('Elliptic Curve key type not supported by your environment.'); } diff --git a/src/SignatureAlgorithm/ECDSA/ES256.php b/src/Library/Signature/Algorithm/ES256.php similarity index 100% rename from src/SignatureAlgorithm/ECDSA/ES256.php rename to src/Library/Signature/Algorithm/ES256.php diff --git a/src/SignatureAlgorithm/ECDSA/ES384.php b/src/Library/Signature/Algorithm/ES384.php similarity index 100% rename from src/SignatureAlgorithm/ECDSA/ES384.php rename to src/Library/Signature/Algorithm/ES384.php diff --git a/src/SignatureAlgorithm/ECDSA/ES512.php b/src/Library/Signature/Algorithm/ES512.php similarity index 100% rename from src/SignatureAlgorithm/ECDSA/ES512.php rename to src/Library/Signature/Algorithm/ES512.php diff --git a/src/SignatureAlgorithm/EdDSA/EdDSA.php b/src/Library/Signature/Algorithm/EdDSA.php similarity index 77% rename from src/SignatureAlgorithm/EdDSA/EdDSA.php rename to src/Library/Signature/Algorithm/EdDSA.php index dcc57c57e..6d59ce4d4 100644 --- a/src/SignatureAlgorithm/EdDSA/EdDSA.php +++ b/src/Library/Signature/Algorithm/EdDSA.php @@ -4,13 +4,15 @@ namespace Jose\Component\Signature\Algorithm; -use function extension_loaded; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use ParagonIE\Sodium\Core\Ed25519; use RuntimeException; +use function assert; +use function extension_loaded; +use function in_array; +use function is_string; final class EdDSA implements SignatureAlgorithm { @@ -40,7 +42,7 @@ public function sign(JWK $key, string $input): string throw new InvalidArgumentException('Invalid "d" parameter.'); } if (! $key->has('x')) { - $x = sodium_crypto_sign_publickey_from_secretkey($d); + $x = self::getPublicKey($key); } else { $x = $key->get('x'); } @@ -48,9 +50,9 @@ public function sign(JWK $key, string $input): string throw new InvalidArgumentException('Invalid "x" parameter.'); } /** @var non-empty-string $x */ - $x = Base64UrlSafe::decode($x); + $x = Base64UrlSafe::decodeNoPadding($x); /** @var non-empty-string $d */ - $d = Base64UrlSafe::decode($d); + $d = Base64UrlSafe::decodeNoPadding($d); $secret = $d . $x; return match ($key->get('crv')) { @@ -71,7 +73,7 @@ public function verify(JWK $key, string $input, string $signature): bool } /** @var non-empty-string $public */ - $public = Base64UrlSafe::decode($x); + $public = Base64UrlSafe::decodeNoPadding($x); return match ($key->get('crv')) { 'Ed25519' => sodium_crypto_sign_verify_detached($signature, $input, $public), @@ -84,6 +86,24 @@ public function name(): string return 'EdDSA'; } + private static function getPublicKey(JWK $key): string + { + $d = $key->get('d'); + assert(is_string($d), 'Unsupported key type'); + + switch ($key->get('crv')) { + case 'Ed25519': + return Ed25519::publickey_from_secretkey($d); + case 'X25519': + if (extension_loaded('sodium')) { + return sodium_crypto_scalarmult_base($d); + } + // no break + default: + throw new InvalidArgumentException('Unsupported key type'); + } + } + private function checkKey(JWK $key): void { if (! in_array($key->get('kty'), $this->allowedKeyTypes(), true)) { diff --git a/src/SignatureAlgorithm/HMAC/HMAC.php b/src/Library/Signature/Algorithm/HMAC.php similarity index 96% rename from src/SignatureAlgorithm/HMAC/HMAC.php rename to src/Library/Signature/Algorithm/HMAC.php index bd1923787..badda9871 100644 --- a/src/SignatureAlgorithm/HMAC/HMAC.php +++ b/src/Library/Signature/Algorithm/HMAC.php @@ -4,11 +4,11 @@ namespace Jose\Component\Signature\Algorithm; -use function in_array; use InvalidArgumentException; -use function is_string; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use function in_array; +use function is_string; abstract class HMAC implements MacAlgorithm { @@ -42,7 +42,7 @@ protected function getKey(JWK $key): string throw new InvalidArgumentException('The key parameter "k" is invalid.'); } - return Base64UrlSafe::decode($k); + return Base64UrlSafe::decodeNoPadding($k); } abstract protected function getHashAlgorithm(): string; diff --git a/src/SignatureAlgorithm/HMAC/HS256.php b/src/Library/Signature/Algorithm/HS256.php similarity index 100% rename from src/SignatureAlgorithm/HMAC/HS256.php rename to src/Library/Signature/Algorithm/HS256.php diff --git a/src/SignatureAlgorithm/HMAC/HS384.php b/src/Library/Signature/Algorithm/HS384.php similarity index 100% rename from src/SignatureAlgorithm/HMAC/HS384.php rename to src/Library/Signature/Algorithm/HS384.php diff --git a/src/SignatureAlgorithm/HMAC/HS512.php b/src/Library/Signature/Algorithm/HS512.php similarity index 100% rename from src/SignatureAlgorithm/HMAC/HS512.php rename to src/Library/Signature/Algorithm/HS512.php diff --git a/src/Component/Signature/Algorithm/MacAlgorithm.php b/src/Library/Signature/Algorithm/MacAlgorithm.php similarity index 100% rename from src/Component/Signature/Algorithm/MacAlgorithm.php rename to src/Library/Signature/Algorithm/MacAlgorithm.php diff --git a/src/SignatureAlgorithm/None/None.php b/src/Library/Signature/Algorithm/None.php similarity index 100% rename from src/SignatureAlgorithm/None/None.php rename to src/Library/Signature/Algorithm/None.php index 41c100b5e..be9e48731 100644 --- a/src/SignatureAlgorithm/None/None.php +++ b/src/Library/Signature/Algorithm/None.php @@ -4,9 +4,9 @@ namespace Jose\Component\Signature\Algorithm; -use function in_array; use InvalidArgumentException; use Jose\Component\Core\JWK; +use function in_array; final class None implements SignatureAlgorithm { diff --git a/src/SignatureAlgorithm/RSA/PS256.php b/src/Library/Signature/Algorithm/PS256.php similarity index 100% rename from src/SignatureAlgorithm/RSA/PS256.php rename to src/Library/Signature/Algorithm/PS256.php diff --git a/src/SignatureAlgorithm/RSA/PS384.php b/src/Library/Signature/Algorithm/PS384.php similarity index 100% rename from src/SignatureAlgorithm/RSA/PS384.php rename to src/Library/Signature/Algorithm/PS384.php diff --git a/src/SignatureAlgorithm/RSA/PS512.php b/src/Library/Signature/Algorithm/PS512.php similarity index 100% rename from src/SignatureAlgorithm/RSA/PS512.php rename to src/Library/Signature/Algorithm/PS512.php diff --git a/src/SignatureAlgorithm/RSA/RS256.php b/src/Library/Signature/Algorithm/RS256.php similarity index 100% rename from src/SignatureAlgorithm/RSA/RS256.php rename to src/Library/Signature/Algorithm/RS256.php diff --git a/src/SignatureAlgorithm/RSA/RS384.php b/src/Library/Signature/Algorithm/RS384.php similarity index 100% rename from src/SignatureAlgorithm/RSA/RS384.php rename to src/Library/Signature/Algorithm/RS384.php diff --git a/src/SignatureAlgorithm/RSA/RS512.php b/src/Library/Signature/Algorithm/RS512.php similarity index 100% rename from src/SignatureAlgorithm/RSA/RS512.php rename to src/Library/Signature/Algorithm/RS512.php diff --git a/src/SignatureAlgorithm/RSA/RSAPKCS1.php b/src/Library/Signature/Algorithm/RSAPKCS1.php similarity index 88% rename from src/SignatureAlgorithm/RSA/RSAPKCS1.php rename to src/Library/Signature/Algorithm/RSAPKCS1.php index 573b1ee1f..8e135f73b 100644 --- a/src/SignatureAlgorithm/RSA/RSAPKCS1.php +++ b/src/Library/Signature/Algorithm/RSAPKCS1.php @@ -4,14 +4,22 @@ namespace Jose\Component\Signature\Algorithm; -use function in_array; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\RSAKey; use RuntimeException; +use function extension_loaded; +use function in_array; abstract class RSAPKCS1 implements SignatureAlgorithm { + public function __construct() + { + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } + } + public function allowedKeyTypes(): array { return ['RSA']; diff --git a/src/SignatureAlgorithm/RSA/RSAPSS.php b/src/Library/Signature/Algorithm/RSAPSS.php similarity index 100% rename from src/SignatureAlgorithm/RSA/RSAPSS.php rename to src/Library/Signature/Algorithm/RSAPSS.php index 19f36abd6..46dafec01 100644 --- a/src/SignatureAlgorithm/RSA/RSAPSS.php +++ b/src/Library/Signature/Algorithm/RSAPSS.php @@ -4,11 +4,11 @@ namespace Jose\Component\Signature\Algorithm; -use function in_array; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\RSAKey; use Jose\Component\Signature\Algorithm\Util\RSA as JoseRSA; +use function in_array; abstract class RSAPSS implements SignatureAlgorithm { diff --git a/src/Component/Signature/Algorithm/SignatureAlgorithm.php b/src/Library/Signature/Algorithm/SignatureAlgorithm.php similarity index 100% rename from src/Component/Signature/Algorithm/SignatureAlgorithm.php rename to src/Library/Signature/Algorithm/SignatureAlgorithm.php diff --git a/src/SignatureAlgorithm/RSA/Util/RSA.php b/src/Library/Signature/Algorithm/Util/RSA.php similarity index 88% rename from src/SignatureAlgorithm/RSA/Util/RSA.php rename to src/Library/Signature/Algorithm/Util/RSA.php index 901badcf4..4c1194fe4 100644 --- a/src/SignatureAlgorithm/RSA/Util/RSA.php +++ b/src/Library/Signature/Algorithm/Util/RSA.php @@ -4,13 +4,14 @@ namespace Jose\Component\Signature\Algorithm\Util; -use function chr; use InvalidArgumentException; use Jose\Component\Core\Util\BigInteger; use Jose\Component\Core\Util\Hash; use Jose\Component\Core\Util\RSAKey; -use function ord; use RuntimeException; +use function chr; +use function extension_loaded; +use function ord; use const STR_PAD_LEFT; /** @@ -38,6 +39,9 @@ public static function sign(RSAKey $key, string $message, string $hash, int $mod return self::signWithPSS($key, $message, $hash); case self::SIGNATURE_PKCS1: + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } $result = openssl_sign($message, $signature, $key->toPEM(), $hash); if ($result !== true) { throw new RuntimeException('Unable to sign the data'); @@ -70,11 +74,17 @@ public static function signWithPSS(RSAKey $key, string $message, string $hash): public static function verify(RSAKey $key, string $message, string $signature, string $hash, int $mode): bool { - return match ($mode) { - self::SIGNATURE_PSS => self::verifyWithPSS($key, $message, $signature, $hash), - self::SIGNATURE_PKCS1 => openssl_verify($message, $signature, $key->toPEM(), $hash) === 1, - default => throw new InvalidArgumentException('Unsupported mode.'), - }; + switch ($mode) { + case self::SIGNATURE_PSS: + return self::verifyWithPSS($key, $message, $signature, $hash); + case self::SIGNATURE_PKCS1: + if (! extension_loaded('openssl')) { + throw new RuntimeException('Please install the OpenSSL extension'); + } + return openssl_verify($message, $signature, $key->toPEM(), $hash) === 1; + default: + throw new InvalidArgumentException('Unsupported mode.'); + } } /** diff --git a/src/Component/Signature/JWS.php b/src/Library/Signature/JWS.php similarity index 98% rename from src/Component/Signature/JWS.php rename to src/Library/Signature/JWS.php index 7a6f131ff..715ddcc11 100644 --- a/src/Component/Signature/JWS.php +++ b/src/Library/Signature/JWS.php @@ -4,10 +4,13 @@ namespace Jose\Component\Signature; -use function count; use InvalidArgumentException; use Jose\Component\Core\JWT; +use function count; +/** + * @see \Jose\Tests\Component\Signature\JWSTest + */ class JWS implements JWT { /** diff --git a/src/Component/Signature/JWSBuilder.php b/src/Library/Signature/JWSBuilder.php similarity index 88% rename from src/Component/Signature/JWSBuilder.php rename to src/Library/Signature/JWSBuilder.php index 5c1c1d789..84201cc6c 100644 --- a/src/Component/Signature/JWSBuilder.php +++ b/src/Library/Signature/JWSBuilder.php @@ -4,11 +4,7 @@ namespace Jose\Component\Signature; -use function array_key_exists; -use function count; -use function in_array; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Algorithm; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -19,6 +15,11 @@ use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; use RuntimeException; +use function array_key_exists; +use function count; +use function in_array; +use function is_array; +use function is_string; class JWSBuilder { @@ -69,9 +70,6 @@ public function create(): self */ public function withPayload(string $payload, bool $isPayloadDetached = false): self { - if (mb_detect_encoding($payload, 'UTF-8', true) === false) { - throw new InvalidArgumentException('The payload must be encoded in UTF-8'); - } $clone = clone $this; $clone->payload = $payload; $clone->isPayloadDetached = $isPayloadDetached; @@ -82,8 +80,8 @@ public function withPayload(string $payload, bool $isPayloadDetached = false): s /** * Adds the information needed to compute the signature. This method will return a new JWSBuilder object. * - * @param array{alg?: string, string?: mixed} $protectedHeader - * @param array{alg?: string, string?: mixed} $header + * @param array $protectedHeader + * @param array $header */ public function addSignature(JWK $signatureKey, array $protectedHeader, array $header = []): self { @@ -124,6 +122,13 @@ public function build(): JWS $encodedPayload = $this->isPayloadEncoded === false ? $this->payload : Base64UrlSafe::encodeUnpadded( $this->payload ); + + if ($this->isPayloadEncoded === false && $this->isPayloadDetached === false) { + mb_detect_encoding($this->payload, 'UTF-8', true) !== false || throw new InvalidArgumentException( + 'The payload must be encoded in UTF-8' + ); + } + $jws = new JWS($this->payload, $encodedPayload, $this->isPayloadDetached); foreach ($this->signatures as $signature) { /** @var MacAlgorithm|SignatureAlgorithm $algorithm */ @@ -181,26 +186,25 @@ private function checkB64AndCriticalHeader(array $protectedHeader): void } /** - * @param array{alg?: string, string?: mixed} $protectedHeader - * @param array{alg?: string, string?: mixed} $header + * @param array $protectedHeader + * @param array $header * @return MacAlgorithm|SignatureAlgorithm */ private function findSignatureAlgorithm(JWK $key, array $protectedHeader, array $header): Algorithm { $completeHeader = [...$header, ...$protectedHeader]; - if (! array_key_exists('alg', $completeHeader)) { + $alg = $completeHeader['alg'] ?? null; + if (! is_string($alg)) { throw new InvalidArgumentException('No "alg" parameter set in the header.'); } - if ($key->has('alg') && $key->get('alg') !== $completeHeader['alg']) { - throw new InvalidArgumentException(sprintf( - 'The algorithm "%s" is not allowed with this key.', - $completeHeader['alg'] - )); + $keyAlg = $key->has('alg') ? $key->get('alg') : null; + if (is_string($keyAlg) && $keyAlg !== $alg) { + throw new InvalidArgumentException(sprintf('The algorithm "%s" is not allowed with this key.', $alg)); } - $algorithm = $this->signatureAlgorithmManager->get($completeHeader['alg']); + $algorithm = $this->signatureAlgorithmManager->get($alg); if (! $algorithm instanceof SignatureAlgorithm && ! $algorithm instanceof MacAlgorithm) { - throw new InvalidArgumentException(sprintf('The algorithm "%s" is not supported.', $completeHeader['alg'])); + throw new InvalidArgumentException(sprintf('The algorithm "%s" is not supported.', $alg)); } return $algorithm; diff --git a/src/Component/Signature/JWSBuilderFactory.php b/src/Library/Signature/JWSBuilderFactory.php similarity index 100% rename from src/Component/Signature/JWSBuilderFactory.php rename to src/Library/Signature/JWSBuilderFactory.php diff --git a/src/Component/Signature/JWSLoader.php b/src/Library/Signature/JWSLoader.php similarity index 97% rename from src/Component/Signature/JWSLoader.php rename to src/Library/Signature/JWSLoader.php index 35fb2027a..8889d2dad 100644 --- a/src/Component/Signature/JWSLoader.php +++ b/src/Library/Signature/JWSLoader.php @@ -11,6 +11,9 @@ use Jose\Component\Signature\Serializer\JWSSerializerManager; use Throwable; +/** + * @see \Jose\Tests\Component\Signature\JWSLoaderTest + */ class JWSLoader { public function __construct( diff --git a/src/Component/Signature/JWSLoaderFactory.php b/src/Library/Signature/JWSLoaderFactory.php similarity index 100% rename from src/Component/Signature/JWSLoaderFactory.php rename to src/Library/Signature/JWSLoaderFactory.php diff --git a/src/Component/Signature/JWSTokenSupport.php b/src/Library/Signature/JWSTokenSupport.php similarity index 100% rename from src/Component/Signature/JWSTokenSupport.php rename to src/Library/Signature/JWSTokenSupport.php diff --git a/src/Component/Signature/JWSVerifier.php b/src/Library/Signature/JWSVerifier.php similarity index 100% rename from src/Component/Signature/JWSVerifier.php rename to src/Library/Signature/JWSVerifier.php diff --git a/src/Component/Signature/JWSVerifierFactory.php b/src/Library/Signature/JWSVerifierFactory.php similarity index 100% rename from src/Component/Signature/JWSVerifierFactory.php rename to src/Library/Signature/JWSVerifierFactory.php diff --git a/src/Component/Signature/Serializer/CompactSerializer.php b/src/Library/Signature/Serializer/CompactSerializer.php similarity index 95% rename from src/Component/Signature/Serializer/CompactSerializer.php rename to src/Library/Signature/Serializer/CompactSerializer.php index f91c3fa36..3a657a147 100644 --- a/src/Component/Signature/Serializer/CompactSerializer.php +++ b/src/Library/Signature/Serializer/CompactSerializer.php @@ -4,14 +4,14 @@ namespace Jose\Component\Signature\Serializer; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; use Throwable; +use function count; +use function is_array; final class CompactSerializer extends Serializer { @@ -62,7 +62,7 @@ public function unserialize(string $input): JWS try { $encodedProtectedHeader = $parts[0]; - $protectedHeader = JsonConverter::decode(Base64UrlSafe::decode($parts[0])); + $protectedHeader = JsonConverter::decode(Base64UrlSafe::decodeNoPadding($parts[0])); if (! is_array($protectedHeader)) { throw new InvalidArgumentException('Bad protected header.'); } @@ -72,11 +72,11 @@ public function unserialize(string $input): JWS $encodedPayload = null; } else { $encodedPayload = $parts[1]; - $payload = $this->isPayloadEncoded($protectedHeader) ? Base64UrlSafe::decode( + $payload = $this->isPayloadEncoded($protectedHeader) ? Base64UrlSafe::decodeNoPadding( $encodedPayload ) : $encodedPayload; } - $signature = Base64UrlSafe::decode($parts[2]); + $signature = Base64UrlSafe::decodeNoPadding($parts[2]); $jws = new JWS($payload, $encodedPayload, ! $hasPayload); diff --git a/src/Component/Signature/Serializer/JSONFlattenedSerializer.php b/src/Library/Signature/Serializer/JSONFlattenedSerializer.php similarity index 95% rename from src/Component/Signature/Serializer/JSONFlattenedSerializer.php rename to src/Library/Signature/Serializer/JSONFlattenedSerializer.php index dcdb96391..1a8b4cb00 100644 --- a/src/Component/Signature/Serializer/JSONFlattenedSerializer.php +++ b/src/Library/Signature/Serializer/JSONFlattenedSerializer.php @@ -4,12 +4,12 @@ namespace Jose\Component\Signature\Serializer; -use function count; use InvalidArgumentException; -use function is_array; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; use ParagonIE\ConstantTime\Base64UrlSafe; +use function count; +use function is_array; final class JSONFlattenedSerializer extends Serializer { @@ -59,11 +59,11 @@ public function unserialize(string $input): JWS if (! isset($data['signature'])) { throw new InvalidArgumentException('Unsupported input.'); } - $signature = Base64UrlSafe::decode($data['signature']); + $signature = Base64UrlSafe::decodeNoPadding($data['signature']); if (isset($data['protected'])) { $encodedProtectedHeader = $data['protected']; - $protectedHeader = JsonConverter::decode(Base64UrlSafe::decode($data['protected'])); + $protectedHeader = JsonConverter::decode(Base64UrlSafe::decodeNoPadding($data['protected'])); if (! is_array($protectedHeader)) { throw new InvalidArgumentException('Bad protected header.'); } @@ -82,7 +82,7 @@ public function unserialize(string $input): JWS if (isset($data['payload'])) { $encodedPayload = $data['payload']; - $payload = $this->isPayloadEncoded($protectedHeader) ? Base64UrlSafe::decode( + $payload = $this->isPayloadEncoded($protectedHeader) ? Base64UrlSafe::decodeNoPadding( $encodedPayload ) : $encodedPayload; } else { diff --git a/src/Component/Signature/Serializer/JSONGeneralSerializer.php b/src/Library/Signature/Serializer/JSONGeneralSerializer.php similarity index 96% rename from src/Component/Signature/Serializer/JSONGeneralSerializer.php rename to src/Library/Signature/Serializer/JSONGeneralSerializer.php index db4d25cd8..1905e645e 100644 --- a/src/Component/Signature/Serializer/JSONGeneralSerializer.php +++ b/src/Library/Signature/Serializer/JSONGeneralSerializer.php @@ -4,15 +4,15 @@ namespace Jose\Component\Signature\Serializer; -use function array_key_exists; -use function count; use InvalidArgumentException; -use function is_array; -use function is_string; use Jose\Component\Core\Util\JsonConverter; use Jose\Component\Signature\JWS; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; +use function array_key_exists; +use function count; +use function is_array; +use function is_string; final class JSONGeneralSerializer extends Serializer { @@ -81,7 +81,7 @@ public function unserialize(string $input): JWS } [$encodedProtectedHeader, $protectedHeader, $header] = $this->processHeaders($signature); $signatures[] = [ - 'signature' => Base64UrlSafe::decode($signature['signature']), + 'signature' => Base64UrlSafe::decodeNoPadding($signature['signature']), 'protected' => $protectedHeader, 'encoded_protected' => $encodedProtectedHeader, 'header' => $header, @@ -126,7 +126,7 @@ private function processHeaders(array $signature): array { $encodedProtectedHeader = $signature['protected'] ?? null; $protectedHeader = $encodedProtectedHeader === null ? [] : JsonConverter::decode( - Base64UrlSafe::decode($encodedProtectedHeader) + Base64UrlSafe::decodeNoPadding($encodedProtectedHeader) ); $header = array_key_exists('header', $signature) ? $signature['header'] : []; @@ -139,7 +139,7 @@ private function processPayload(?string $rawPayload, ?bool $isPayloadEncoded): ? return null; } - return $isPayloadEncoded === false ? $rawPayload : Base64UrlSafe::decode($rawPayload); + return $isPayloadEncoded === false ? $rawPayload : Base64UrlSafe::decodeNoPadding($rawPayload); } private function checkPayloadEncoding(JWS $jws): void diff --git a/src/Component/Signature/Serializer/JWSSerializer.php b/src/Library/Signature/Serializer/JWSSerializer.php similarity index 100% rename from src/Component/Signature/Serializer/JWSSerializer.php rename to src/Library/Signature/Serializer/JWSSerializer.php diff --git a/src/Component/Signature/Serializer/JWSSerializerManager.php b/src/Library/Signature/Serializer/JWSSerializerManager.php similarity index 100% rename from src/Component/Signature/Serializer/JWSSerializerManager.php rename to src/Library/Signature/Serializer/JWSSerializerManager.php diff --git a/src/Component/Signature/Serializer/JWSSerializerManagerFactory.php b/src/Library/Signature/Serializer/JWSSerializerManagerFactory.php similarity index 100% rename from src/Component/Signature/Serializer/JWSSerializerManagerFactory.php rename to src/Library/Signature/Serializer/JWSSerializerManagerFactory.php diff --git a/src/Component/Signature/Serializer/Serializer.php b/src/Library/Signature/Serializer/Serializer.php similarity index 100% rename from src/Component/Signature/Serializer/Serializer.php rename to src/Library/Signature/Serializer/Serializer.php diff --git a/src/Component/Signature/Signature.php b/src/Library/Signature/Signature.php similarity index 100% rename from src/Component/Signature/Signature.php rename to src/Library/Signature/Signature.php index bbe8548c4..a9975e33b 100644 --- a/src/Component/Signature/Signature.php +++ b/src/Library/Signature/Signature.php @@ -4,8 +4,8 @@ namespace Jose\Component\Signature; -use function array_key_exists; use InvalidArgumentException; +use function array_key_exists; class Signature { diff --git a/src/Library/composer.json b/src/Library/composer.json new file mode 100644 index 000000000..bf35f837b --- /dev/null +++ b/src/Library/composer.json @@ -0,0 +1,67 @@ +{ + "name": "web-token/jwt-library", + "description": "JWT library", + "type": "library", + "license": "MIT", + "keywords": [ + "JWS", + "JWT", + "JWE", + "JWA", + "JWK", + "JWKSet", + "Jot", + "Jose", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "Bundle", + "Symfony" + ], + "homepage": "https://github.com/web-token", + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "autoload": { + "psr-4": { + "Jose\\Component\\": "" + } + }, + "require": { + "php": ">=8.1", + "ext-json": "*", + "ext-mbstring": "*", + "brick/math": "^0.9|^0.10|^0.11|^0.12", + "paragonie/constant_time_encoding": "^2.6", + "paragonie/sodium_compat": "^1.20", + "psr/clock": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-client": "^1.0", + "spomky-labs/pki-framework": "^1.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/polyfill-mbstring": "^1.12" + }, + "conflict": { + "spomky-labs/jose": "*" + }, + "suggest": { + "ext-openssl": "For key management (creation, optimization, etc.) and some algorithms (AES, RSA, ECDSA, etc.)", + "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance", + "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance", + "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", + "paragonie/sodium_compat": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", + "symfony/http-client": "To enable JKU/X5U support.", + "spomky-labs/aes-key-wrap": "For all Key Wrapping algorithms (A128KW, A192KW, A256KW, A128GCMKW, A192GCMKW, A256GCMKW, PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW...)" + } +} diff --git a/src/SignatureAlgorithm/ECDSA/.github/FUNDING.yml b/src/SignatureAlgorithm/ECDSA/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/ECDSA/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/ECDSA/LICENSE b/src/SignatureAlgorithm/ECDSA/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/ECDSA/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/EdDSA/.github/FUNDING.yml b/src/SignatureAlgorithm/EdDSA/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/EdDSA/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/EdDSA/LICENSE b/src/SignatureAlgorithm/EdDSA/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/EdDSA/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/Experimental/.github/FUNDING.yml b/src/SignatureAlgorithm/Experimental/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/Experimental/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/Experimental/LICENSE b/src/SignatureAlgorithm/Experimental/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/Experimental/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/HMAC/.github/FUNDING.yml b/src/SignatureAlgorithm/HMAC/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/HMAC/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/HMAC/LICENSE b/src/SignatureAlgorithm/HMAC/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/HMAC/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/None/.github/FUNDING.yml b/src/SignatureAlgorithm/None/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/None/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/None/LICENSE b/src/SignatureAlgorithm/None/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/None/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/RSA/.github/FUNDING.yml b/src/SignatureAlgorithm/RSA/.github/FUNDING.yml deleted file mode 100644 index 7e2ca0e7e..000000000 --- a/src/SignatureAlgorithm/RSA/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -patreon: FlorentMorselli diff --git a/src/SignatureAlgorithm/RSA/LICENSE b/src/SignatureAlgorithm/RSA/LICENSE deleted file mode 100644 index 37cf976b1..000000000 --- a/src/SignatureAlgorithm/RSA/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Spomky-Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/SignatureAlgorithm/RSA/composer.json b/src/SignatureAlgorithm/RSA/composer.json deleted file mode 100644 index 2a8f3afc9..000000000 --- a/src/SignatureAlgorithm/RSA/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "web-token/jwt-signature-algorithm-rsa", - "description": "RSA Based Signature Algorithms the JWT Framework.", - "type": "library", - "license": "MIT", - "keywords": [ - "JWS", - "JWT", - "JWE", - "JWA", - "JWK", - "JWKSet", - "Jot", - "Jose", - "RFC7515", - "RFC7516", - "RFC7517", - "RFC7518", - "RFC7519", - "RFC7520", - "Bundle", - "Symfony" - ], - "homepage": "https://github.com/web-token", - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/web-token/jwt-framework/contributors" - } - ], - "autoload": { - "psr-4": { - "Jose\\Component\\Signature\\Algorithm\\": "" - } - }, - "require": { - "php": ">=8.1", - "brick/math": "^0.9|^0.10|^0.11", - "ext-openssl": "*", - "web-token/jwt-signature": "^3.2" - }, - "suggest": { - "ext-gmp": "GMP or BCMath is highly recommended to improve the library performance", - "ext-bcmath": "GMP or BCMath is highly recommended to improve the library performance" - } -} diff --git a/tests/Bundle/JoseFramework/Functional/Checker/ClaimCheckerTest.php b/tests/Bundle/JoseFramework/Functional/Checker/ClaimCheckerTest.php index fae0f4da7..f4d294e3b 100644 --- a/tests/Bundle/JoseFramework/Functional/Checker/ClaimCheckerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Checker/ClaimCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Bundle\JoseFramework\Services\ClaimCheckerManagerFactory as ClaimCheckerManagerFactoryService; use Jose\Component\Checker\ClaimCheckerManagerFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +22,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theClaimCheckerManagerFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -33,9 +32,7 @@ public static function theClaimCheckerManagerFactoryIsAvailable(): void static::assertTrue($container->has(ClaimCheckerManagerFactoryService::class)); } - /** - * @test - */ + #[Test] public static function theClaimCheckerManagerFactoryCanCreateAClaimCheckerManager(): void { static::ensureKernelShutdown(); @@ -49,9 +46,7 @@ public static function theClaimCheckerManagerFactoryCanCreateAClaimCheckerManage $claimCheckerManagerFactory->create($aliases); } - /** - * @test - */ + #[Test] public static function aClaimCheckerCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -61,9 +56,7 @@ public static function aClaimCheckerCanBeDefinedUsingTheConfigurationFile(): voi static::assertTrue($container->has('jose.claim_checker.checker1')); } - /** - * @test - */ + #[Test] public static function aClaimCheckerCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Checker/ConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Checker/ConfigurationTest.php index 27fdfb5b4..7bba39229 100644 --- a/tests/Bundle/JoseFramework/Functional/Checker/ConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Checker/ConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Core\CoreSource; use Jose\Component\Checker\ClaimCheckerManagerFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoHeaderOrClaimCheckerIsSet(): void { $this->assertConfigurationIsValid([ @@ -72,9 +65,7 @@ public function theConfigurationIsValidIfNoHeaderOrClaimCheckerIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theHeadersForAHeaderCheckerShouldBeSet(): void { $this->assertConfigurationIsInvalid( @@ -93,9 +84,7 @@ public function theHeadersForAHeaderCheckerShouldBeSet(): void ); } - /** - * @test - */ + #[Test] public function aHeaderCheckerMayContainNoChecker(): void { $this->assertConfigurationIsValid( @@ -114,9 +103,7 @@ public function aHeaderCheckerMayContainNoChecker(): void ); } - /** - * @test - */ + #[Test] public function theClaimsForAClaimCheckerShouldBeSet(): void { $this->assertConfigurationIsInvalid( @@ -135,9 +122,7 @@ public function theClaimsForAClaimCheckerShouldBeSet(): void ); } - /** - * @test - */ + #[Test] public function aClaimCheckerMayContainNoChecker(): void { $this->assertConfigurationIsValid( diff --git a/tests/Bundle/JoseFramework/Functional/Checker/HeaderCheckerTest.php b/tests/Bundle/JoseFramework/Functional/Checker/HeaderCheckerTest.php index ea98c2d37..2ad961d73 100644 --- a/tests/Bundle/JoseFramework/Functional/Checker/HeaderCheckerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Checker/HeaderCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Bundle\JoseFramework\Services\HeaderCheckerManagerFactory as HeaderCheckerManagerFactoryService; use Jose\Component\Checker\HeaderCheckerManagerFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +22,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theHeaderCheckerManagerFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -33,9 +32,7 @@ public static function theHeaderCheckerManagerFactoryIsAvailable(): void static::assertTrue($container->has(HeaderCheckerManagerFactoryService::class)); } - /** - * @test - */ + #[Test] public static function theHeaderCheckerManagerFactoryCanCreateAHeaderCheckerManager(): void { static::ensureKernelShutdown(); @@ -49,9 +46,7 @@ public static function theHeaderCheckerManagerFactoryCanCreateAHeaderCheckerMana $headerCheckerManagerFactory->create($aliases); } - /** - * @test - */ + #[Test] public static function aHeaderCheckerCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -61,9 +56,7 @@ public static function aHeaderCheckerCanBeDefinedUsingTheConfigurationFile(): vo static::assertTrue($container->has('jose.header_checker.checker1')); } - /** - * @test - */ + #[Test] public static function aHeaderCheckerCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Console/ConsoleTest.php b/tests/Bundle/JoseFramework/Functional/Console/ConsoleTest.php index a4e12efbc..5f10a4850 100644 --- a/tests/Bundle/JoseFramework/Functional/Console/ConsoleTest.php +++ b/tests/Bundle/JoseFramework/Functional/Console/ConsoleTest.php @@ -5,6 +5,7 @@ namespace Jose\Tests\Bundle\JoseFramework\Functional\Console; use Jose\Component\Console\EcKeyGeneratorCommand; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; @@ -20,9 +21,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function allCommandsAreAvailable(): void { $expectedCommands = [ @@ -50,6 +49,8 @@ public static function allCommandsAreAvailable(): void self::bootKernel(); $application = new Application(self::$kernel); - static::assertEmpty(array_diff($expectedCommands, array_keys($application->all()))); + foreach ($expectedCommands as $expectedCommand) { + static::assertArrayHasKey($expectedCommand, $application->all()); + } } } diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JWEBuilderTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JWEBuilderTest.php index 5813a6e71..9e8cf6786 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JWEBuilderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JWEBuilderTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWEBuilder; use Jose\Bundle\JoseFramework\Services\JWEBuilderFactory as JWEBuilderFactoryService; use Jose\Component\Encryption\JWEBuilderFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theJWEBuilderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theJWEBuilderFactoryIsAvailable(): void static::assertTrue($container->has(JWEBuilderFactoryService::class)); } - /** - * @test - */ + #[Test] public static function theJWEBuilderFactoryCanCreateAJWEBuilder(): void { static::ensureKernelShutdown(); @@ -50,9 +47,7 @@ public static function theJWEBuilderFactoryCanCreateAJWEBuilder(): void $jweFactory->create(['RSA1_5'], ['A256GCM'], ['DEF']); } - /** - * @test - */ + #[Test] public static function aJWEBuilderCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -65,9 +60,7 @@ public static function aJWEBuilderCanBeDefinedUsingTheConfigurationFile(): void static::assertInstanceOf(JWEBuilder::class, $jwe); } - /** - * @test - */ + #[Test] public static function aJWEBuilderCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JWEComputationTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JWEComputationTest.php index 7884eabb6..45e931d75 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JWEComputationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JWEComputationTest.php @@ -9,6 +9,7 @@ use Jose\Component\Encryption\JWEBuilderFactory; use Jose\Component\Encryption\JWEDecrypter; use Jose\Component\Encryption\Serializer\CompactSerializer; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -24,9 +25,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function iCanCreateAndLoadAToken(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JWEDecrypterTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JWEDecrypterTest.php index b1040efd4..651a70c46 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JWEDecrypterTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JWEDecrypterTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWEDecrypterFactory as JWEDecrypterFactoryService; use Jose\Component\Encryption\JWEBuilderFactory; use Jose\Component\Encryption\JWEDecrypter; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theJWEDecrypterFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theJWEDecrypterFactoryIsAvailable(): void static::assertTrue($container->has(JWEDecrypterFactoryService::class)); } - /** - * @test - */ + #[Test] public static function theWEDecrypterFactoryCanCreateAJWEDecrypter(): void { static::ensureKernelShutdown(); @@ -50,9 +47,7 @@ public static function theWEDecrypterFactoryCanCreateAJWEDecrypter(): void $jweFactory->create(['RSA1_5'], ['A256GCM'], ['DEF']); } - /** - * @test - */ + #[Test] public static function aJWEDecrypterCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -65,9 +60,7 @@ public static function aJWEDecrypterCanBeDefinedUsingTheConfigurationFile(): voi static::assertInstanceOf(JWEDecrypter::class, $jwe); } - /** - * @test - */ + #[Test] public static function aJWEDecrypterCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JWELoaderTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JWELoaderTest.php index dd06777e4..a2f51b62d 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JWELoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JWELoaderTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWELoaderFactory as JWELoaderFactoryAlias; use Jose\Component\Encryption\JWEBuilderFactory; use Jose\Component\Encryption\JWELoader; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theJWELoaderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theJWELoaderFactoryIsAvailable(): void static::assertTrue($container->has(JWELoaderFactoryAlias::class)); } - /** - * @test - */ + #[Test] public static function theWELoaderFactoryCanCreateAJWELoader(): void { static::ensureKernelShutdown(); @@ -55,9 +52,7 @@ public static function theWELoaderFactoryCanCreateAJWELoader(): void static::assertSame(['DEF'], $jwe->getJweDecrypter()->getCompressionMethodManager()->list()); } - /** - * @test - */ + #[Test] public static function aJWELoaderCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -70,9 +65,7 @@ public static function aJWELoaderCanBeDefinedUsingTheConfigurationFile(): void static::assertInstanceOf(JWELoader::class, $jwe); } - /** - * @test - */ + #[Test] public static function aJWELoaderCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JWESerializerTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JWESerializerTest.php index 38d7a54dc..bd46051bf 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JWESerializerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JWESerializerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Encryption\JWEBuilderFactory; use Jose\Component\Encryption\Serializer\JWESerializerManager; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +22,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function jWESerializerManagerFromConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -36,9 +35,7 @@ public static function jWESerializerManagerFromConfigurationIsAvailable(): void static::assertInstanceOf(JWESerializerManager::class, $jwe); } - /** - * @test - */ + #[Test] public static function jWESerializerManagerFromExternalBundleExtensionIsAvailable(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JweBuilderConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JweBuilderConfigurationTest.php index 0390546b6..87cd29245 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JweBuilderConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JweBuilderConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Encryption\EncryptionSource; use Jose\Component\Encryption\JWEBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfBuilderIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsInvalidIfBuilderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotKeyEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNotKeyEncryptionAlgorithmIsSet(): voi ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheKeyEncryptionAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( @@ -111,9 +100,7 @@ public function theConfigurationIsInvalidIfTheKeyEncryptionAlgorithmIsEmpty(): v ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotContentEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -132,9 +119,7 @@ public function theConfigurationIsInvalidIfNotContentEncryptionAlgorithmIsSet(): ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheContentEncryptionAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/JweDecrypterConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/JweDecrypterConfigurationTest.php index 4790d5662..8d5d1dd61 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/JweDecrypterConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/JweDecrypterConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Encryption\EncryptionSource; use Jose\Component\Encryption\JWEBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfBuilderIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsInvalidIfBuilderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotKeyEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNotKeyEncryptionAlgorithmIsSet(): voi ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheKeyEncryptionAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( @@ -111,9 +100,7 @@ public function theConfigurationIsInvalidIfTheKeyEncryptionAlgorithmIsEmpty(): v ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotContentEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -132,9 +119,7 @@ public function theConfigurationIsInvalidIfNotContentEncryptionAlgorithmIsSet(): ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheContentEncryptionAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/Encryption/SerializerConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Encryption/SerializerConfigurationTest.php index a0a199e7b..ccec92519 100644 --- a/tests/Bundle/JoseFramework/Functional/Encryption/SerializerConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Encryption/SerializerConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Encryption\EncryptionSource; use Jose\Component\Encryption\JWEBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoSerializerIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsValidIfNoSerializerIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoSerializerParameterIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNoSerializerParameterIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheSerializerListIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/JKUAndX5UFactoriesTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/JKUAndX5UFactoriesTest.php index 5f825c81b..5818529f4 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/JKUAndX5UFactoriesTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/JKUAndX5UFactoriesTest.php @@ -6,6 +6,7 @@ use Jose\Component\KeyManagement\JKUFactory; use Jose\Component\KeyManagement\X5UFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +22,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theJKUFactoryServiceIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theJKUFactoryServiceIsAvailable(): void static::assertTrue($container->has(JKUFactory::class)); } - /** - * @test - */ + #[Test] public static function theX5UFactoryServiceIsAvailable(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php index 561afe283..88774a89b 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKLoaderTest.php @@ -7,6 +7,7 @@ use Jose\Component\Core\JWK; use Jose\Component\KeyManagement\JWKFactory; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function aJWKCanBeDefinedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -36,9 +35,7 @@ public static function aJWKCanBeDefinedInTheConfiguration(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.jwk1')); } - /** - * @test - */ + #[Test] public static function aJWKCanBeDefinedFromAnotherBundle(): void { static::ensureKernelShutdown(); @@ -50,9 +47,7 @@ public static function aJWKCanBeDefinedFromAnotherBundle(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.jwk2')); } - /** - * @test - */ + #[Test] public static function aX509InFileCanBeDefinedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -64,9 +59,7 @@ public static function aX509InFileCanBeDefinedInTheConfiguration(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.certificate1')); } - /** - * @test - */ + #[Test] public static function aDirectX509InputCanBeDefinedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -78,9 +71,7 @@ public static function aDirectX509InputCanBeDefinedInTheConfiguration(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.x5c1')); } - /** - * @test - */ + #[Test] public static function anEncryptedKeyFileCanBeLoadedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -92,9 +83,7 @@ public static function anEncryptedKeyFileCanBeLoadedInTheConfiguration(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.file1')); } - /** - * @test - */ + #[Test] public static function aJWKCanBeLoadedFromAJwkSetInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -106,9 +95,7 @@ public static function aJWKCanBeLoadedFromAJwkSetInTheConfiguration(): void static::assertInstanceOf(JWK::class, $container->get('jose.key.jwkset1')); } - /** - * @test - */ + #[Test] public static function aJWKCanBeLoadedFromASecretInTheConfiguration(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKSetLoaderTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKSetLoaderTest.php index c92146c0d..235ba33f3 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKSetLoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/JWKSetLoaderTest.php @@ -5,10 +5,10 @@ namespace Jose\Tests\Bundle\JoseFramework\Functional\KeyManagement; use Jose\Component\Core\JWKSet; -use Jose\Component\KeyManagement\JWKFactory; use Jose\Tests\Bundle\JoseFramework\TestBundle\Service\MockClientCallback; -use Nyholm\Psr7\Factory\Psr17Factory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\HttpClient\Response\MockResponse; use Symfony\Component\HttpFoundation\Response; /** @@ -16,19 +16,7 @@ */ final class JWKSetLoaderTest extends WebTestCase { - private static Psr17Factory $messageFactory; - - protected function setUp(): void - { - if (! class_exists(JWKFactory::class)) { - static::markTestSkipped('The component "web-token/jwt-key-mgmt" is not installed.'); - } - static::$messageFactory = new Psr17Factory(); - } - - /** - * @test - */ + #[Test] public static function aJWKSetCanBeDefinedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -39,9 +27,7 @@ public static function aJWKSetCanBeDefinedInTheConfiguration(): void static::assertInstanceOf(JWKSet::class, $container->get('jose.key_set.jwkset1')); } - /** - * @test - */ + #[Test] public static function aJWKSetCanBeSharedInTheConfiguration(): void { static::ensureKernelShutdown(); @@ -59,9 +45,7 @@ public static function aJWKSetCanBeSharedInTheConfiguration(): void static::assertSame('application/jwk-set+json; charset=UTF-8', $response->headers->get('Content-Type')); } - /** - * @test - */ + #[Test] public static function aJWKSetCanBeDefinedFromAnotherBundle(): void { static::ensureKernelShutdown(); @@ -72,9 +56,7 @@ public static function aJWKSetCanBeDefinedFromAnotherBundle(): void static::assertInstanceOf(JWKSet::class, $container->get('jose.key_set.jwkset2')); } - /** - * @test - */ + #[Test] public static function aJWKSetCanBeSharedFromAnotherBundle(): void { static::ensureKernelShutdown(); @@ -92,21 +74,21 @@ public static function aJWKSetCanBeSharedFromAnotherBundle(): void static::assertSame('application/jwk-set+json; charset=UTF-8', $response->headers->get('Content-Type')); } - /** - * @test - */ + #[Test] public static function aJWKSetCanBeRetrieveFromADistantJkuThroughConfiguration(): void { static::ensureKernelShutdown(); $client = static::createClient(); $container = $client->getContainer(); - $response = static::$messageFactory->createResponse(200); - $response->getBody() - ->write( - '{"keys": [{"kty": "RSA","alg": "RS256","use": "sig","kid": "acde8d7c1997d82dcf5d5ed2858ac8d060cd3ca9","n": "kfQP58EQpxAqZUCiGolkyCio8S3hG9HTMfQpB7VVDB69mK3AN68ZmWeGTIvDnbcslQ1TEhjZ8bKJwWHFlyoJOxeGaEsn0G3xAmPeUW8WjS2tLTKx8DUYOAgto9VOWip5dngZVMrCL85fPk-jiKEL3ODsyddZiOOhBEjapco_RTDPVurVreDnG6mbScCslHda5T6KudyFOQLD77BulIENlpE5Lxh3KFGrGgu_RiVOf-XtHDDExiWOsaUhOSZFkecqF56upROBQRIuNqHv98icbVKRzYcDteRckJGfk12faaQhX24QCDsIrT8NHbbB9eKX7rcnDMp8GxSArct7KyOxyw","e": "AQAB"},{"kty": "RSA","alg": "RS256","use": "sig","kid": "ce760dff481ee9bca45ccab64eada328029bc0aa","n": "47QQ2Ru1h3WWxcTUbwQvhD_ncEw7avXtXDmcY_8zxC9FcPwv6GcAvjoWuF0afBNK4UoNqW9gG_eq96FnMUF0iIVkPio-h3cpOHzAhKN-LHB9UMx3WDCVYxeRjGOgKU8oLz7ioqGhyZc-oxWk0v691Ybp83OPhWa0bVAmTgSaAuPpyw-ZLg-Nb4eF---vjb1N0ptYltSOQNEZ3BK9jEbWKNHASTcTpFkigcWyLp_sFv79W_DLZEKIb4TxaoGGWA-AMiErFsAnzcU7Ia4ETyp5ucI6o4SifKzI1SKRkUTinlVnvedwXhu21HBviEe_a-fg3uYc7JTMgFNG3kQlfks8AQ","e": "AQAB"},{"kty": "RSA","alg": "RS256","use": "sig","kid": "3ce4a97d502af058eb66ac8d730a592ab7cea7f1","n": "5JjYSEt7lxpIBtnZSAta6uPZpiAFSwzRhhWdBbRr1QuEMPhBvfWsy0PArA8xx5U8AIWftTmhsTdXvkLRLrG_vT4fxjU22K2YBoeTY2v2QIvJOUyhLWOr5wVtG9iWtg86FsGv0ukEgEpx2mqIlpz0KWkEZwIhtYRTtFQh_G4QFjvyAg70iFi7BvSizfZlEDrg5-5ksia0Gy_gmjGvgTLHGBLciKo5d5Aw-DBPJqunnJacVu6rTkBF_QgsOWpO5Y8XuKbjEKNzUHSv6TxumaK7ueU1ckucdtkAHqURzEInbb3BxWYme_3JCzTDMRy4-pEoWR-NyLZwEZxxOtGFQRXhZw","e": "AQAB"}]}' - ); - $response->getBody() - ->rewind(); + $response = new MockResponse( + '{"keys": [{"kty": "RSA","alg": "RS256","use": "sig","kid": "acde8d7c1997d82dcf5d5ed2858ac8d060cd3ca9","n": "kfQP58EQpxAqZUCiGolkyCio8S3hG9HTMfQpB7VVDB69mK3AN68ZmWeGTIvDnbcslQ1TEhjZ8bKJwWHFlyoJOxeGaEsn0G3xAmPeUW8WjS2tLTKx8DUYOAgto9VOWip5dngZVMrCL85fPk-jiKEL3ODsyddZiOOhBEjapco_RTDPVurVreDnG6mbScCslHda5T6KudyFOQLD77BulIENlpE5Lxh3KFGrGgu_RiVOf-XtHDDExiWOsaUhOSZFkecqF56upROBQRIuNqHv98icbVKRzYcDteRckJGfk12faaQhX24QCDsIrT8NHbbB9eKX7rcnDMp8GxSArct7KyOxyw","e": "AQAB"},{"kty": "RSA","alg": "RS256","use": "sig","kid": "ce760dff481ee9bca45ccab64eada328029bc0aa","n": "47QQ2Ru1h3WWxcTUbwQvhD_ncEw7avXtXDmcY_8zxC9FcPwv6GcAvjoWuF0afBNK4UoNqW9gG_eq96FnMUF0iIVkPio-h3cpOHzAhKN-LHB9UMx3WDCVYxeRjGOgKU8oLz7ioqGhyZc-oxWk0v691Ybp83OPhWa0bVAmTgSaAuPpyw-ZLg-Nb4eF---vjb1N0ptYltSOQNEZ3BK9jEbWKNHASTcTpFkigcWyLp_sFv79W_DLZEKIb4TxaoGGWA-AMiErFsAnzcU7Ia4ETyp5ucI6o4SifKzI1SKRkUTinlVnvedwXhu21HBviEe_a-fg3uYc7JTMgFNG3kQlfks8AQ","e": "AQAB"},{"kty": "RSA","alg": "RS256","use": "sig","kid": "3ce4a97d502af058eb66ac8d730a592ab7cea7f1","n": "5JjYSEt7lxpIBtnZSAta6uPZpiAFSwzRhhWdBbRr1QuEMPhBvfWsy0PArA8xx5U8AIWftTmhsTdXvkLRLrG_vT4fxjU22K2YBoeTY2v2QIvJOUyhLWOr5wVtG9iWtg86FsGv0ukEgEpx2mqIlpz0KWkEZwIhtYRTtFQh_G4QFjvyAg70iFi7BvSizfZlEDrg5-5ksia0Gy_gmjGvgTLHGBLciKo5d5Aw-DBPJqunnJacVu6rTkBF_QgsOWpO5Y8XuKbjEKNzUHSv6TxumaK7ueU1ckucdtkAHqURzEInbb3BxWYme_3JCzTDMRy4-pEoWR-NyLZwEZxxOtGFQRXhZw","e": "AQAB"}]}', + [ + 'http_code' => 200, + 'response_headers' => [ + 'content-type' => 'application/json', + ], + ] + ); /** @var MockClientCallback $httpClient */ $httpClient = $container->get(MockClientCallback::class); $httpClient->set($response); @@ -116,21 +98,16 @@ public static function aJWKSetCanBeRetrieveFromADistantJkuThroughConfiguration() static::assertInstanceOf(JWKSet::class, $container->get('jose.key_set.jku1')); } - /** - * @test - */ + #[Test] public static function aJWKSetCanBeRetrieveFromADistantX5uThroughConfiguration(): void { static::ensureKernelShutdown(); $client = static::createClient(); $container = $client->getContainer(); - $response = static::$messageFactory->createResponse(200); - $response->getBody() - ->write( - '["MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVM\nxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR2\n8gRGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExM\nTYwMTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UE\nCBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWR\nkeS5jb20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYW\nRkeS5jb20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIEN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heQ\nC1u+mNr0HZDzTuIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMM\nj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd"]' + ); + /** @var MockClientCallback $httpClient */ $httpClient = $container->get(MockClientCallback::class); $httpClient->set($response); diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/JwkUriConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/JwkUriConfigurationTest.php index 63413b993..3cc608f37 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/JwkUriConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/JwkUriConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\KeyManagementSource; use Jose\Component\KeyManagement\JWKFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoKeySetIdIsSet(): void { $this->assertConfigurationIsInvalid( @@ -74,9 +67,7 @@ public function theConfigurationIsInvalidIfNoKeySetIdIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoPathIsSet(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/KeyConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/KeyConfigurationTest.php index 364c42792..1a3b69257 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/KeyConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/KeyConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\KeyManagementSource; use Jose\Component\KeyManagement\JWKFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoKeyTypeIsSet(): void { $this->assertConfigurationIsInvalid( @@ -74,9 +67,7 @@ public function theConfigurationIsInvalidIfNoKeyTypeIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfAnUnsupportedKeyTypeIsSet(): void { $this->assertConfigurationIsInvalid( @@ -93,9 +84,7 @@ public function theConfigurationIsInvalidIfAnUnsupportedKeyTypeIsSet(): void ); } - /** - * @test - */ + #[Test] public function theCertificateConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -112,9 +101,7 @@ public function theCertificateConfigurationIsInvalidIfRequiredParametersAreNotSe ); } - /** - * @test - */ + #[Test] public function theJwkConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -131,9 +118,7 @@ public function theJwkConfigurationIsInvalidIfRequiredParametersAreNotSet(): voi ); } - /** - * @test - */ + #[Test] public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -150,9 +135,7 @@ public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet(): ); } - /** - * @test - */ + #[Test] public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet2(): void { $this->assertConfigurationIsInvalid( @@ -171,9 +154,7 @@ public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet2(): ); } - /** - * @test - */ + #[Test] public function theKeyFileConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -190,9 +171,7 @@ public function theKeyFileConfigurationIsInvalidIfRequiredParametersAreNotSet(): ); } - /** - * @test - */ + #[Test] public function theValuesConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -209,9 +188,7 @@ public function theValuesConfigurationIsInvalidIfRequiredParametersAreNotSet(): ); } - /** - * @test - */ + #[Test] public function theX5CConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/KeyManagement/KeySetConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/KeyManagement/KeySetConfigurationTest.php index 9d9eb9f76..167c92e45 100644 --- a/tests/Bundle/JoseFramework/Functional/KeyManagement/KeySetConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/KeyManagement/KeySetConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\KeyManagement\KeyManagementSource; use Jose\Component\KeyManagement\JWKFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoKeySetTypeIsSet(): void { $this->assertConfigurationIsInvalid( @@ -74,9 +67,7 @@ public function theConfigurationIsInvalidIfNoKeySetTypeIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfAnUnsupportedKeySetTypeIsSet(): void { $this->assertConfigurationIsInvalid( @@ -93,9 +84,7 @@ public function theConfigurationIsInvalidIfAnUnsupportedKeySetTypeIsSet(): void ); } - /** - * @test - */ + #[Test] public function theJkuConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -112,9 +101,7 @@ public function theJkuConfigurationIsInvalidIfRequiredParametersAreNotSet(): voi ); } - /** - * @test - */ + #[Test] public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( @@ -131,9 +118,7 @@ public function theJwkSetConfigurationIsInvalidIfRequiredParametersAreNotSet(): ); } - /** - * @test - */ + #[Test] public function theX5UConfigurationIsInvalidIfRequiredParametersAreNotSet(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderConfigurationTest.php index 9628c7110..e89bb31c7 100644 --- a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderConfigurationTest.php @@ -12,6 +12,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature\SignatureSource; use Jose\Bundle\JoseFramework\Services\NestedTokenLoaderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -28,17 +29,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -48,9 +45,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -60,9 +55,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoBuilderIsSet(): void { $this->assertConfigurationIsValid([ @@ -74,9 +67,7 @@ public function theConfigurationIsValidIfNoBuilderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoSignatureAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -93,9 +84,7 @@ public function theConfigurationIsInvalidIfNoSignatureAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoKeyEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -114,9 +103,7 @@ public function theConfigurationIsInvalidIfNoKeyEncryptionAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoContentEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -136,9 +123,7 @@ public function theConfigurationIsInvalidIfNoContentEncryptionAlgorithmIsSet(): ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoJwsSerializerIsSet(): void { $this->assertConfigurationIsInvalid( @@ -159,9 +144,7 @@ public function theConfigurationIsInvalidIfNoJwsSerializerIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoJweSerializerIsSet(): void { $this->assertConfigurationIsInvalid( @@ -183,9 +166,7 @@ public function theConfigurationIsInvalidIfNoJweSerializerIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsValid(): void { $this->assertConfigurationIsValid( diff --git a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderTest.php b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderTest.php index 006e40140..c3cc6e597 100644 --- a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderTest.php +++ b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenBuilderTest.php @@ -8,6 +8,7 @@ use Jose\Bundle\JoseFramework\Services\NestedTokenLoaderFactory; use Jose\Component\Core\JWK; use Jose\Component\NestedToken\NestedTokenBuilder; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; /** @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theNestedTokenBuilderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theNestedTokenBuilderFactoryIsAvailable(): void static::assertTrue($container->has(NestedTokenBuilderFactory::class)); } - /** - * @test - */ + #[Test] public static function theNestedTokenBuilderFromTheConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -46,9 +43,7 @@ public static function theNestedTokenBuilderFromTheConfigurationIsAvailable(): v static::assertTrue($container->has('jose.nested_token_builder.nested_token_builder_1')); } - /** - * @test - */ + #[Test] public static function theNestedTokenBuilderFromTheConfigurationHelperIsAvailable(): void { static::ensureKernelShutdown(); @@ -58,9 +53,7 @@ public static function theNestedTokenBuilderFromTheConfigurationHelperIsAvailabl static::assertTrue($container->has('jose.nested_token_builder.nested_token_builder_2')); } - /** - * @test - */ + #[Test] public static function aNestedTokenCanBeSignedAndEncryptedUsingTheServiceCreatedFromTheConfiguration(): void { static::ensureKernelShutdown(); @@ -123,9 +116,7 @@ public static function aNestedTokenCanBeSignedAndEncryptedUsingTheServiceCreated ); } - /** - * @test - */ + #[Test] public static function aNestedTokenCanBeSignedAndEncryptedUsingTheServiceCreatedFromTheConfigurationHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderConfigurationTest.php index f18281bf9..303e1fa18 100644 --- a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderConfigurationTest.php @@ -12,6 +12,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature\SignatureSource; use Jose\Component\Encryption\JWELoaderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -28,17 +29,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -48,9 +45,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -60,9 +55,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoLoaderIsSet(): void { $this->assertConfigurationIsValid([ @@ -74,9 +67,7 @@ public function theConfigurationIsValidIfNoLoaderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoSignatureAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -93,9 +84,7 @@ public function theConfigurationIsInvalidIfNoSignatureAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoKeyEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -114,9 +103,7 @@ public function theConfigurationIsInvalidIfNoKeyEncryptionAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoContentEncryptionAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -136,9 +123,7 @@ public function theConfigurationIsInvalidIfNoContentEncryptionAlgorithmIsSet(): ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoJwsSerializerIsSet(): void { $this->assertConfigurationIsInvalid( @@ -159,9 +144,7 @@ public function theConfigurationIsInvalidIfNoJwsSerializerIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoJweSerializerIsSet(): void { $this->assertConfigurationIsInvalid( @@ -183,9 +166,7 @@ public function theConfigurationIsInvalidIfNoJweSerializerIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsValid(): void { $this->assertConfigurationIsValid( diff --git a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderTest.php b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderTest.php index 993ea364a..0cf33af60 100644 --- a/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/NestedToken/NestedTokenLoaderTest.php @@ -8,6 +8,7 @@ use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\NestedToken\NestedTokenLoader; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; /** @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theNestedTokenLoaderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theNestedTokenLoaderFactoryIsAvailable(): void static::assertTrue($container->has(NestedTokenLoaderFactory::class)); } - /** - * @test - */ + #[Test] public static function theNestedTokenLoaderFromTheConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -46,9 +43,7 @@ public static function theNestedTokenLoaderFromTheConfigurationIsAvailable(): vo static::assertTrue($container->has('jose.nested_token_loader.nested_token_loader_1')); } - /** - * @test - */ + #[Test] public static function theNestedTokenLoaderFromTheConfigurationHelperIsAvailable(): void { static::ensureKernelShutdown(); @@ -58,9 +53,7 @@ public static function theNestedTokenLoaderFromTheConfigurationHelperIsAvailable static::assertTrue($container->has('jose.nested_token_loader.nested_token_loader_2')); } - /** - * @test - */ + #[Test] public static function aNestedTokenCanBeDecryptedAndVerifiedUsingTheServiceCreatedFromTheConfiguration(): void { static::ensureKernelShutdown(); @@ -110,9 +103,7 @@ public static function aNestedTokenCanBeDecryptedAndVerifiedUsingTheServiceCreat static::assertSame(0, $signature); } - /** - * @test - */ + #[Test] public static function aNestedTokenCanBeDecryptedAndVerifiedUsingTheServiceCreatedFromTheConfigurationHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Serializer/JWEEncoderTest.php b/tests/Bundle/JoseFramework/Functional/Serializer/JWEEncoderTest.php index a70d44809..1354f2c9d 100644 --- a/tests/Bundle/JoseFramework/Functional/Serializer/JWEEncoderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Serializer/JWEEncoderTest.php @@ -13,6 +13,8 @@ use Jose\Component\Encryption\Serializer\CompactSerializer; use Jose\Component\Encryption\Serializer\JWESerializerManager; use Jose\Component\Encryption\Serializer\JWESerializerManagerFactory; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Serializer\Encoder\DecoderInterface; use Symfony\Component\Serializer\Encoder\EncoderInterface; @@ -33,10 +35,8 @@ protected function setUp(): void } } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function theJWEEncoderSupportsAllFormatsByDefault(string $format, string $serializerId): void { $container = static::getContainer(); @@ -47,10 +47,8 @@ public function theJWEEncoderSupportsAllFormatsByDefault(string $format, string static::assertTrue($serializer->supportsDecoding($format)); } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function aJWECanBeEncodedInAllFormats(string $format, string $serializerId): void { $container = static::getContainer(); @@ -64,10 +62,8 @@ public function aJWECanBeEncodedInAllFormats(string $format, string $serializerI static::assertSame(0, $this->loadJWE($jweString, $jwk)); } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function aJWECanBeEncodedWithSpecificRecipient(string $format, string $serializerId): void { $container = static::getContainer(); @@ -92,10 +88,8 @@ public function aJWECanBeEncodedWithSpecificRecipient(string $format, string $se static::assertSame($format === 'jwe_json_general' ? 1 : 0, $this->loadJWE($jweString, $jwk2)); } - /** - * @test - * @dataProvider encoderServiceDataProvider - */ + #[DataProvider('encoderServiceDataProvider')] + #[Test] public function theJWEEncoderThrowsOnNonExistingRecipient(string $serializerId): void { $container = static::getContainer(); @@ -110,9 +104,7 @@ public function theJWEEncoderThrowsOnNonExistingRecipient(string $serializerId): ]); } - /** - * @test - */ + #[Test] public function aJWECanBeEncodedWithCustomSerializerManager(): void { $container = static::getContainer(); @@ -136,9 +128,7 @@ public function aJWECanBeEncodedWithCustomSerializerManager(): void static::assertSame(0, $this->loadJWE($jweString, $jwk)); } - /** - * @test - */ + #[Test] public function theJWEEncoderShouldThrowOnUnsupportedFormatWhenEncoding(): void { $container = static::getContainer(); @@ -154,10 +144,8 @@ public function theJWEEncoderShouldThrowOnUnsupportedFormatWhenEncoding(): void $serializer->encode($jwe, 'jwe_json_flattened'); } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function aJWECanBeDecodedInAllFormats(string $format, string $serializerId): void { $container = static::getContainer(); @@ -170,9 +158,7 @@ public function aJWECanBeDecodedInAllFormats(string $format, string $serializerI static::assertInstanceOf(JWE::class, $jwe); } - /** - * @test - */ + #[Test] public function theJWEEncoderShouldThrowOnUnsupportedFormatWhenDecoding(): void { $container = static::getContainer(); diff --git a/tests/Bundle/JoseFramework/Functional/Serializer/JWESerializerTest.php b/tests/Bundle/JoseFramework/Functional/Serializer/JWESerializerTest.php index c8a3c8a4f..833a5c973 100644 --- a/tests/Bundle/JoseFramework/Functional/Serializer/JWESerializerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Serializer/JWESerializerTest.php @@ -11,6 +11,8 @@ use Jose\Component\Encryption\JWEBuilderFactory as BaseJWEBuilderFactory; use Jose\Component\Encryption\Serializer\JWESerializerManager; use Jose\Component\Encryption\Serializer\JWESerializerManagerFactory; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -31,10 +33,8 @@ protected function setUp(): void } } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function theJWESerializerSupportsAllFormatsByDefault(string $format, string $serializerId): void { $container = static::getContainer(); @@ -43,9 +43,7 @@ public function theJWESerializerSupportsAllFormatsByDefault(string $format, stri static::assertTrue($serializer->supportsDenormalization(null, JWE::class, $format)); } - /** - * @test - */ + #[Test] public static function aJWECannotBeNormalized(): void { $container = static::getContainer(); @@ -57,10 +55,8 @@ public static function aJWECannotBeNormalized(): void static::assertFalse(method_exists($serializer, 'supportsNormalization')); } - /** - * @test - * @dataProvider jweFormatDataProvider - */ + #[DataProvider('jweFormatDataProvider')] + #[Test] public function theJWEDenormalizerPassesThrough(string $format, string $serializerId): void { $container = static::getContainer(); @@ -73,12 +69,10 @@ public function theJWEDenormalizerPassesThrough(string $format, string $serializ static::assertSame($jwe, $serializer->denormalize($jwe, JWE::class, $format)); } - public function serializerServiceDataProvider(): array + public function serializerServiceDataProvider(): iterable { - return [ - 'indirect serializer' => ['serializer'], - 'direct serializer' => [JWESerializer::class], - ]; + yield 'indirect serializer' => ['serializer']; + yield 'direct serializer' => [JWESerializer::class]; } public static function jweFormatDataProvider(): iterable diff --git a/tests/Bundle/JoseFramework/Functional/Serializer/JWSEncoderTest.php b/tests/Bundle/JoseFramework/Functional/Serializer/JWSEncoderTest.php index 2cdfdb71b..f939224ce 100644 --- a/tests/Bundle/JoseFramework/Functional/Serializer/JWSEncoderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Serializer/JWSEncoderTest.php @@ -12,6 +12,8 @@ use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JWSSerializerManager; use Jose\Component\Signature\Serializer\JWSSerializerManagerFactory; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Serializer\Encoder\DecoderInterface; use Symfony\Component\Serializer\Encoder\EncoderInterface; @@ -32,10 +34,8 @@ protected function setUp(): void } } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function theJWSSerializerSupportsAllFormatsByDefault(string $format, string $serializerId): void { $container = static::getContainer(); @@ -46,10 +46,8 @@ public function theJWSSerializerSupportsAllFormatsByDefault(string $format, stri static::assertTrue($serializer->supportsDecoding($format)); } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function aJWSCanBeEncodedInAllFormats(string $format, string $serializerId): void { $container = static::getContainer(); @@ -67,10 +65,8 @@ public function aJWSCanBeEncodedInAllFormats(string $format, string $serializerI static::assertSame($expected[$format], $jwsString); } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function aJWSCanBeEncodedWithSpecificSignature(string $format, string $serializerId): void { $container = static::getContainer(); @@ -102,9 +98,7 @@ public function aJWSCanBeEncodedWithSpecificSignature(string $format, string $se static::assertSame($expected[$format], $jwsString); } - /** - * @test - */ + #[Test] public static function aJWSCanBeEncodedWithCustomSerializerManager(): void { $container = static::getContainer(); @@ -129,9 +123,7 @@ public static function aJWSCanBeEncodedWithCustomSerializerManager(): void ); } - /** - * @test - */ + #[Test] public function theJWSSerializerShouldThrowOnUnsupportedFormatWhenEncoding(): void { $container = static::getContainer(); @@ -147,10 +139,8 @@ public function theJWSSerializerShouldThrowOnUnsupportedFormatWhenEncoding(): vo $serializer->encode($jws, 'jws_json_flattened'); } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function aJWSCanBeDecodedInAllFormats(string $format, string $serializerId): void { $container = static::getContainer(); @@ -164,9 +154,7 @@ public function aJWSCanBeDecodedInAllFormats(string $format, string $serializerI static::assertEqualsCanonicalizing($jwsData['jws'], $jws); } - /** - * @test - */ + #[Test] public function theJWSSerializerShouldThrowOnUnsupportedFormatWhenDecoding(): void { $container = static::getContainer(); @@ -182,12 +170,10 @@ public function theJWSSerializerShouldThrowOnUnsupportedFormatWhenDecoding(): vo $serializer->decode($jwsString, 'jws_json_flattened'); } - public function serializerServiceDataProvider(): array + public function serializerServiceDataProvider(): iterable { - return [ - 'indirect serializer' => ['serializer'], - 'direct serializer' => [JWSEncoder::class], - ]; + yield 'indirect serializer' => ['serializer']; + yield 'direct serializer' => [JWSEncoder::class]; } public static function jwsFormatDataProvider(): iterable diff --git a/tests/Bundle/JoseFramework/Functional/Serializer/JWSSerializerTest.php b/tests/Bundle/JoseFramework/Functional/Serializer/JWSSerializerTest.php index c160698e0..4ef00a410 100644 --- a/tests/Bundle/JoseFramework/Functional/Serializer/JWSSerializerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Serializer/JWSSerializerTest.php @@ -11,6 +11,8 @@ use Jose\Component\Signature\JWSBuilderFactory as BaseJWSBuilderFactory; use Jose\Component\Signature\Serializer\JWSSerializerManager; use Jose\Component\Signature\Serializer\JWSSerializerManagerFactory; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -31,10 +33,8 @@ protected function setUp(): void } } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function theJWSSerializerSupportsAllFormatsByDefault(string $format, string $serializerId): void { $container = static::getContainer(); @@ -43,9 +43,7 @@ public function theJWSSerializerSupportsAllFormatsByDefault(string $format, stri static::assertTrue($serializer->supportsDenormalization(null, JWS::class, $format)); } - /** - * @test - */ + #[Test] public static function aJWSCannotBeNormalized(): void { $container = static::getContainer(); @@ -57,10 +55,8 @@ public static function aJWSCannotBeNormalized(): void static::assertFalse(method_exists($serializer, 'supportsNormalization')); } - /** - * @test - * @dataProvider jwsFormatDataProvider - */ + #[DataProvider('jwsFormatDataProvider')] + #[Test] public function theJWSDenormalizerPassesThrough(string $format, string $serializerId): void { $container = static::getContainer(); @@ -73,12 +69,10 @@ public function theJWSDenormalizerPassesThrough(string $format, string $serializ static::assertSame($jws, $serializer->denormalize($jws, JWS::class, $format)); } - public function serializerServiceDataProvider(): array + public function serializerServiceDataProvider(): iterable { - return [ - 'indirect serializer' => ['serializer'], - 'direct serializer' => [JWSSerializer::class], - ]; + yield 'indirect serializer' => ['serializer']; + yield 'direct serializer' => [JWSSerializer::class]; } public static function jwsFormatDataProvider(): iterable diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JWSBuilderTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JWSBuilderTest.php index 91bd63c70..d95d26750 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JWSBuilderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JWSBuilderTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWSBuilder; use Jose\Bundle\JoseFramework\Services\JWSBuilderFactory as JWSBuilderFactoryService; use Jose\Component\Signature\JWSBuilderFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function jWSBuilderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function jWSBuilderFactoryIsAvailable(): void static::assertTrue($container->has(JWSBuilderFactoryService::class)); } - /** - * @test - */ + #[Test] public static function jWSBuilderFactoryCanCreateAJWSBuilder(): void { static::ensureKernelShutdown(); @@ -52,9 +49,7 @@ public static function jWSBuilderFactoryCanCreateAJWSBuilder(): void static::assertInstanceOf(JWSBuilder::class, $jws); } - /** - * @test - */ + #[Test] public static function jWSBuilderFromConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -67,9 +62,7 @@ public static function jWSBuilderFromConfigurationIsAvailable(): void static::assertInstanceOf(JWSBuilder::class, $jws); } - /** - * @test - */ + #[Test] public static function jWSBuilderFromExternalBundleExtensionIsAvailable(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JWSComputationTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JWSComputationTest.php index 89fb0ceb6..6eb985b81 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JWSComputationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JWSComputationTest.php @@ -9,6 +9,7 @@ use Jose\Component\Signature\JWSBuilderFactory; use Jose\Component\Signature\JWSVerifier; use Jose\Component\Signature\Serializer\CompactSerializer; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -24,9 +25,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function createAndLoadAToken(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JWSLoaderTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JWSLoaderTest.php index 2d75c36ec..96d10546b 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JWSLoaderTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JWSLoaderTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWSLoaderFactory as JWSLoaderFactoryService; use Jose\Component\Signature\JWSLoader; use Jose\Component\Signature\JWSLoaderFactory; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function theJWSLoaderFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function theJWSLoaderFactoryIsAvailable(): void static::assertTrue($container->has(JWSLoaderFactoryService::class)); } - /** - * @test - */ + #[Test] public static function theWELoaderFactoryCanCreateAJWSLoader(): void { static::ensureKernelShutdown(); @@ -53,9 +50,7 @@ public static function theWELoaderFactoryCanCreateAJWSLoader(): void static::assertSame(['RS512'], $jws->getJwsVerifier()->getSignatureAlgorithmManager()->list()); } - /** - * @test - */ + #[Test] public static function aJWSLoaderCanBeDefinedUsingTheConfigurationFile(): void { static::ensureKernelShutdown(); @@ -68,9 +63,7 @@ public static function aJWSLoaderCanBeDefinedUsingTheConfigurationFile(): void static::assertInstanceOf(JWSLoader::class, $jws); } - /** - * @test - */ + #[Test] public static function aJWSLoaderCanBeDefinedFromAnotherBundleUsingTheHelper(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JWSSerializerTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JWSSerializerTest.php index e7a10c615..53982cd6c 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JWSSerializerTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JWSSerializerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Signature\JWSBuilderFactory; use Jose\Component\Signature\Serializer\JWSSerializerManager; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,9 +22,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function jWSSerializerManagerFromConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -36,9 +35,7 @@ public static function jWSSerializerManagerFromConfigurationIsAvailable(): void static::assertInstanceOf(JWSSerializerManager::class, $jws); } - /** - * @test - */ + #[Test] public static function jWSSerializerManagerFromExternalBundleExtensionIsAvailable(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JWSVerifierTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JWSVerifierTest.php index 80989d55c..49070543a 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JWSVerifierTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JWSVerifierTest.php @@ -7,6 +7,7 @@ use Jose\Bundle\JoseFramework\Services\JWSVerifierFactory as JWSVerifierFactoryService; use Jose\Component\Signature\JWSBuilderFactory; use Jose\Component\Signature\JWSVerifier; +use PHPUnit\Framework\Attributes\Test; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public static function jWSVerifierFactoryIsAvailable(): void { static::ensureKernelShutdown(); @@ -34,9 +33,7 @@ public static function jWSVerifierFactoryIsAvailable(): void static::assertTrue($container->has(JWSVerifierFactoryService::class)); } - /** - * @test - */ + #[Test] public static function jWSVerifierFactoryCanCreateAJWSVerifier(): void { static::ensureKernelShutdown(); @@ -50,9 +47,7 @@ public static function jWSVerifierFactoryCanCreateAJWSVerifier(): void $jwsFactory->create(['none']); } - /** - * @test - */ + #[Test] public static function jWSVerifierFromConfigurationIsAvailable(): void { static::ensureKernelShutdown(); @@ -65,9 +60,7 @@ public static function jWSVerifierFromConfigurationIsAvailable(): void static::assertInstanceOf(JWSVerifier::class, $jws); } - /** - * @test - */ + #[Test] public static function jWSVerifierFromExternalBundleExtensionIsAvailable(): void { static::ensureKernelShutdown(); diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JwsBuilderConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JwsBuilderConfigurationTest.php index 58e8f2505..c4d801b0c 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JwsBuilderConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JwsBuilderConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature\SignatureSource; use Jose\Component\Signature\JWSBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfBuilderIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsInvalidIfBuilderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotSignatureAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNotSignatureAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheSignatureAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/Signature/JwsVerifierConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Signature/JwsVerifierConfigurationTest.php index d29b9feac..a130265b4 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/JwsVerifierConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/JwsVerifierConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature\SignatureSource; use Jose\Component\Signature\JWSBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfBuilderIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsInvalidIfBuilderIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNotSignatureAlgorithmIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNotSignatureAlgorithmIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheSignatureAlgorithmIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/Functional/Signature/SerializerConfigurationTest.php b/tests/Bundle/JoseFramework/Functional/Signature/SerializerConfigurationTest.php index 78fa65930..aa72a3bbd 100644 --- a/tests/Bundle/JoseFramework/Functional/Signature/SerializerConfigurationTest.php +++ b/tests/Bundle/JoseFramework/Functional/Signature/SerializerConfigurationTest.php @@ -9,6 +9,7 @@ use Jose\Bundle\JoseFramework\DependencyInjection\Source\Signature\SignatureSource; use Jose\Component\Signature\JWSBuilderFactory; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -25,17 +26,13 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoConfigurationIsSet(): void { $this->assertConfigurationIsValid([]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsFalse(): void { $this->assertConfigurationIsValid([ @@ -45,9 +42,7 @@ public function theConfigurationIsValidIfConfigurationIsFalse(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfConfigurationIsEmpty(): void { $this->assertConfigurationIsValid([ @@ -57,9 +52,7 @@ public function theConfigurationIsValidIfConfigurationIsEmpty(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsValidIfNoSerializerIsSet(): void { $this->assertConfigurationIsValid([ @@ -71,9 +64,7 @@ public function theConfigurationIsValidIfNoSerializerIsSet(): void ]); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfNoSerializerParameterIsSet(): void { $this->assertConfigurationIsInvalid( @@ -90,9 +81,7 @@ public function theConfigurationIsInvalidIfNoSerializerParameterIsSet(): void ); } - /** - * @test - */ + #[Test] public function theConfigurationIsInvalidIfTheSerializerListIsEmpty(): void { $this->assertConfigurationIsInvalid( diff --git a/tests/Bundle/JoseFramework/TestBundle/Checker/CustomChecker.php b/tests/Bundle/JoseFramework/TestBundle/Checker/CustomChecker.php index 7c7fb79dc..c38483788 100644 --- a/tests/Bundle/JoseFramework/TestBundle/Checker/CustomChecker.php +++ b/tests/Bundle/JoseFramework/TestBundle/Checker/CustomChecker.php @@ -10,9 +10,6 @@ class CustomChecker implements ClaimChecker, HeaderChecker { - /** - * {@inheritdoc} - */ public function checkClaim($value): void { if ($value === true) { @@ -25,9 +22,6 @@ public function supportedClaim(): string return 'custom'; } - /** - * {@inheritdoc} - */ public function checkHeader($value): void { if ($value === true) { diff --git a/tests/Bundle/JoseFramework/TestBundle/Service/MockClientCallback.php b/tests/Bundle/JoseFramework/TestBundle/Service/MockClientCallback.php index 66796938c..1bbdc0d12 100644 --- a/tests/Bundle/JoseFramework/TestBundle/Service/MockClientCallback.php +++ b/tests/Bundle/JoseFramework/TestBundle/Service/MockClientCallback.php @@ -4,21 +4,28 @@ namespace Jose\Tests\Bundle\JoseFramework\TestBundle\Service; -use Psr\Http\Client\ClientInterface; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; +use Symfony\Component\HttpClient\MockHttpClient; +use Symfony\Component\HttpClient\Response\MockResponse; -final class MockClientCallback implements ClientInterface +final class MockClientCallback extends MockHttpClient { - private ?ResponseInterface $response = null; + private null|MockResponse $response = null; - public function set(ResponseInterface $response): void + public function __invoke(string $method, string $url, array $options = []): ?MockResponse { - $this->response = $response; + if ($this->response === null) { + throw new RuntimeException(sprintf( + 'Unable to find a response for a %s request to the URL %s', + $method, + $url + )); + } + + return $this->response; } - public function sendRequest(RequestInterface $request): ResponseInterface + public function set(MockResponse $response): void { - return $this->response; + $this->response = $response; } } diff --git a/tests/Bundle/JoseFramework/config/config_test.yml b/tests/Bundle/JoseFramework/config/config_test.yml index 3b0cf479b..d4f92de8e 100644 --- a/tests/Bundle/JoseFramework/config/config_test.yml +++ b/tests/Bundle/JoseFramework/config/config_test.yml @@ -9,18 +9,18 @@ framework: strict_requirements: ~ fragments: ~ http_method_override: true + http_client: + mock_response_factory: 'Jose\Tests\Bundle\JoseFramework\TestBundle\Service\MockClientCallback' services: _defaults: public: true - Nyholm\Psr7\Factory\Psr17Factory: ~ Jose\Tests\Bundle\JoseFramework\TestBundle\Service\MockClientCallback: ~ jose: jku_factory: enabled: true - client: 'Jose\Tests\Bundle\JoseFramework\TestBundle\Service\MockClientCallback' - request_factory: 'Nyholm\Psr7\Factory\Psr17Factory' + client: 'http_client' checkers: claims: checker1: diff --git a/tests/Component/Checker/AlgorithmHeaderCheckerTest.php b/tests/Component/Checker/AlgorithmHeaderCheckerTest.php index 906da50aa..b5e5d8b53 100644 --- a/tests/Component/Checker/AlgorithmHeaderCheckerTest.php +++ b/tests/Component/Checker/AlgorithmHeaderCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Checker\AlgorithmChecker; use Jose\Component\Checker\InvalidHeaderException; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class AlgorithmHeaderCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function anAlgorithmMustBeAString(): void { $this->expectException(InvalidHeaderException::class); @@ -25,9 +24,7 @@ public function anAlgorithmMustBeAString(): void $checker->checkHeader(1); } - /** - * @test - */ + #[Test] public function theAlgorithmHeaderIsNotAllowed(): void { $this->expectException(InvalidHeaderException::class); @@ -37,9 +34,7 @@ public function theAlgorithmHeaderIsNotAllowed(): void $checker->checkHeader('bar'); } - /** - * @test - */ + #[Test] public function theAlgorithmHeaderIsSupported(): void { $checker = new AlgorithmChecker(['foo']); diff --git a/tests/Component/Checker/AudienceClaimCheckerTest.php b/tests/Component/Checker/AudienceClaimCheckerTest.php index 03e14809c..9dfbd8574 100644 --- a/tests/Component/Checker/AudienceClaimCheckerTest.php +++ b/tests/Component/Checker/AudienceClaimCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Checker\AudienceChecker; use Jose\Component\Checker\InvalidClaimException; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class AudienceClaimCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function anAudienceClaimMustBeAStringOrAnArrayOfStrings(): void { $this->expectException(InvalidClaimException::class); @@ -25,9 +24,7 @@ public function anAudienceClaimMustBeAStringOrAnArrayOfStrings(): void $checker->checkClaim(1); } - /** - * @test - */ + #[Test] public function theAudienceClaimIsNotKnown(): void { $this->expectException(InvalidClaimException::class); @@ -37,9 +34,7 @@ public function theAudienceClaimIsNotKnown(): void $checker->checkClaim('bar'); } - /** - * @test - */ + #[Test] public function theAudienceClaimListDoesNotContainTheCurrentAudience(): void { $this->expectException(InvalidClaimException::class); @@ -49,9 +44,7 @@ public function theAudienceClaimListDoesNotContainTheCurrentAudience(): void $checker->checkClaim(['bar']); } - /** - * @test - */ + #[Test] public function theAudienceClaimIsSupported(): void { $checker = new AudienceChecker('foo'); diff --git a/tests/Component/Checker/AudienceHeaderCheckerTest.php b/tests/Component/Checker/AudienceHeaderCheckerTest.php index 32fa02672..787b7b481 100644 --- a/tests/Component/Checker/AudienceHeaderCheckerTest.php +++ b/tests/Component/Checker/AudienceHeaderCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Checker\AudienceChecker; use Jose\Component\Checker\InvalidHeaderException; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class AudienceHeaderCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function anAudienceHeaderMustBeAStringOrAnArrayOfStrings(): void { $this->expectException(InvalidHeaderException::class); @@ -25,9 +24,7 @@ public function anAudienceHeaderMustBeAStringOrAnArrayOfStrings(): void $checker->checkHeader(1); } - /** - * @test - */ + #[Test] public function theAudienceHeaderIsNotKnown(): void { $this->expectException(InvalidHeaderException::class); @@ -37,9 +34,7 @@ public function theAudienceHeaderIsNotKnown(): void $checker->checkHeader('bar'); } - /** - * @test - */ + #[Test] public function theAudienceHeaderListDoesNotContainTheCurrentAudience(): void { $this->expectException(InvalidHeaderException::class); @@ -49,9 +44,7 @@ public function theAudienceHeaderListDoesNotContainTheCurrentAudience(): void $checker->checkHeader(['bar']); } - /** - * @test - */ + #[Test] public function theAudienceHeaderIsSupported(): void { $checker = new AudienceChecker('foo'); diff --git a/tests/Component/Checker/CallableCheckerTest.php b/tests/Component/Checker/CallableCheckerTest.php new file mode 100644 index 000000000..84cfabf9b --- /dev/null +++ b/tests/Component/Checker/CallableCheckerTest.php @@ -0,0 +1,77 @@ +expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The $callable argument must be a callable.'); + + new CallableChecker('foo', 'not_a_callable'); + } + + #[Test] + public function theCallableDoesNotReturnABoolean(): void + { + $this->expectException(InvalidClaimException::class); + + $checker = new CallableChecker('foo', fn (mixed $value) => 1); + $checker->checkClaim('baz'); + + $this->expectException(InvalidHeaderException::class); + + $checker = new CallableChecker('foo', fn (mixed $value) => 0); + $checker->checkHeader('baz'); + } + + #[Test] + public function theClaimIsInvalid(): void + { + $this->expectException(InvalidClaimException::class); + + $checker = new CallableChecker('foo', fn (mixed $value) => $value === 'bar'); + $checker->checkClaim('baz'); + } + + #[Test] + public function theHeaderIsInvalid(): void + { + $this->expectException(InvalidHeaderException::class); + + $checker = new CallableChecker('foo', fn (mixed $value) => $value === 'bar'); + $checker->checkHeader('baz'); + } + + #[Test] + public function theClaimIsSupported(): void + { + $checker = new CallableChecker('foo', fn (mixed $value) => $value === 'bar'); + $checker->checkClaim('bar'); + + static::assertSame('foo', $checker->supportedClaim()); + } + + #[Test] + public function theHeaderIsSupported(): void + { + $checker = new CallableChecker('foo', fn (mixed $value) => $value === 'bar'); + $checker->checkHeader('bar'); + + static::assertSame('foo', $checker->supportedHeader()); + } +} diff --git a/tests/Component/Checker/ClaimCheckerManagerFactoryTest.php b/tests/Component/Checker/ClaimCheckerManagerFactoryTest.php index e5b6d5f80..ddb125ab8 100644 --- a/tests/Component/Checker/ClaimCheckerManagerFactoryTest.php +++ b/tests/Component/Checker/ClaimCheckerManagerFactoryTest.php @@ -12,6 +12,7 @@ use Jose\Component\Checker\MissingMandatoryClaimException; use Jose\Component\Checker\NotBeforeChecker; use Jose\Tests\Component\Checker\Stub\MockClock; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Psr\Clock\ClockInterface; @@ -22,17 +23,13 @@ final class ClaimCheckerManagerFactoryTest extends TestCase { private ?ClaimCheckerManagerFactory $claimCheckerManagerFactory = null; - /** - * @test - */ + #[Test] public function theAliasListOfTheClaimCheckerManagerFactoryIsAvailable(): void { static::assertSame(['exp', 'iat', 'nbf', 'aud'], $this->getClaimCheckerManagerFactory()->aliases()); } - /** - * @test - */ + #[Test] public function theAliasDoesNotExist(): void { $this->expectException(InvalidArgumentException::class); @@ -42,9 +39,7 @@ public function theAliasDoesNotExist(): void ->create(['foo']); } - /** - * @test - */ + #[Test] public function iCanCreateAClaimCheckerManager(): void { $manager = $this->getClaimCheckerManagerFactory() @@ -52,9 +47,7 @@ public function iCanCreateAClaimCheckerManager(): void static::assertCount(4, $manager->getCheckers()); } - /** - * @test - */ + #[Test] public function iCanCheckValidPayloadClaims(): void { $clock = new MockClock(); @@ -74,9 +67,7 @@ public function iCanCheckValidPayloadClaims(): void static::assertSame($expected, $result); } - /** - * @test - */ + #[Test] public function theMandatoryClaimsAreNotSet(): void { $this->expectException(MissingMandatoryClaimException::class); diff --git a/tests/Component/Checker/ClaimCheckerManagerTest.php b/tests/Component/Checker/ClaimCheckerManagerTest.php index b183c97d1..0a3660e82 100644 --- a/tests/Component/Checker/ClaimCheckerManagerTest.php +++ b/tests/Component/Checker/ClaimCheckerManagerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Checker\AudienceChecker; use Jose\Component\Checker\ClaimCheckerManager; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class ClaimCheckerManagerTest extends TestCase { - /** - * @test - */ + #[Test] public function getCheckers(): void { $checkers = [new AudienceChecker('some-expected-audience')]; diff --git a/tests/Component/Checker/ExpirationTimeClaimCheckerTest.php b/tests/Component/Checker/ExpirationTimeClaimCheckerTest.php index 2ad71657a..5229c111d 100644 --- a/tests/Component/Checker/ExpirationTimeClaimCheckerTest.php +++ b/tests/Component/Checker/ExpirationTimeClaimCheckerTest.php @@ -7,6 +7,7 @@ use Jose\Component\Checker\ExpirationTimeChecker; use Jose\Component\Checker\InvalidClaimException; use Jose\Tests\Component\Checker\Stub\MockClock; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -14,9 +15,7 @@ */ final class ExpirationTimeClaimCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function theExpirationTimeClaimMustBeAnInteger(): void { $this->expectException(InvalidClaimException::class); @@ -27,9 +26,7 @@ public function theExpirationTimeClaimMustBeAnInteger(): void $checker->checkClaim('foo'); } - /** - * @test - */ + #[Test] public function theExpirationTimeIsInThePast(): void { $this->expectException(InvalidClaimException::class); @@ -40,9 +37,7 @@ public function theExpirationTimeIsInThePast(): void $checker->checkClaim($clock->now()->getTimestamp() - 1); } - /** - * @test - */ + #[Test] public function theExpirationTimeIsInTheFutur(): void { $clock = new MockClock(); diff --git a/tests/Component/Checker/HeaderCheckerManagerFactoryTest.php b/tests/Component/Checker/HeaderCheckerManagerFactoryTest.php index 0dccaf4c6..0fee14a29 100644 --- a/tests/Component/Checker/HeaderCheckerManagerFactoryTest.php +++ b/tests/Component/Checker/HeaderCheckerManagerFactoryTest.php @@ -13,6 +13,8 @@ use Jose\Tests\Component\Checker\Stub\OtherToken; use Jose\Tests\Component\Checker\Stub\Token; use Jose\Tests\Component\Checker\Stub\TokenSupport; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -22,17 +24,13 @@ final class HeaderCheckerManagerFactoryTest extends TestCase { private ?HeaderCheckerManagerFactory $headerCheckerManagerFactory = null; - /** - * @test - */ + #[Test] public function theAliasListOfTheHeaderCheckerManagerFactoryIsAvailable(): void { static::assertSame(['aud', 'iss'], $this->getHeaderCheckerManagerFactory()->aliases()); } - /** - * @test - */ + #[Test] public function aHeaderMustNotContainDuplicatedHeaderParameters(): void { $this->expectException(InvalidArgumentException::class); @@ -52,9 +50,7 @@ public function aHeaderMustNotContainDuplicatedHeaderParameters(): void $headerCheckerManager->check($token, 0); } - /** - * @test - */ + #[Test] public function theTokenHasCriticalHeaderNotSatisfied(): void { $this->expectException(InvalidHeaderException::class); @@ -74,10 +70,8 @@ public function theTokenHasCriticalHeaderNotSatisfied(): void $headerCheckerManager->check($token, 0); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function theHeaderIsSuccessfullyChecked(): void { $headerCheckerManager = $this->getHeaderCheckerManagerFactory() @@ -94,9 +88,7 @@ public function theHeaderIsSuccessfullyChecked(): void $headerCheckerManager->check($token, 0); } - /** - * @test - */ + #[Test] public function theCriticalHeaderParameterMustBeProtected(): void { $this->expectException(InvalidHeaderException::class); @@ -115,9 +107,7 @@ public function theCriticalHeaderParameterMustBeProtected(): void $headerCheckerManager->check($token, 0); } - /** - * @test - */ + #[Test] public function theCriticalHeaderParameterMustBeAListOfHeaderParameters(): void { $this->expectException(InvalidHeaderException::class); @@ -135,10 +125,8 @@ public function theCriticalHeaderParameterMustBeAListOfHeaderParameters(): void $headerCheckerManager->check($token, 0); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function theHeaderContainsUnknownParametersAndIsSuccessfullyChecked(): void { $headerCheckerManager = $this->getHeaderCheckerManagerFactory() @@ -153,9 +141,7 @@ public function theHeaderContainsUnknownParametersAndIsSuccessfullyChecked(): vo $headerCheckerManager->check($token, 0); } - /** - * @test - */ + #[Test] public function theHeaderDoesNotContainSomeMandatoryParameters(): void { $this->expectException(MissingMandatoryHeaderParameterException::class); @@ -175,9 +161,7 @@ public function theHeaderDoesNotContainSomeMandatoryParameters(): void $headerCheckerManager->check($token, 0, ['aud', 'iss', 'mandatory']); } - /** - * @test - */ + #[Test] public function iTryToCheckATokenThatIsNotSupported(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Component/Checker/IsEqualCheckerTest.php b/tests/Component/Checker/IsEqualCheckerTest.php new file mode 100644 index 000000000..223ac2d0b --- /dev/null +++ b/tests/Component/Checker/IsEqualCheckerTest.php @@ -0,0 +1,51 @@ +expectException(InvalidClaimException::class); + + $checker = new IsEqualChecker('foo', 'bar'); + $checker->checkClaim('baz'); + } + + #[Test] + public function theHeaderIsInvalid(): void + { + $this->expectException(InvalidHeaderException::class); + + $checker = new IsEqualChecker('foo', 'bar'); + $checker->checkHeader('baz'); + } + + #[Test] + public function theClaimIsSupported(): void + { + $checker = new IsEqualChecker('foo', 'bar'); + $checker->checkClaim('bar'); + static::assertSame('foo', $checker->supportedClaim()); + } + + #[Test] + public function theHeaderIsSupported(): void + { + $checker = new IsEqualChecker('foo', 'bar'); + $checker->checkHeader('bar'); + static::assertSame('foo', $checker->supportedHeader()); + } +} diff --git a/tests/Component/Checker/IssuedAtClaimCheckerTest.php b/tests/Component/Checker/IssuedAtClaimCheckerTest.php index 5f5da950e..2096cd1c5 100644 --- a/tests/Component/Checker/IssuedAtClaimCheckerTest.php +++ b/tests/Component/Checker/IssuedAtClaimCheckerTest.php @@ -7,6 +7,7 @@ use Jose\Component\Checker\InvalidClaimException; use Jose\Component\Checker\IssuedAtChecker; use Jose\Tests\Component\Checker\Stub\MockClock; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -14,9 +15,7 @@ */ final class IssuedAtClaimCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function anIssuedAtClaimMustBeAnInteger(): void { $this->expectException(InvalidClaimException::class); @@ -27,9 +26,7 @@ public function anIssuedAtClaimMustBeAnInteger(): void $checker->checkClaim('foo'); } - /** - * @test - */ + #[Test] public function theIssuedAtClaimIsInTheFutur(): void { $this->expectException(InvalidClaimException::class); @@ -40,9 +37,7 @@ public function theIssuedAtClaimIsInTheFutur(): void $checker->checkClaim($clock->now()->getTimestamp() + 3600); } - /** - * @test - */ + #[Test] public function theIssuedAtClaimIsInThePast(): void { $clock = new MockClock(); diff --git a/tests/Component/Checker/NotBeforeClaimCheckerTest.php b/tests/Component/Checker/NotBeforeClaimCheckerTest.php index e80d33365..ecc52e409 100644 --- a/tests/Component/Checker/NotBeforeClaimCheckerTest.php +++ b/tests/Component/Checker/NotBeforeClaimCheckerTest.php @@ -7,6 +7,7 @@ use Jose\Component\Checker\InvalidClaimException; use Jose\Component\Checker\NotBeforeChecker; use Jose\Tests\Component\Checker\Stub\MockClock; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -14,9 +15,7 @@ */ final class NotBeforeClaimCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function theNotBeforeClaimMustBeAnInteger(): void { $this->expectException(InvalidClaimException::class); @@ -27,9 +26,7 @@ public function theNotBeforeClaimMustBeAnInteger(): void $checker->checkClaim('foo'); } - /** - * @test - */ + #[Test] public function theNotBeforeClaimIsInTheFutur(): void { $this->expectException(InvalidClaimException::class); @@ -40,9 +37,7 @@ public function theNotBeforeClaimIsInTheFutur(): void $checker->checkClaim($clock->now()->getTimestamp() + 3600); } - /** - * @test - */ + #[Test] public function theNotBeforeClaimIsInThePast(): void { $clock = new MockClock(); diff --git a/tests/Component/Checker/UnencodedPayloadHeaderCheckerTest.php b/tests/Component/Checker/UnencodedPayloadHeaderCheckerTest.php index ff0a0a586..750c1ff6f 100644 --- a/tests/Component/Checker/UnencodedPayloadHeaderCheckerTest.php +++ b/tests/Component/Checker/UnencodedPayloadHeaderCheckerTest.php @@ -6,6 +6,7 @@ use Jose\Component\Checker\InvalidHeaderException; use Jose\Component\Checker\UnencodedPayloadChecker; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class UnencodedPayloadHeaderCheckerTest extends TestCase { - /** - * @test - */ + #[Test] public function theB64HeaderMustBeAnBoolean(): void { $this->expectException(InvalidHeaderException::class); @@ -25,9 +24,7 @@ public function theB64HeaderMustBeAnBoolean(): void $checker->checkHeader('foo'); } - /** - * @test - */ + #[Test] public function theB64HeaderIsABoolean(): void { $checker = new UnencodedPayloadChecker(); diff --git a/tests/Component/Console/AnalyzeCommandTest.php b/tests/Component/Console/AnalyzeCommandTest.php index b98de2550..3b55ca023 100644 --- a/tests/Component/Console/AnalyzeCommandTest.php +++ b/tests/Component/Console/AnalyzeCommandTest.php @@ -19,6 +19,7 @@ use Jose\Component\KeyManagement\Analyzer\OctAnalyzer; use Jose\Component\KeyManagement\Analyzer\RsaAnalyzer; use Jose\Component\KeyManagement\Analyzer\UsageAnalyzer; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\BufferedOutput; @@ -32,9 +33,7 @@ final class AnalyzeCommandTest extends TestCase private ?KeysetAnalyzerManager $keysetAnalyzerManager = null; - /** - * @test - */ + #[Test] public function iCanAnalyzeAKeyAndGetInformation(): void { $jwk = new JWK([ @@ -55,9 +54,7 @@ public function iCanAnalyzeAKeyAndGetInformation(): void static::assertStringContainsString('* The parameter "use" should be added.', $content); } - /** - * @test - */ + #[Test] public function iCanAnalyzeAKeySetAndGetInformation(): void { $keyset = JWKSet::createFromKeyData([ diff --git a/tests/Component/Console/KeyConversionCommandTest.php b/tests/Component/Console/KeyConversionCommandTest.php index d6d238683..01e8eeadd 100644 --- a/tests/Component/Console/KeyConversionCommandTest.php +++ b/tests/Component/Console/KeyConversionCommandTest.php @@ -15,6 +15,8 @@ use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\JsonConverter; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\BufferedOutput; @@ -24,10 +26,8 @@ */ final class KeyConversionCommandTest extends TestCase { - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanLoadAKeyFile(): void { $input = new ArrayInput([ @@ -40,10 +40,8 @@ public function iCanLoadAKeyFile(): void JWK::createFromJson($content); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanLoadAnEncryptedKeyFile(): void { $input = new ArrayInput([ @@ -57,10 +55,8 @@ public function iCanLoadAnEncryptedKeyFile(): void JWK::createFromJson($content); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanLoadAPKCS12CertificateFile(): never { static::markTestIncomplete('Unable to run this test using the last OpenSSL versions'); @@ -75,10 +71,8 @@ public function iCanLoadAPKCS12CertificateFile(): never JWK::createFromJson($content); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanLoadAX509CertificateFile(): void { $input = new ArrayInput([ @@ -91,9 +85,7 @@ public function iCanLoadAX509CertificateFile(): void JWK::createFromJson($content); } - /** - * @test - */ + #[Test] public function iCanOptimizeARsaKey(): void { $jwk = new JWK([ @@ -118,9 +110,7 @@ public function iCanOptimizeARsaKey(): void static::assertTrue($jwk->has('qi')); } - /** - * @test - */ + #[Test] public function iCanConvertARsaKeyIntoPKCS1(): void { $jwk = new JWK([ @@ -145,9 +135,7 @@ public function iCanConvertARsaKeyIntoPKCS1(): void static::assertStringContainsString('-----BEGIN PRIVATE KEY-----', $content); } - /** - * @test - */ + #[Test] public function iCanConvertAnEcKeyIntoPKCS1(): void { $jwk = new JWK([ @@ -168,9 +156,7 @@ public function iCanConvertAnEcKeyIntoPKCS1(): void static::assertStringContainsString('-----BEGIN EC PRIVATE KEY-----', $content); } - /** - * @test - */ + #[Test] public function iCanConvertAPrivateKeyIntoPublicKey(): void { $jwk = new JWK([ @@ -194,9 +180,7 @@ public function iCanConvertAPrivateKeyIntoPublicKey(): void ); } - /** - * @test - */ + #[Test] public function iCanConvertPrivateKeysIntoPublicKeys(): void { $keyset = JWKSet::createFromKeyData([ @@ -229,9 +213,7 @@ public function iCanConvertPrivateKeysIntoPublicKeys(): void ); } - /** - * @test - */ + #[Test] public function iCanGetTheThumbprintOfAKey(): void { $jwk = new JWK([ diff --git a/tests/Component/Console/KeyCreationCommandTest.php b/tests/Component/Console/KeyCreationCommandTest.php index 313f036eb..3dc3b4251 100644 --- a/tests/Component/Console/KeyCreationCommandTest.php +++ b/tests/Component/Console/KeyCreationCommandTest.php @@ -13,6 +13,8 @@ use Jose\Component\Console\SecretKeyGeneratorCommand; use Jose\Component\Core\JWK; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use RuntimeException; use Symfony\Component\Console\Input\ArrayInput; @@ -23,9 +25,7 @@ */ final class KeyCreationCommandTest extends TestCase { - /** - * @test - */ + #[Test] public function theEllipticCurveKeyCreationCommandIsAvailable(): void { $command = new EcKeyGeneratorCommand(); @@ -33,9 +33,7 @@ public function theEllipticCurveKeyCreationCommandIsAvailable(): void static::assertTrue($command->isEnabled()); } - /** - * @test - */ + #[Test] public function theEllipticCurveKeyCreationCommandNeedTheCurveArgument(): void { $this->expectException(RuntimeException::class); @@ -48,9 +46,7 @@ public function theEllipticCurveKeyCreationCommandNeedTheCurveArgument(): void $command->run($input, $output); } - /** - * @test - */ + #[Test] public function iCannotCreateAnEllipticCurveKeyWithAnUnsupportedCurve(): void { $this->expectException(InvalidArgumentException::class); @@ -65,10 +61,8 @@ public function iCannotCreateAnEllipticCurveKeyWithAnUnsupportedCurve(): void $command->run($input, $output); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanCreateAnEllipticCurveKeyWithCurveP256(): void { $input = new ArrayInput([ @@ -83,9 +77,7 @@ public function iCanCreateAnEllipticCurveKeyWithCurveP256(): void JWK::createFromJson($content); } - /** - * @test - */ + #[Test] public function iCannotCreateAnOctetKeyWithoutKeySize(): void { $this->expectException(RuntimeException::class); @@ -98,10 +90,8 @@ public function iCannotCreateAnOctetKeyWithoutKeySize(): void $command->run($input, $output); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanCreateAnOctetKey(): void { $input = new ArrayInput([ @@ -116,9 +106,7 @@ public function iCanCreateAnOctetKey(): void JWK::createFromJson($content); } - /** - * @test - */ + #[Test] public function iCanCreateAnOctetKeyUsingASecret(): void { $input = new ArrayInput([ @@ -134,9 +122,7 @@ public function iCanCreateAnOctetKeyUsingASecret(): void static::assertSame('This is my secret', Base64UrlSafe::decode($jwk->get('k'))); } - /** - * @test - */ + #[Test] public function iCanCreateAnOctetKeyUsingABinarySecret(): void { $secret = random_bytes(20); @@ -155,9 +141,7 @@ public function iCanCreateAnOctetKeyUsingABinarySecret(): void static::assertSame($secret, Base64UrlSafe::decode($jwk->get('k'))); } - /** - * @test - */ + #[Test] public function iCannotCreateAnOctetKeyPairWithoutKeyCurve(): void { $this->expectException(RuntimeException::class); @@ -170,10 +154,8 @@ public function iCannotCreateAnOctetKeyPairWithoutKeyCurve(): void $command->run($input, $output); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanCreateAnOctetKeyPair(): void { $input = new ArrayInput([ @@ -188,10 +170,8 @@ public function iCanCreateAnOctetKeyPair(): void JWK::createFromJson($content); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanCreateANoneKey(): void { $input = new ArrayInput([ @@ -205,9 +185,7 @@ public function iCanCreateANoneKey(): void JWK::createFromJson($content); } - /** - * @test - */ + #[Test] public function iCannotCreateAnRsaKeyWithoutKeySize(): void { $this->expectException(RuntimeException::class); @@ -220,10 +198,8 @@ public function iCannotCreateAnRsaKeyWithoutKeySize(): void $command->run($input, $output); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function iCanCreateAnRsaKey(): void { $input = new ArrayInput([ diff --git a/tests/Component/Console/KeySetCreationCommandTest.php b/tests/Component/Console/KeySetCreationCommandTest.php index 1ca8c4f15..76427db44 100644 --- a/tests/Component/Console/KeySetCreationCommandTest.php +++ b/tests/Component/Console/KeySetCreationCommandTest.php @@ -10,6 +10,7 @@ use Jose\Component\Console\OkpKeysetGeneratorCommand; use Jose\Component\Console\RsaKeysetGeneratorCommand; use Jose\Component\Core\JWKSet; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use RuntimeException; use Symfony\Component\Console\Input\ArrayInput; @@ -20,9 +21,7 @@ */ final class KeySetCreationCommandTest extends TestCase { - /** - * @test - */ + #[Test] public function theEllipticCurveKeySetCreationCommandIsAvailable(): void { $command = new EcKeysetGeneratorCommand(); @@ -30,9 +29,7 @@ public function theEllipticCurveKeySetCreationCommandIsAvailable(): void static::assertTrue($command->isEnabled()); } - /** - * @test - */ + #[Test] public function theEllipticCurveKeySetCreationCommandNeedTheCurveAndQuantityArguments(): void { $this->expectException(RuntimeException::class); @@ -45,9 +42,7 @@ public function theEllipticCurveKeySetCreationCommandNeedTheCurveAndQuantityArgu $command->run($input, $output); } - /** - * @test - */ + #[Test] public function iCannotCreateAnEllipticCurveKeySetWithAnUnsupportedCurve(): void { $this->expectException(InvalidArgumentException::class); @@ -63,9 +58,7 @@ public function iCannotCreateAnEllipticCurveKeySetWithAnUnsupportedCurve(): void $command->run($input, $output); } - /** - * @test - */ + #[Test] public function iCanCreateAnEllipticCurveKeySetWithCurveP256(): void { $input = new ArrayInput([ @@ -82,9 +75,7 @@ public function iCanCreateAnEllipticCurveKeySetWithCurveP256(): void static::assertCount(2, $jwkset, 'Invalid number of keys in the keyset'); } - /** - * @test - */ + #[Test] public function iCannotCreateAnOctetKeySetWithoutKeySetSize(): void { $this->expectException(RuntimeException::class); @@ -102,9 +93,7 @@ public function iCannotCreateAnOctetKeySetWithoutKeySetSize(): void static::assertCount(2, $jwkset, 'Invalid number of keys in the keyset'); } - /** - * @test - */ + #[Test] public function iCanCreateAnOctetKeySet(): void { $input = new ArrayInput([ @@ -121,9 +110,7 @@ public function iCanCreateAnOctetKeySet(): void static::assertCount(2, $jwkset, 'Invalid number of keys in the keyset'); } - /** - * @test - */ + #[Test] public function iCannotCreateAnOctetKeySetPairWithoutKeySetCurve(): void { $this->expectException(RuntimeException::class); @@ -138,9 +125,7 @@ public function iCannotCreateAnOctetKeySetPairWithoutKeySetCurve(): void $command->run($input, $output); } - /** - * @test - */ + #[Test] public function iCanCreateAnOctetKeySetPair(): void { $input = new ArrayInput([ @@ -157,9 +142,7 @@ public function iCanCreateAnOctetKeySetPair(): void static::assertCount(2, $jwkset, 'Invalid number of keys in the keyset'); } - /** - * @test - */ + #[Test] public function iCannotCreateAnRsaKeySetWithoutKeySetSize(): void { $this->expectException(RuntimeException::class); @@ -174,9 +157,7 @@ public function iCannotCreateAnRsaKeySetWithoutKeySetSize(): void $command->run($input, $output); } - /** - * @test - */ + #[Test] public function iCanCreateAnRsaKeySet(): void { $input = new ArrayInput([ diff --git a/tests/Component/Core/AlgorithmManagerFactoryTest.php b/tests/Component/Core/AlgorithmManagerFactoryTest.php index 961c79d67..298f3eb30 100644 --- a/tests/Component/Core/AlgorithmManagerFactoryTest.php +++ b/tests/Component/Core/AlgorithmManagerFactoryTest.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\AlgorithmManagerFactory; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use TypeError; @@ -17,18 +18,14 @@ final class AlgorithmManagerFactoryTest extends TestCase { private ?AlgorithmManagerFactory $algorithmManagerFactory = null; - /** - * @test - */ + #[Test] public function iCanListSupportedAliases(): void { static::assertSame(['foo'], $this->getAlgorithmManagerFactory()->aliases()); static::assertSame(['foo'], array_keys($this->getAlgorithmManagerFactory()->all())); } - /** - * @test - */ + #[Test] public function iCannotCreateAnAlgorithmManagerWithABadArgument(): void { $this->expectException(TypeError::class); @@ -36,9 +33,7 @@ public function iCannotCreateAnAlgorithmManagerWithABadArgument(): void new AlgorithmManager(['foo']); } - /** - * @test - */ + #[Test] public function iCannotGetAnAlgorithmThatDoesNotExist(): void { $this->expectException(InvalidArgumentException::class); @@ -55,8 +50,7 @@ public function iCannotGetAnAlgorithmThatDoesNotExist(): void private function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('foo', new FooAlgorithm()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([new FooAlgorithm()]); } return $this->algorithmManagerFactory; diff --git a/tests/Component/Core/JWKSetTest.php b/tests/Component/Core/JWKSetTest.php index c5644933d..ae280d3ca 100644 --- a/tests/Component/Core/JWKSetTest.php +++ b/tests/Component/Core/JWKSetTest.php @@ -7,17 +7,16 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class JWKSetTest extends TestCase { - /** - * @test - */ + #[Test] public function iCanSelectAKeyInAKeySet(): void { $jwkset = $this->getPublicKeySet(); @@ -26,9 +25,7 @@ public function iCanSelectAKeyInAKeySet(): void static::assertInstanceOf(JWK::class, $jwk); } - /** - * @test - */ + #[Test] public function iCannotSelectAKeyFromAKeySetWithUnsupportedUsageParameter(): void { $this->expectException(InvalidArgumentException::class); @@ -38,9 +35,7 @@ public function iCannotSelectAKeyFromAKeySetWithUnsupportedUsageParameter(): voi $jwkset->selectKey('foo'); } - /** - * @test - */ + #[Test] public function iCannotCreateAKeySetWithBadArguments(): void { $this->expectException(InvalidArgumentException::class); @@ -51,18 +46,14 @@ public function iCannotCreateAKeySetWithBadArguments(): void ]); } - /** - * @test - */ + #[Test] public function iCanGetAllKeysInAKeySet(): void { $jwkset = $this->getPublicKeySet(); static::assertCount(3, $jwkset->all()); } - /** - * @test - */ + #[Test] public function iCanAddKeysInAKeySet(): void { $jwkset = $this->getPublicKeySet(); @@ -73,29 +64,22 @@ public function iCanAddKeysInAKeySet(): void static::assertNotSame($jwkset, $new_jwkset); } - /** - * @test - */ + #[Test] public function iCanSelectAKeyWithAlgorithm(): void { $jwkset = $this->getPublicKeySet(); $jwk = $jwkset->selectKey('enc', new FooAlgorithm()); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '71ee230371d19630bc17fb90ccf20ae632ad8cf8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'enc', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '71ee230371d19630bc17fb90ccf20ae632ad8cf8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'enc', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function iCanSelectAKeyWithAlgorithmAndKeyId(): void { $jwkset = $this->getPublicKeySet(); @@ -104,20 +88,15 @@ public function iCanSelectAKeyWithAlgorithmAndKeyId(): void 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', ]); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'sig', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'sig', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function iCanSelectAKeyWithWithKeyId(): void { $jwkset = $this->getPublicKeySet(); @@ -126,20 +105,15 @@ public function iCanSelectAKeyWithWithKeyId(): void 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', ]); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'sig', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'sig', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function theKeySetDoesNotContainsSuitableAKeyThatFitsOnTheRequirements(): void { $jwkset = $this->getPublicKeySet(); @@ -150,9 +124,7 @@ public function theKeySetDoesNotContainsSuitableAKeyThatFitsOnTheRequirements(): static::assertNull($jwk); } - /** - * @test - */ + #[Test] public function iCanCreateAKeySetUsingValues(): void { $values = [ @@ -169,9 +141,7 @@ public function iCanCreateAKeySetUsingValues(): void static::assertFalse($jwkset->has(0)); } - /** - * @test - */ + #[Test] public function keySet(): void { $jwk1 = new JWK([ @@ -225,9 +195,7 @@ public function keySet(): void static::assertSame(0, $jwkset->count()); } - /** - * @test - */ + #[Test] public function keySet2(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Component/Core/JWKTest.php b/tests/Component/Core/JWKTest.php index 34147d874..49a1f05ef 100644 --- a/tests/Component/Core/JWKTest.php +++ b/tests/Component/Core/JWKTest.php @@ -6,17 +6,17 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; -use const JSON_THROW_ON_ERROR; +use Jose\Component\Core\Util\ECKey; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class JWKTest extends TestCase { - /** - * @test - */ + #[Test] public function aKeyContainsAllExpectedParameters(): void { $jwk = new JWK([ @@ -51,9 +51,7 @@ public function aKeyContainsAllExpectedParameters(): void static::assertSame('dqwHnan4iJ1_eEll-o4Egw', $jwk->thumbprint('md5')); } - /** - * @test - */ + #[Test] public function iCannotGetTheThumbprintOfTheKeyWhenIUseAnUnsupportedHashingAlgorithm(): void { $this->expectException(InvalidArgumentException::class); @@ -73,9 +71,7 @@ public function iCannotGetTheThumbprintOfTheKeyWhenIUseAnUnsupportedHashingAlgor $jwk->thumbprint('foo'); } - /** - * @test - */ + #[Test] public function iMustSetAtLeastTheKtyParameter(): void { $this->expectException(InvalidArgumentException::class); @@ -84,9 +80,7 @@ public function iMustSetAtLeastTheKtyParameter(): void new JWK([]); } - /** - * @test - */ + #[Test] public function iCannotGetAParameterThatDoesNotExist(): void { $this->expectException(InvalidArgumentException::class); @@ -106,9 +100,7 @@ public function iCannotGetAParameterThatDoesNotExist(): void $jwk->get('ABCD'); } - /** - * @test - */ + #[Test] public function iCanConvertAPrivateKeyIntoPublicKey(): void { $private = new JWK([ @@ -136,4 +128,25 @@ public function iCanConvertAPrivateKeyIntoPublicKey(): void 'kid' => '9876543210', ]), json_encode($public, JSON_THROW_ON_ERROR)); } + + #[Test] + public static function convertToPEM(): void + { + // Given + $key = '{"kty":"EC","crv":"P-256","x":"GDDdmNtwNvlXN04SEUp20BZJ9im6SQqkP8u4d8G6RAk","y":"AIAxkBwTTqbCcNbqbpk8l_Eh-4KtpgyyHkNJ6K4jnvOv","use":"sig","alg":"ES256","kid":"ayRrlw","key_ops":["verify"]}'; + $jwk = JWK::createFromJson($key); + $expectedPEM = <<<'PEM' +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGDDdmNtwNvlXN04SEUp20BZJ9im6 +SQqkP8u4d8G6RAmAMZAcE06mwnDW6m6ZPJfxIfuCraYMsh5DSeiuI57zrw== +-----END PUBLIC KEY----- + +PEM; + + //When + $pem = ECKey::convertToPEM($jwk); + + //Then + static::assertSame($expectedPEM, $pem); + } } diff --git a/tests/Component/Core/JsonConverterTest.php b/tests/Component/Core/JsonConverterTest.php index 791640e82..304fa3a88 100644 --- a/tests/Component/Core/JsonConverterTest.php +++ b/tests/Component/Core/JsonConverterTest.php @@ -5,6 +5,7 @@ namespace Jose\Tests\Component\Core; use Jose\Component\Core\Util\JsonConverter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -12,9 +13,7 @@ */ final class JsonConverterTest extends TestCase { - /** - * @test - */ + #[Test] public function iCanConvertAnObjectIntoAJsonString(): void { static::assertSame('{"foo":"BAR"}', JsonConverter::encode([ diff --git a/tests/Component/Encryption/CompressionTestCase.php b/tests/Component/Encryption/CompressionTest.php similarity index 90% rename from tests/Component/Encryption/CompressionTestCase.php rename to tests/Component/Encryption/CompressionTest.php index 5237816cd..c5fdcafe6 100644 --- a/tests/Component/Encryption/CompressionTestCase.php +++ b/tests/Component/Encryption/CompressionTest.php @@ -7,17 +7,16 @@ use InvalidArgumentException; use Jose\Component\Encryption\Compression\CompressionMethodManager; use Jose\Component\Encryption\Compression\Deflate; +use PHPUnit\Framework\Attributes\Test; /** * Class CompressionTest. * * @internal */ -final class CompressionTestCase extends EncryptionTestCase +final class CompressionTest extends EncryptionTestCase { - /** - * @test - */ + #[Test] public function getValidCompressionAlgorithm(): void { $manager = new CompressionMethodManager([new Deflate()]); @@ -26,9 +25,7 @@ public function getValidCompressionAlgorithm(): void $manager->get('DEF'); } - /** - * @test - */ + #[Test] public function getInvalidCompressionAlgorithm(): void { $this->expectException(InvalidArgumentException::class); @@ -39,9 +36,7 @@ public function getInvalidCompressionAlgorithm(): void $manager->get('FOO'); } - /** - * @test - */ + #[Test] public function deflate(): void { $compression = new Deflate(9); @@ -53,9 +48,7 @@ public function deflate(): void static::assertSame($data, $uncompressed); } - /** - * @test - */ + #[Test] public function deflateInvalidCompressionLevel(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Component/Encryption/ECDHESWithX25519EncryptionTestCase.php b/tests/Component/Encryption/ECDHESWithX25519EncryptionTest.php similarity index 93% rename from tests/Component/Encryption/ECDHESWithX25519EncryptionTestCase.php rename to tests/Component/Encryption/ECDHESWithX25519EncryptionTest.php index 29bda1dda..a86a02040 100644 --- a/tests/Component/Encryption/ECDHESWithX25519EncryptionTestCase.php +++ b/tests/Component/Encryption/ECDHESWithX25519EncryptionTest.php @@ -5,19 +5,19 @@ namespace Jose\Tests\Component\Encryption; use Jose\Component\Core\JWK; +use PHPUnit\Framework\Attributes\Test; /** * Class ECDHESWithX25519EncryptionTest. * * @internal */ -final class ECDHESWithX25519EncryptionTestCase extends EncryptionTestCase +final class ECDHESWithX25519EncryptionTest extends EncryptionTestCase { /** * @see https://tools.ietf.org/html/rfc7516#appendix-B - * - * @test */ + #[Test] public function a128CBCHS256EncryptAndDecrypt(): void { $receiverKey = new JWK([ diff --git a/tests/Component/Encryption/EncrypterTestCase.php b/tests/Component/Encryption/EncrypterTest.php similarity index 98% rename from tests/Component/Encryption/EncrypterTestCase.php rename to tests/Component/Encryption/EncrypterTest.php index d1a11a84d..9173f8ece 100644 --- a/tests/Component/Encryption/EncrypterTestCase.php +++ b/tests/Component/Encryption/EncrypterTest.php @@ -7,17 +7,16 @@ use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; -use const JSON_THROW_ON_ERROR; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; +use const JSON_THROW_ON_ERROR; /** * @internal */ -final class EncrypterTestCase extends EncryptionTestCase +final class EncrypterTest extends EncryptionTestCase { - /** - * @test - */ + #[Test] public function encryptWithJWTInput(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -52,9 +51,7 @@ public function encryptWithJWTInput(): void static::assertSame('FOO', $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function duplicatedHeader(): void { $this->expectException(InvalidArgumentException::class); @@ -76,9 +73,7 @@ public function duplicatedHeader(): void ]); } - /** - * @test - */ + #[Test] public function createCompactJWEUsingFactory(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -112,9 +107,7 @@ public function createCompactJWEUsingFactory(): void static::assertSame('FOO', $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function createFlattenedJWEUsingFactory(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -157,9 +150,7 @@ public function createFlattenedJWEUsingFactory(): void static::assertSame('FOO', $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function encryptAndLoadFlattenedWithAAD(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -197,9 +188,7 @@ public function encryptAndLoadFlattenedWithAAD(): void ); } - /** - * @test - */ + #[Test] public function compressionAlgorithmNotSupported(): void { $this->expectException(InvalidArgumentException::class); @@ -223,9 +212,7 @@ public function compressionAlgorithmNotSupported(): void ->serialize('jwe_json_flattened', $jwe, 0); } - /** - * @test - */ + #[Test] public function foreignKeyManagementModeForbidden(): void { $this->expectException(InvalidArgumentException::class); @@ -251,9 +238,7 @@ public function foreignKeyManagementModeForbidden(): void ->build(); } - /** - * @test - */ + #[Test] public function operationNotAllowedForTheKey(): void { $this->expectException(InvalidArgumentException::class); @@ -274,9 +259,7 @@ public function operationNotAllowedForTheKey(): void ->build(); } - /** - * @test - */ + #[Test] public function algorithmNotAllowedForTheKey(): void { $this->expectException(InvalidArgumentException::class); @@ -297,9 +280,7 @@ public function algorithmNotAllowedForTheKey(): void ->build(); } - /** - * @test - */ + #[Test] public function encryptAndLoadFlattenedWithDeflateCompression(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -337,9 +318,7 @@ public function encryptAndLoadFlattenedWithDeflateCompression(): void ); } - /** - * @test - */ + #[Test] public function algParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -360,9 +339,7 @@ public function algParameterIsMissing(): void ->build(); } - /** - * @test - */ + #[Test] public function encParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -383,9 +360,7 @@ public function encParameterIsMissing(): void ->build(); } - /** - * @test - */ + #[Test] public function notAKeyEncryptionAlgorithm(): void { $this->expectException(InvalidArgumentException::class); @@ -409,9 +384,7 @@ public function notAKeyEncryptionAlgorithm(): void ->build(); } - /** - * @test - */ + #[Test] public function notAContentEncryptionAlgorithm(): void { $this->expectException(InvalidArgumentException::class); @@ -435,9 +408,7 @@ public function notAContentEncryptionAlgorithm(): void ->build(); } - /** - * @test - */ + #[Test] public function encryptAndLoadCompactWithDirectKeyEncryption(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -474,9 +445,7 @@ public function encryptAndLoadCompactWithDirectKeyEncryption(): void ); } - /** - * @test - */ + #[Test] public function encryptAndLoadCompactKeyAgreement(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -514,9 +483,7 @@ public function encryptAndLoadCompactKeyAgreement(): void static::assertSame($payload, $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function encryptAndLoadCompactKeyAgreementWithWrappingCompact(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -552,9 +519,7 @@ public function encryptAndLoadCompactKeyAgreementWithWrappingCompact(): void static::assertSame('Live long and Prosper.', $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function encryptAndLoadWithGCMAndAAD(): void { $jweBuilder = $this->getJWEBuilderFactory() @@ -591,9 +556,7 @@ public function encryptAndLoadWithGCMAndAAD(): void static::assertSame('Live long and Prosper.', $loaded->getPayload()); } - /** - * @test - */ + #[Test] public function encryptAndLoadCompactKeyAgreementWithWrapping(): void { $jweBuilder = $this->getJWEBuilderFactory() diff --git a/tests/Component/Encryption/EncryptionTestCase.php b/tests/Component/Encryption/EncryptionTestCase.php index ad4740b39..bcc02a57f 100644 --- a/tests/Component/Encryption/EncryptionTestCase.php +++ b/tests/Component/Encryption/EncryptionTestCase.php @@ -63,34 +63,35 @@ abstract class EncryptionTestCase extends TestCase protected function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('A128GCM', new A128GCM()); - $this->algorithmManagerFactory->add('A192GCM', new A192GCM()); - $this->algorithmManagerFactory->add('A256GCM', new A256GCM()); - $this->algorithmManagerFactory->add('A128CBC-HS256', new A128CBCHS256()); - $this->algorithmManagerFactory->add('A192CBC-HS384', new A192CBCHS384()); - $this->algorithmManagerFactory->add('A256CBC-HS512', new A256CBCHS512()); - $this->algorithmManagerFactory->add('A128GCMKW', new A128GCMKW()); - $this->algorithmManagerFactory->add('A192GCMKW', new A192GCMKW()); - $this->algorithmManagerFactory->add('A256GCMKW', new A256GCMKW()); - $this->algorithmManagerFactory->add('A128KW', new A128KW()); - $this->algorithmManagerFactory->add('A192KW', new A192KW()); - $this->algorithmManagerFactory->add('A256KW', new A256KW()); - $this->algorithmManagerFactory->add('dir', new Dir()); - $this->algorithmManagerFactory->add('ECDH-ES', new ECDHES()); - $this->algorithmManagerFactory->add('ECDH-ES+A128KW', new ECDHESA128KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A192KW', new ECDHESA192KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A256KW', new ECDHESA256KW()); - $this->algorithmManagerFactory->add('ECDH-SS', new ECDHSS()); - $this->algorithmManagerFactory->add('ECDH-SS+A128KW', new ECDHSSA128KW()); - $this->algorithmManagerFactory->add('ECDH-SS+A192KW', new ECDHSSA192KW()); - $this->algorithmManagerFactory->add('ECDH-SS+A256KW', new ECDHSSA256KW()); - $this->algorithmManagerFactory->add('PBES2-HS256+A128KW', new PBES2HS256A128KW()); - $this->algorithmManagerFactory->add('PBES2-HS384+A192KW', new PBES2HS384A192KW()); - $this->algorithmManagerFactory->add('PBES2-HS512+A256KW', new PBES2HS512A256KW()); - $this->algorithmManagerFactory->add('RSA1_5', new RSA15()); - $this->algorithmManagerFactory->add('RSA-OAEP', new RSAOAEP()); - $this->algorithmManagerFactory->add('RSA-OAEP-256', new RSAOAEP256()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([ + new A128GCM(), + new A192GCM(), + new A256GCM(), + new A128CBCHS256(), + new A192CBCHS384(), + new A256CBCHS512(), + new A128GCMKW(), + new A192GCMKW(), + new A256GCMKW(), + new A128KW(), + new A192KW(), + new A256KW(), + new Dir(), + new ECDHES(), + new ECDHESA128KW(), + new ECDHESA192KW(), + new ECDHESA256KW(), + new ECDHSS(), + new ECDHSSA128KW(), + new ECDHSSA192KW(), + new ECDHSSA256KW(), + new PBES2HS256A128KW(), + new PBES2HS384A192KW(), + new PBES2HS512A256KW(), + new RSA15(), + new RSAOAEP(), + new RSAOAEP256(), + ]); } return $this->algorithmManagerFactory; diff --git a/tests/Component/Encryption/InvalidCurveAttackTestCase.php b/tests/Component/Encryption/InvalidCurveAttackTest.php similarity index 95% rename from tests/Component/Encryption/InvalidCurveAttackTestCase.php rename to tests/Component/Encryption/InvalidCurveAttackTest.php index 75f75ac81..640313487 100644 --- a/tests/Component/Encryption/InvalidCurveAttackTestCase.php +++ b/tests/Component/Encryption/InvalidCurveAttackTest.php @@ -5,15 +5,14 @@ namespace Jose\Tests\Component\Encryption; use Jose\Component\Core\JWK; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class InvalidCurveAttackTestCase extends EncryptionTestCase +final class InvalidCurveAttackTest extends EncryptionTestCase { - /** - * @test - */ + #[Test] public function curveCheckNegativeP256AttackPt1(): void { $maliciousJWE = 'eyJhbGciOiJFQ0RILUVTK0ExMjhLVyIsImVuYyI6IkExMjhDQkMtSFMyNTYiLCJlcGsiOnsia3R5IjoiRUMiLCJ4IjoiZ1RsaTY1ZVRRN3otQmgxNDdmZjhLM203azJVaURpRzJMcFlrV0FhRkpDYyIsInkiOiJjTEFuakthNGJ6akQ3REpWUHdhOUVQclJ6TUc3ck9OZ3NpVUQta2YzMEZzIiwiY3J2IjoiUC0yNTYifX0.qGAdxtEnrV_3zbIxU2ZKrMWcejNltjA_dtefBFnRh9A2z9cNIqYRWg.pEA5kX304PMCOmFSKX_cEg.a9fwUrx2JXi1OnWEMOmZhXd94-bEGCH9xxRwqcGuG2AMo-AwHoljdsH5C_kcTqlXS5p51OB1tvgQcMwB5rpTxg.72CHiYFecyDvuUa43KKT6w'; @@ -33,9 +32,7 @@ public function curveCheckNegativeP256AttackPt1(): void static::assertFalse($jweDecrypter->decryptUsingKey($loaded_compact_json, $privateKey, 0)); } - /** - * @test - */ + #[Test] public function curveCheckNegativeP256AttackPt2(): void { // The malicious JWE contains a public key with order 2447 diff --git a/tests/Component/Encryption/JWEFlattenedTestCase.php b/tests/Component/Encryption/JWEFlattenedTest.php similarity index 95% rename from tests/Component/Encryption/JWEFlattenedTestCase.php rename to tests/Component/Encryption/JWEFlattenedTest.php index 2c6347edc..fd4e21a3e 100644 --- a/tests/Component/Encryption/JWEFlattenedTestCase.php +++ b/tests/Component/Encryption/JWEFlattenedTest.php @@ -6,17 +6,17 @@ use Jose\Component\Core\JWKSet; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class JWEFlattenedTestCase extends EncryptionTestCase +final class JWEFlattenedTest extends EncryptionTestCase { /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.5 - * - * @test */ + #[Test] public function loadFlattenedJWE(): void { $jweDecrypter = $this->getJWEDecrypterFactory() diff --git a/tests/Component/Encryption/JWELoaderTestCase.php b/tests/Component/Encryption/JWELoaderTest.php similarity index 97% rename from tests/Component/Encryption/JWELoaderTestCase.php rename to tests/Component/Encryption/JWELoaderTest.php index f88172679..754e25928 100644 --- a/tests/Component/Encryption/JWELoaderTestCase.php +++ b/tests/Component/Encryption/JWELoaderTest.php @@ -7,19 +7,18 @@ use Exception; use Jose\Component\Core\JWK; use Jose\Component\Encryption\JWELoader; +use PHPUnit\Framework\Attributes\Test; /** * Class JWELoaderTest. * * @internal */ -final class JWELoaderTestCase extends EncryptionTestCase +final class JWELoaderTest extends EncryptionTestCase { private ?JWELoader $jweLoader = null; - /** - * @test - */ + #[Test] public function theFlattenedTokenCannotBeLoaded(): void { $this->expectException(Exception::class); @@ -39,9 +38,7 @@ public function theFlattenedTokenCannotBeLoaded(): void ->loadAndDecryptWithKey($token, $key, $recipient); } - /** - * @test - */ + #[Test] public function theTokenCannotBeVerifiedBecauseOfAnUnsupportedAlgorithm(): void { $this->expectException(Exception::class); @@ -61,9 +58,7 @@ public function theTokenCannotBeVerifiedBecauseOfAnUnsupportedAlgorithm(): void ->loadAndDecryptWithKey($token, $key, $recipient); } - /** - * @test - */ + #[Test] public function theTokenCannotBeVerifiedBecauseOfABadKey(): void { $this->expectException(Exception::class); @@ -83,9 +78,7 @@ public function theTokenCannotBeVerifiedBecauseOfABadKey(): void ->loadAndDecryptWithKey($token, $key, $recipient); } - /** - * @test - */ + #[Test] public function theJweLoaderCanLoadAndDecryptAToken(): void { $token = 'eyJhbGciOiJBMTI4S1ciLCJraWQiOiI4MWIyMDk2NS04MzMyLTQzZDktYTQ2OC04MjE2MGFkOTFhYzgiLCJlbmMiOiJBMTI4R0NNIn0.CBI6oDw8MydIx1IBntf_lQcw2MmJKIQx.Qx0pmsDa8KnJc9Jo.AwliP-KmWgsZ37BvzCefNen6VTbRK3QMA4TkvRkH0tP1bTdhtFJgJxeVmJkLD61A1hnWGetdg11c9ADsnWgL56NyxwSYjU1ZEHcGkd3EkU0vjHi9gTlb90qSYFfeF0LwkcTtjbYKCsiNJQkcIp1yeM03OmuiYSoYJVSpf7ej6zaYcMv3WwdxDFl8REwOhNImk2Xld2JXq6BR53TSFkyT7PwVLuq-1GwtGHlQeg7gDT6xW0JqHDPn_H-puQsmthc9Zg0ojmJfqqFvETUxLAF-KjcBTS5dNy6egwkYtOt8EIHK-oEsKYtZRaa8Z7MOZ7UGxGIMvEmxrGCPeJa14slv2-gaqK0kEThkaSqdYw0FkQZF.ER7MWJZ1FBI_NKvn7Zb1Lw'; diff --git a/tests/Component/Encryption/JWESplitTestCase.php b/tests/Component/Encryption/JWESplitTest.php similarity index 96% rename from tests/Component/Encryption/JWESplitTestCase.php rename to tests/Component/Encryption/JWESplitTest.php index bbdcbe570..df9a154b3 100644 --- a/tests/Component/Encryption/JWESplitTestCase.php +++ b/tests/Component/Encryption/JWESplitTest.php @@ -5,15 +5,14 @@ namespace Jose\Tests\Component\Encryption; use Jose\Component\Encryption\Serializer\JSONGeneralSerializer; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class JWESplitTestCase extends EncryptionTestCase +final class JWESplitTest extends EncryptionTestCase { - /** - * @test - */ + #[Test] public function aJweObjectWithMoreThanOneRecipientCanBeSplittedIntoSeveralJweObjects(): void { $input = '{"recipients":[{"encrypted_key":"dYOD28kab0Vvf4ODgxVAJXgHcSZICSOp8M51zjwj4w6Y5G4XJQsNNIBiqyvUUAOcpL7S7-cFe7Pio7gV_Q06WmCSa-vhW6me4bWrBf7cHwEQJdXihidAYWVajJIaKMXMvFRMV6iDlRr076DFthg2_AV0_tSiV6xSEIFqt1xnYPpmP91tc5WJDOGb-wqjw0-b-S1laS11QVbuP78dQ7Fa0zAVzzjHX-xvyM2wxj_otxr9clN1LnZMbeYSrRicJK5xodvWgkpIdkMHo4LvdhRRvzoKzlic89jFWPlnBq_V4n5trGuExtp_-dbHcGlihqc_wGgho9fLMK8JOArYLcMDNQ","header":{"alg":"RSA1_5","kid":"frodo.baggins@hobbiton.example"}},{"encrypted_key":"ExInT0io9BqBMYF6-maw5tZlgoZXThD1zWKsHixJuw_elY4gSSId_w","header":{"alg":"ECDH-ES+A256KW","kid":"peregrin.took@tuckborough.example","epk":{"kty":"EC","crv":"P-384","x":"Uzdvk3pi5wKCRc1izp5_r0OjeqT-I68i8g2b8mva8diRhsE2xAn2DtMRb25Ma2CX","y":"VDrRyFJh-Kwd1EjAgmj5Eo-CTHAZ53MC7PjjpLioy3ylEjI1pOMbw91fzZ84pbfm"}}},{"encrypted_key":"a7CclAejo_7JSuPB8zeagxXRam8dwCfmkt9-WyTpS1E","header":{"alg":"A256GCMKW","kid":"18ec08e1-bfa9-4d95-b205-2b4dd1d4321d","tag":"59Nqh1LlYtVIhfD3pgRGvw","iv":"AvpeoPZ9Ncn9mkBn"}}],"unprotected":{"cty":"text/plain"},"protected":"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2In0","iv":"VgEIHY20EnzUtZFl2RpB1g","ciphertext":"ajm2Q-OpPXCr7-MHXicknb1lsxLdXxK_yLds0KuhJzfWK04SjdxQeSw2L9mu3a_k1C55kCQ_3xlkcVKC5yr__Is48VOoK0k63_QRM9tBURMFqLByJ8vOYQX0oJW4VUHJLmGhF-tVQWB7Kz8mr8zeE7txF0MSaP6ga7-siYxStR7_G07Thd1jh-zGT0wxM5g-VRORtq0K6AXpLlwEqRp7pkt2zRM0ZAXqSpe1O6FJ7FHLDyEFnD-zDIZukLpCbzhzMDLLw2-8I14FQrgi-iEuzHgIJFIJn2wh9Tj0cg_kOZy9BqMRZbmYXMY9YQjorZ_P_JYG3ARAIF3OjDNqpdYe-K_5Q5crGJSDNyij_ygEiItR5jssQVH2ofDQdLChtazE","tag":"BESYyFN7T09KY7i8zKs5_g"}'; diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTestCase.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php similarity index 98% rename from tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTestCase.php rename to tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php index dd99007dc..fae1ff622 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTestCase.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionProtectedContentOnlyTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.12 * * @internal */ -final class A128KWAndA128GCMEncryptionProtectedContentOnlyTestCase extends EncryptionTestCase +final class A128KWAndA128GCMEncryptionProtectedContentOnlyTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionProtectedContentOnly(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -88,9 +88,8 @@ public function a128KWAndA128GCMEncryptionProtectedContentOnly(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionProtectedContentOnlyBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTestCase.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php similarity index 97% rename from tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php index 4618b5970..5a42d8e81 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.8 * * @internal */ -final class A128KWAndA128GCMEncryptionTestCase extends EncryptionTestCase +final class A128KWAndA128GCMEncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -62,10 +62,7 @@ public function a128KWAndA128GCMEncryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -102,9 +99,8 @@ public function a128KWAndA128GCMEncryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTestCase.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php similarity index 98% rename from tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTestCase.php rename to tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php index 4f8e0a610..e0dbc1766 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTestCase.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.10 * * @internal */ -final class A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTestCase extends EncryptionTestCase +final class A128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithAdditionalAuthenticatedData(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -87,9 +87,8 @@ public function a128KWAndA128GCMEncryptionWithAdditionalAuthenticatedData(): voi /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithAdditionalAuthenticatedDataBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTestCase.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php similarity index 96% rename from tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTestCase.php rename to tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php index 9c3914b66..5311b9fe9 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTestCase.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithCompressionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.9 * * @internal */ -final class A128KWAndA128GCMEncryptionWithCompressionTestCase extends EncryptionTestCase +final class A128KWAndA128GCMEncryptionWithCompressionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithCompression(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -63,10 +63,7 @@ public function a128KWAndA128GCMEncryptionWithCompression(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -103,9 +100,8 @@ public function a128KWAndA128GCMEncryptionWithCompression(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithCompressionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTestCase.php b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php similarity index 98% rename from tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTestCase.php rename to tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php index 985a17bbb..e62dd5494 100644 --- a/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTestCase.php +++ b/tests/Component/Encryption/RFC7520/A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.11 * * @internal */ -final class A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTestCase extends EncryptionTestCase +final class A128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValues(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -89,9 +89,8 @@ public function a128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValues(): v /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a128KWAndA128GCMEncryptionWithSpecificProtectedHeaderValuesBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTestCase.php b/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php similarity index 97% rename from tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php index a8345925c..8858445e1 100644 --- a/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/A256GCMKWAndA128CBC_HS256EncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.7 * * @internal */ -final class A256GCMKWAndA128CBC_HS256EncryptionTestCase extends EncryptionTestCase +final class A256GCMKWAndA128CBC_HS256EncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function a256GCMKWAndA128CBCHS256Encryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -70,10 +70,7 @@ public function a256GCMKWAndA128CBCHS256Encryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -110,9 +107,8 @@ public function a256GCMKWAndA128CBCHS256Encryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function a256GCMKWAndA128CBCHS256EncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTestCase.php b/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php similarity index 96% rename from tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php index 82dc46fdb..9c98d0118 100644 --- a/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/DirAndA128GCMEncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.6 * * @internal */ -final class DirAndA128GCMEncryptionTestCase extends EncryptionTestCase +final class DirAndA128GCMEncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function dirAndA128GCMEncryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -56,10 +56,7 @@ public function dirAndA128GCMEncryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame($expected_tag, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getTag())); @@ -75,9 +72,8 @@ public function dirAndA128GCMEncryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function dirAndA128GCMEncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTestCase.php b/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php similarity index 97% rename from tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php index 933c27ea8..0ac5faf70 100644 --- a/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/ECDH_ES_A128KWAndA128GCMEncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.4 * * @internal */ -final class ECDH_ES_A128KWAndA128GCMEncryptionTestCase extends EncryptionTestCase +final class ECDH_ES_A128KWAndA128GCMEncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function eCDHESA128KWAndA128GCMEncryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -70,10 +70,7 @@ public function eCDHESA128KWAndA128GCMEncryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -110,9 +107,8 @@ public function eCDHESA128KWAndA128GCMEncryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function eCDHESA128KWAndA128GCMEncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTestCase.php b/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php similarity index 96% rename from tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php index f616d5d3f..045db225e 100644 --- a/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/ECDH_ES_AndA128CBC_HS256EncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.5 * * @internal */ -final class ECDH_ES_AndA128CBC_HS256EncryptionTestCase extends EncryptionTestCase +final class ECDH_ES_AndA128CBC_HS256EncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function eCDHESAndA128CBCHS256Encryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -62,10 +62,7 @@ public function eCDHESAndA128CBCHS256Encryption(): void $loaded_json = $this->getJWESerializerManager() ->unserialize($expected_json); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame($expected_tag, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getTag())); @@ -84,9 +81,8 @@ public function eCDHESAndA128CBCHS256Encryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function eCDHESAndA128CBCHS256EncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTestCase.php b/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php similarity index 99% rename from tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php index fff06317b..eae257f36 100644 --- a/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/MultipleRecipientEncryptionTest.php @@ -8,20 +8,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.13 * * @internal */ -final class MultipleRecipientEncryptionTestCase extends EncryptionTestCase +final class MultipleRecipientEncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function multipleRecipientEncryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -138,9 +138,8 @@ public function multipleRecipientEncryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function multipleRecipientEncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -246,9 +245,7 @@ public function multipleRecipientEncryptionBis(): void static::assertSame($expected_payload, $loaded_json->getPayload()); } - /** - * @test - */ + #[Test] public function multipleRecipientEncryptionWithDifferentContentEncryptionAlgorithm(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTestCase.php b/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php similarity index 97% rename from tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php index 6f6f0e7f1..fe8c16a2b 100644 --- a/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest.php @@ -6,22 +6,22 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; -use const JSON_THROW_ON_ERROR; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; +use const JSON_THROW_ON_ERROR; /** * @see https://tools.ietf.org/html/rfc7520#section-5.3 * * @internal */ -final class PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTestCase extends EncryptionTestCase +final class PBES2_HS512_A256KWAndA128CBC_HS256EncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function pBES2HS512A256KWAndA128CBCHS256Encryption(): void { $expected_payload = [ @@ -85,10 +85,7 @@ public function pBES2HS512A256KWAndA128CBCHS256Encryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -134,9 +131,8 @@ public function pBES2HS512A256KWAndA128CBCHS256Encryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function pBES2HS512A256KWAndA128CBCHS256EncryptionBis(): void { $expected_payload = json_encode([ diff --git a/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTestCase.php b/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php similarity index 98% rename from tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php index 687cd0657..8c8796809 100644 --- a/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/RSA1_5AndA128CBC_HS256EncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.1 * * @internal */ -final class RSA1_5AndA128CBC_HS256EncryptionTestCase extends EncryptionTestCase +final class RSA1_5AndA128CBC_HS256EncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function rSA15AndA128CBCHS256Encryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -68,10 +68,7 @@ public function rSA15AndA128CBCHS256Encryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -108,9 +105,8 @@ public function rSA15AndA128CBCHS256Encryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function rSA15AndA128CBCHS256EncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTestCase.php b/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php similarity index 98% rename from tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTestCase.php rename to tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php index 2e7e6cfdd..1a8491304 100644 --- a/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTestCase.php +++ b/tests/Component/Encryption/RFC7520/RSA_OAEPAndA256GCMEncryptionTest.php @@ -7,20 +7,20 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Encryption\EncryptionTestCase; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-5.2 * * @internal */ -final class RSA_OAEPAndA256GCMEncryptionTestCase extends EncryptionTestCase +final class RSA_OAEPAndA256GCMEncryptionTest extends EncryptionTestCase { /** * Please note that we cannot the encryption and get the same result as the example (IV, TAG and other data are * always different). The output given in the RFC is used and only decrypted. - * - * @test */ + #[Test] public function rSAOAEPAndA256GCMEncryption(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; @@ -69,10 +69,7 @@ public function rSAOAEPAndA256GCMEncryption(): void ->unserialize($expected_json); static::assertTrue($jweDecrypter->decryptUsingKey($loaded_json, $private_key, 0)); - static::assertSame( - $expected_ciphertext, - Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext()) - ); + static::assertSame($expected_ciphertext, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getCiphertext())); static::assertSame($protectedHeader, $loaded_compact_json->getSharedProtectedHeader()); static::assertSame($expected_iv, Base64UrlSafe::encodeUnpadded($loaded_compact_json->getIV())); static::assertSame( @@ -109,9 +106,8 @@ public function rSAOAEPAndA256GCMEncryption(): void /** * Same input as before, but we perform the encryption first. - * - * @test */ + #[Test] public function rSAOAEPAndA256GCMEncryptionBis(): void { $expected_payload = "You can trust us to stick with you through thick and thin\xe2\x80\x93to the bitter end. And you can trust us to keep any secret of yours\xe2\x80\x93closer than you keep it yourself. But you cannot trust us to let you face trouble alone, and go off without a word. We are your friends, Frodo."; diff --git a/tests/Component/Encryption/RSAEncryptionTestCase.php b/tests/Component/Encryption/RSAEncryptionTest.php similarity index 99% rename from tests/Component/Encryption/RSAEncryptionTestCase.php rename to tests/Component/Encryption/RSAEncryptionTest.php index a75b6b901..2448a3013 100644 --- a/tests/Component/Encryption/RSAEncryptionTestCase.php +++ b/tests/Component/Encryption/RSAEncryptionTest.php @@ -5,17 +5,17 @@ namespace Jose\Tests\Component\Encryption; use Jose\Component\Core\JWKSet; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class RSAEncryptionTestCase extends EncryptionTestCase +final class RSAEncryptionTest extends EncryptionTestCase { /** * @see https://tools.ietf.org/html/rfc7516 - * - * @test */ + #[Test] public function loadJWEFromRFC7516(): void { $jweDecrypter = $this->getJWEDecrypterFactory() @@ -35,9 +35,8 @@ public function loadJWEFromRFC7516(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.4 - * - * @test */ + #[Test] public function loadJWEJSONSerialization(): void { $jweDecrypter = $this->getJWEDecrypterFactory() diff --git a/tests/Component/Encryption/RSAKeyEncryptionTestCase.php b/tests/Component/Encryption/RSAKeyEncryptionTest.php similarity index 99% rename from tests/Component/Encryption/RSAKeyEncryptionTestCase.php rename to tests/Component/Encryption/RSAKeyEncryptionTest.php index e21ad00fc..c2006b3ec 100644 --- a/tests/Component/Encryption/RSAKeyEncryptionTestCase.php +++ b/tests/Component/Encryption/RSAKeyEncryptionTest.php @@ -11,6 +11,7 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use const STR_PAD_LEFT; /** @@ -18,11 +19,9 @@ * * @internal */ -final class RSAKeyEncryptionTestCase extends EncryptionTestCase +final class RSAKeyEncryptionTest extends EncryptionTestCase { - /** - * @test - */ + #[Test] public function invalidKey(): void { $this->expectException(InvalidArgumentException::class); @@ -43,9 +42,8 @@ public function invalidKey(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.2 - * - * @test */ + #[Test] public function rSA15EncryptionAndDecryption(): void { $header = []; @@ -114,9 +112,8 @@ public function rSA15EncryptionAndDecryption(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.1 - * - * @test */ + #[Test] public function rSAOAEPEncryptionAndDecryption(): void { $header = []; @@ -185,9 +182,8 @@ public function rSAOAEPEncryptionAndDecryption(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.1 - * - * @test */ + #[Test] public function rSAOAEP256EncryptionAndDecryption(): void { $header = []; @@ -251,9 +247,8 @@ public function rSAOAEP256EncryptionAndDecryption(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.1 - * - * @test */ + #[Test] public function loadJWK1(): void { $jweDecrypter = $this->getJWEDecrypterFactory() @@ -273,9 +268,8 @@ public function loadJWK1(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.2 - * - * @test */ + #[Test] public function loadJWK2(): void { $jweDecrypter = $this->getJWEDecrypterFactory() @@ -293,9 +287,8 @@ public function loadJWK2(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.3 - * - * @test */ + #[Test] public function loadJWK3(): void { $jweDecrypter = $this->getJWEDecrypterFactory() diff --git a/tests/Component/Encryption/RSAKeyWithoutAllPrimesTestCase.php b/tests/Component/Encryption/RSAKeyWithoutAllPrimesTest.php similarity index 93% rename from tests/Component/Encryption/RSAKeyWithoutAllPrimesTestCase.php rename to tests/Component/Encryption/RSAKeyWithoutAllPrimesTest.php index a8ba25d07..a7b7fca2e 100644 --- a/tests/Component/Encryption/RSAKeyWithoutAllPrimesTestCase.php +++ b/tests/Component/Encryption/RSAKeyWithoutAllPrimesTest.php @@ -6,19 +6,18 @@ use Jose\Component\Core\JWK; use Jose\Component\Core\Util\JsonConverter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; /** * Class RSAKeyWithoutAllPrimesTest. * * @internal */ -final class RSAKeyWithoutAllPrimesTestCase extends EncryptionTestCase +final class RSAKeyWithoutAllPrimesTest extends EncryptionTestCase { - /** - * @dataProvider dataEncryptionAlgorithms - * - * @test - */ + #[DataProvider('dataEncryptionAlgorithms')] + #[Test] public function encryptionAlgorithms(string $encryption_algorithm): void { $key = $this->getPrivateKey(); @@ -50,11 +49,8 @@ public function encryptionAlgorithms(string $encryption_algorithm): void static::assertTrue($jweDecrypter->decryptUsingKey($loaded, $key, 0)); } - /** - * @dataProvider dataEncryptionAlgorithms - * - * @test - */ + #[DataProvider('dataEncryptionAlgorithms')] + #[Test] public function encryptionAlgorithmsWithMinimalRsaKey(string $encryption_algorithm): void { $key = $this->getMinimalPrivateKey(); @@ -93,9 +89,10 @@ public static function dataEncryptionAlgorithms(): iterable yield ['RSA-OAEP-256']; } - public function dataEncryptionAlgorithmsWithSimpleKey(): array + public function dataEncryptionAlgorithmsWithSimpleKey(): iterable { - return [['RSA-OAEP'], ['RSA-OAEP-256']]; + yield ['RSA-OAEP']; + yield ['RSA-OAEP-256']; } private function getPrivateKey(): JWK diff --git a/tests/Component/KeyManagement/CertificateTest.php b/tests/Component/KeyManagement/CertificateTest.php index af0c5d405..c2eaef8e7 100644 --- a/tests/Component/KeyManagement/CertificateTest.php +++ b/tests/Component/KeyManagement/CertificateTest.php @@ -9,6 +9,8 @@ use Jose\Component\Core\Util\RSAKey; use Jose\Component\KeyManagement\JWKFactory; use Jose\Component\KeyManagement\KeyConverter\KeyConverter; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -18,9 +20,7 @@ */ final class CertificateTest extends TestCase { - /** - * @test - */ + #[Test] public function fileNotFound(): void { $this->expectException(InvalidArgumentException::class); @@ -29,9 +29,7 @@ public function fileNotFound(): void KeyConverter::loadKeyFromCertificateFile('file:///foo/bar'); } - /** - * @test - */ + #[Test] public function fileNotValid(): void { $this->expectException(InvalidArgumentException::class); @@ -39,9 +37,7 @@ public function fileNotValid(): void KeyConverter::loadKeyFromCertificateFile(__DIR__ . __FILE__); } - /** - * @test - */ + #[Test] public function rsaEncryptedPrivateKeyConversion(): void { // When @@ -61,9 +57,7 @@ public function rsaEncryptedPrivateKeyConversion(): void ]); } - /** - * @test - */ + #[Test] public function rsaPublicKeyConversion(): void { // When @@ -82,9 +76,7 @@ public function rsaPublicKeyConversion(): void static::assertSame($content, $rsaKey->toPEM()); } - /** - * @test - */ + #[Test] public function certificateConversionPkcs8(): void { $details = KeyConverter::loadFromKeyFile(__DIR__ . '/Keys/RSA/pkcs8.private.encrypted.key', 'tests'); @@ -101,11 +93,8 @@ public function certificateConversionPkcs8(): void ]); } - /** - * @dataProvider dataLoadCertificate - * - * @test - */ + #[Test] + #[DataProvider('dataLoadCertificate')] public function loadCertificate(string $file, array $expected_values): void { $result = KeyConverter::loadKeyFromCertificateFile($file); @@ -327,9 +316,7 @@ public static function dataLoadCertificate(): iterable ]; } - /** - * @test - */ + #[Test] public function loadX5CParameter(): void { $key = new JWK([ @@ -348,20 +335,17 @@ public function loadX5CParameter(): void 'kid' => '1b94c', ]); - static::assertEqualsCanonicalizing( - [ - 'kty' => 'RSA', - 'use' => 'sig', - 'kid' => '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LEZ4Iel+W1GC8ugMhyr4/p1MtcIM42EA8BzE6ZQqC7VPqPvEjZ2dbZkaBhPbiZAS3YeYBRDWm1p1OZtWamT3cEvqqPpnjL1XyW+oyVVkaZdklLQp2Btgt9qr21m42f4wTw+Xrp6rCKNb0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAh8zGlfSlcI0o3rYDPBB07aXNswb4ECNIKG0CETTUxmXl9KUL+9gGlqCz5iWLOgWsnrcKcY0vXPG9J1r9AqBNTqNgHq2G03X09266X5CpOe1zFo+Owb1zxtp3PehFdfQJ610CDLEaS9V9Rqp17hCyybEpOGVwe8fnk+fbEL2Bo3UPGrpsHzUoaGpDftmWssZkhpBJKVMJyf/RuP2SmmaIzmnw9JiSlYhzo4tpzd5rFXhjRbg4zW9C+2qok+2+qDM1iJ684gPHMIY8aLWrdgQTxkumGmTqgawR+N5MDtdPTEQ0XfIBc2cJEUyMTY5MPvACWpkA6SdS4xSvdXK3IVfOWA==', - ], + static::assertEqualsCanonicalizing([ + 'kty' => 'RSA', + 'use' => 'sig', + 'kid' => '1b94c', + 'n' => 'vrjOfz9Ccdgx5nQudyhdoR17V-IubWMeOZCwX_jj0hgAsz2J_pqYW08PLbK_PdiVGKPrqzmDIsLI7sA25VEnHU1uCLNwBuUiCO11_-7dYbsr4iJmG0Qu2j8DsVyT1azpJC_NG84Ty5KKthuCaPod7iI7w0LK9orSMhBEwwZDCxTWq4aYWAchc8t-emd9qOvWtVMDC2BXksRngh6X5bUYLy6AyHKvj-nUy1wgzjYQDwHMTplCoLtU-o-8SNnZ1tmRoGE9uJkBLdh5gFENabWnU5m1ZqZPdwS-qo-meMvVfJb6jJVWRpl2SUtCnYG2C32qvbWbjZ_jBPD5eunqsIo1vQ', + 'e' => 'AQAB', + 'x5t' => '4pNenEBLv0JpLIdugWxQkOsZcK0', + 'x5t#256' => 'pJm2BBpkB8y7tCqrWM0X37WOmQTO8zQw-VpxVgBb21I', + 'x5c' => [ + 'MIIDQjCCAiqgAw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5MPvACWpkA6SdS4xSvdXK3IVfOWA==', ], - $certificate->all() - ); + ], $certificate->all()); } } diff --git a/tests/Component/KeyManagement/JWKAnalyzerTest.php b/tests/Component/KeyManagement/JWKAnalyzerTest.php index cdced50f0..121afac50 100644 --- a/tests/Component/KeyManagement/JWKAnalyzerTest.php +++ b/tests/Component/KeyManagement/JWKAnalyzerTest.php @@ -20,6 +20,8 @@ use Jose\Component\KeyManagement\Analyzer\UsageAnalyzer; use Jose\Component\KeyManagement\Analyzer\ZxcvbnKeyAnalyzer; use Jose\Component\KeyManagement\JWKFactory; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -29,9 +31,7 @@ final class JWKAnalyzerTest extends TestCase { private ?KeyAnalyzerManager $keyAnalyzerManager = null; - /** - * @test - */ + #[Test] public function iCanAnalyzeANoneKeyAndGetMessages(): void { $key = JWKFactory::createNoneKey(); @@ -41,9 +41,7 @@ public function iCanAnalyzeANoneKeyAndGetMessages(): void static::assertNotEmpty($messages); } - /** - * @test - */ + #[Test] public function iCanAnalyzeAnRsaKeyAndGetMessages(): void { $key = new JWK([ @@ -58,10 +56,8 @@ public function iCanAnalyzeAnRsaKeyAndGetMessages(): void static::assertNotEmpty($messages); } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function theRsaKeyHasALowExponent(): void { $key = JWK::createFromJson( @@ -78,9 +74,7 @@ public function theRsaKeyHasALowExponent(): void static::fail('The low exponent should be catched'); } - /** - * @test - */ + #[Test] public function iCanAnalyzeAnOctKeyAndGetMessages(): void { $key = JWKFactory::createOctKey(16, [ @@ -93,9 +87,7 @@ public function iCanAnalyzeAnOctKeyAndGetMessages(): void static::assertNotEmpty($messages); } - /** - * @test - */ + #[Test] public function iCanAnalyzeAnES521OctKeyAndGetMessages(): void { $key = JWKFactory::createECKey('P-521', [ diff --git a/tests/Component/KeyManagement/JWKFactoryTest.php b/tests/Component/KeyManagement/JWKFactoryTest.php index 9d6fe7758..c777b5034 100644 --- a/tests/Component/KeyManagement/JWKFactoryTest.php +++ b/tests/Component/KeyManagement/JWKFactoryTest.php @@ -6,65 +6,55 @@ use Jose\Component\Core\Util\ECKey; use Jose\Component\KeyManagement\JWKFactory; -use const JSON_THROW_ON_ERROR; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class JWKFactoryTest extends TestCase { - /** - * @test - */ + #[Test] public function iCanLoadAP12CertificateThatContainsARSAKey(): never { static::markTestIncomplete('Unable to run this test using the last OpenSSL versions'); $result = JWKFactory::createFromPKCS12CertificateFile(__DIR__ . '/P12/CertRSA.p12', 'cert'); - static::assertSame( - [ - 'kty' => 'RSA', - 'n' => 'acqZqFSLArU71p9yp8ZH1nDfi5g0TLgPCgAYESrfb-DB0_F89LUSSukRRkCjNCuJqp6j6jpe4VmJ2YzGiBV3eoMqORIdUmQ3XlKKX_ONM3oWhZZoFS_2s1RLFl1faXORe4JSJIN9gt_4EpXoKTjX1gftTcFOLrXPgODEwjAYll0', - 'e' => 'AQAB', - 'd' => 'F5wRgtGrXGVZ_2ICUpMbwS3blenX8i85m_-9X0d0KiG84DIKswoeFP3Czyzpv2DgDmXtKv7v4db7vsN-Iyy3RyKmX6y_1yfahMGbLqYl7pFQ2nYooZJI4XRJMDbtfX5l7QqiDDkQrHPcUNlC361WKf8rWlVlIDfwHrBkvp-UPoE', - 'p' => 'gbDt-jRqRZw1Dwg_Ckl_vBRWqCfWfem1YALgpud5FCnPtXoHHcMPayTUb8mjWioN4HIjMIJ29abtvXq3zvhYcQ', - 'q' => '0NLnRW0gajCpa0bA76AbF_MQhxGWH_ZQBfLtEq4NFGWdk_CslovUzJJ4DnW96TfthHgGQEqETtZweQd53kryrQ', - 'dp' => 'KhbWlM3v81lnqtI9S0RhLRPYr8gGB2USlO86I1CZ7d5H55iLuK_2UApq20CwP_HIASBppTOiEcU0ALtT7dqRMQ', - 'dq' => 'WOvmBV9BtVZBXmgDkkZoIxuixxFLDxMw4keeghzRfwUCQ9Pxei3TEMWyD949X0ksgAMoDkps6rFPtYnkcC8UBQ', - 'qi' => 'R-TcgNYrZs8iYmR3pI2UwFhrmJl98vzzSkI4rGTON0vPrnl_46KqzpiW04dBj3yQxhlKyPO8TO0tnA3AYnDc-Q', - ], - $result->all() - ); + static::assertSame([ + 'kty' => 'RSA', + 'n' => 'acqZqFSLArU71p9yp8ZH1nDfi5g0TLgPCgAYESrfb-DB0_F89LUSSukRRkCjNCuJqp6j6jpe4VmJ2YzGiBV3eoMqORIdUmQ3XlKKX_ONM3oWhZZoFS_2s1RLFl1faXORe4JSJIN9gt_4EpXoKTjX1gftTcFOLrXPgODEwjAYll0', + 'e' => 'AQAB', + 'd' => 'F5wRgtGrXGVZ_2ICUpMbwS3blenX8i85m_-9X0d0KiG84DIKswoeFP3Czyzpv2DgDmXtKv7v4db7vsN-Iyy3RyKmX6y_1yfahMGbLqYl7pFQ2nYooZJI4XRJMDbtfX5l7QqiDDkQrHPcUNlC361WKf8rWlVlIDfwHrBkvp-UPoE', + 'p' => 'gbDt-jRqRZw1Dwg_Ckl_vBRWqCfWfem1YALgpud5FCnPtXoHHcMPayTUb8mjWioN4HIjMIJ29abtvXq3zvhYcQ', + 'q' => '0NLnRW0gajCpa0bA76AbF_MQhxGWH_ZQBfLtEq4NFGWdk_CslovUzJJ4DnW96TfthHgGQEqETtZweQd53kryrQ', + 'dp' => 'KhbWlM3v81lnqtI9S0RhLRPYr8gGB2USlO86I1CZ7d5H55iLuK_2UApq20CwP_HIASBppTOiEcU0ALtT7dqRMQ', + 'dq' => 'WOvmBV9BtVZBXmgDkkZoIxuixxFLDxMw4keeghzRfwUCQ9Pxei3TEMWyD949X0ksgAMoDkps6rFPtYnkcC8UBQ', + 'qi' => 'R-TcgNYrZs8iYmR3pI2UwFhrmJl98vzzSkI4rGTON0vPrnl_46KqzpiW04dBj3yQxhlKyPO8TO0tnA3AYnDc-Q', + ], $result->all()); } - /** - * @test - */ + #[Test] public function createFromECCertificateFileInDERFormat(): void { $result = JWKFactory::createFromCertificateFile(__DIR__ . '/EC/DER/prime256v1-cert.der'); - static::assertSame( - [ - 'kty' => 'EC', - 'crv' => 'P-256', - 'x' => 'xEsr_55aqgFXdrbRNz1_WSNI8UaSUxCka2kGEN1bXsI', - 'y' => 'SM45Hsr9dnUR6Ox-TpmNv2fbDX4CoVo-3patMUpXANA', - 'x5c' => [ - 'MIIB0jCCAXegAwIBAgIJAK2o1kQ5JwpUMAoGCCqGSM49BAMCMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTUxMTA4MTUxMTU2WhcNMTYxMTA3MTUxMTU2WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExEsr/55aqgFXdrbRNz1/WSNI8UaSUxCka2kGEN1bXsJIzjkeyv12dRHo7H5OmY2/Z9sNfgKhWj7elq0xSlcA0KNQME4wHQYDVR0OBBYEFKIGgCZoS388STT0qjoX/swKYBXhMB8GA1UdIwQYMBaAFKIGgCZoS388STT0qjoX/swKYBXhMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhAK5OqQoBGR/pj2NOb+PyRKK4k4d3Muj9z/6LsJK+kkgUAiEA+FY4SWKv4mfe0gsOBId0Aah/HtVZxDBe3bCXOQM8MMM=', - ], - 'x5t' => 'ZnnaQDssCKJQZLp6zyHssIZOa7o', - 'x5t#256' => 'v7VlokKTGL3anRk8Nl0VcqVC9u5j2Fb5tdlQntUgDT4', + static::assertSame([ + 'kty' => 'EC', + 'crv' => 'P-256', + 'x' => 'xEsr_55aqgFXdrbRNz1_WSNI8UaSUxCka2kGEN1bXsI', + 'y' => 'SM45Hsr9dnUR6Ox-TpmNv2fbDX4CoVo-3patMUpXANA', + 'x5c' => [ + 'MIIB0jCCAXegAwIBAgIJAK2o1kQ5JwpUMAoGCCqGSM49BAMCMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTUxMTA4MTUxMTU2WhcNMTYxMTA3MTUxMTU2WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExEsr/55aqgFXdrbRNz1/WSNI8UaSUxCka2kGEN1bXsJIzjkeyv12dRHo7H5OmY2/Z9sNfgKhWj7elq0xSlcA0KNQME4wHQYDVR0OBBYEFKIGgCZoS388STT0qjoX/swKYBXhMB8GA1UdIwQYMBaAFKIGgCZoS388STT0qjoX/swKYBXhMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhAK5OqQoBGR/pj2NOb+PyRKK4k4d3Muj9z/6LsJK+kkgUAiEA+FY4SWKv4mfe0gsOBId0Aah/HtVZxDBe3bCXOQM8MMM=', ], - $result->all() - ); + 'x5t' => 'ZnnaQDssCKJQZLp6zyHssIZOa7o', + 'x5t#256' => 'v7VlokKTGL3anRk8Nl0VcqVC9u5j2Fb5tdlQntUgDT4', + ], $result->all()); } - /** - * @test - */ + #[Test] public function createFromSecret(): void { $jwk = JWKFactory::createFromSecret('This is a very secured secret!!!!', [ @@ -78,9 +68,7 @@ public function createFromSecret(): void static::assertSame('FOO', $jwk->get('kid')); } - /** - * @test - */ + #[Test] public function createFromKey(): void { $jwk = JWKFactory::createFromKey(file_get_contents(__DIR__ . '/Keys/EC/private.es256.encrypted.key'), 'test'); @@ -90,99 +78,77 @@ public function createFromKey(): void ); } - /** - * @test - */ + #[Test] public function createFromResource(): void { $res = openssl_x509_read(file_get_contents(__DIR__ . '/RSA/PEM/1024b-rsa-example-cert.pem')); $jwk = JWKFactory::createFromX509Resource($res); - static::assertSame( - [ - 'kty' => 'RSA', - 'n' => 'xgEGvHk-U_RY0j9l3MP7o-S2a6uf4XaRBhu1ztdCHz8tMG8Kj4_qJmgsSZQD17sRctHGBTUJWp4CLtBwCf0zAGVzySwUkcHSu1_2mZ_w7Nr0TQHKeWr_j8pvXH534DKEvugr21DAHbi4c654eLUL-JW_wJJYqJh7qHM3W3Fh7ys', - 'e' => 'AQAB', - 'x5c' => [ - 'MIICVjCCAb8CAg37MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwGA1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNEREMRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdlYiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIwODIyMDUyNzIzWhcNMTcwODIxMDUyNzIzWjBKMQswCQYDVQQGEwJKUDEOMAwGA1UECAwFVG9reW8xETAPBgNVBAoMCEZyYW5rNEREMRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMYBBrx5PlP0WNI/ZdzD+6Pktmurn+F2kQYbtc7XQh8/LTBvCo+P6iZoLEmUA9e7EXLRxgU1CVqeAi7QcAn9MwBlc8ksFJHB0rtf9pmf8Oza9E0Bynlq/4/Kb1x+d+AyhL7oK9tQwB24uHOueHi1C/iVv8CSWKiYe6hzN1txYe8rAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAASPdjigJkXCqKWpnZ/Oc75E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N1txYe8rAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAASPdjigJkXCqKWpnZ/Oc75EUcMi6HztaW8abUMlYXPIgkV2F7YanHOB7K4f7OOLjiz8DTPFfjC9UeuErhaA/zzWi8ewMTFZW/WshOrm3fNvcMrMLKtH534JKvcdMg6qIdjTFINIrevnAhf0cwULaebn+lMs8Pdl7y37+sfluVok=', ], - $jwk->all() - ); + 'x5t' => '4bK45ewZ00Wk-a_shpTw2cCqJc8', + 'x5t#256' => '5F5GTPOxBGAOsVyuYzqUBjri0R2YDTiDowiQbs6oGgU', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function createFromECCertificateFileInPEMFormat(): void { $result = JWKFactory::createFromCertificateFile(__DIR__ . '/EC/PEM/prime256v1-cert.pem'); - static::assertSame( - [ - 'kty' => 'EC', - 'crv' => 'P-256', - 'x' => 'xEsr_55aqgFXdrbRNz1_WSNI8UaSUxCka2kGEN1bXsI', - 'y' => 'SM45Hsr9dnUR6Ox-TpmNv2fbDX4CoVo-3patMUpXANA', - 'x5c' => [ - 'MIIB0jCCAXegAwIBAgIJAK2o1kQ5JwpUMAoGCCqGSM49BAMCMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTUxMTA4MTUxMTU2WhcNMTYxMTA3MTUxMTU2WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExEsr/55aqgFXdrbRNz1/WSNI8UaSUxCka2kGEN1bXsJIzjkeyv12dRHo7H5OmY2/Z9sNfgKhWj7elq0xSlcA0KNQME4wHQYDVR0OBBYEFKIGgCZoS388STT0qjoX/swKYBXhMB8GA1UdIwQYMBaAFKIGgCZoS388STT0qjoX/swKYBXhMAw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ssIZOa7o', + 'x5t#256' => 'v7VlokKTGL3anRk8Nl0VcqVC9u5j2Fb5tdlQntUgDT4', + ], $result->all()); } - /** - * @test - */ + #[Test] public function createFrom32kRSACertificateFileInDERFormat(): void { $result = JWKFactory::createFromCertificateFile(__DIR__ . '/RSA/DER/32k-rsa-example-cert.der'); - static::assertSame( - [ - 'kty' => 'RSA', - 'n' => 'qzPFsFIf3cSes25DloV3y3d8gKMcZVE_EQ_6e_MZnyqDbuOEP39yQs3aunzbZRoO8Xw8lLoJNduiKKsco7odI753kBvz1eLyke-sWBVZttbnYyz9AE3ZXfAb9rHW2AxgIqHNsQOsLJS_douGZwxawNdE90WM4QG80bDpkxxHfObtmZIbZoOFSeokDHA5jokQGzJ65t6ARtQOIht84pIlAr8RO0vCUiJ0R4TdAffbdIukMcVfSoZBlZJ_q-yBtPoqB1Nmr1x1FqCtR81NrEtdp7CUHy4yLIskMzHTwJL24dx8zPS9RBIAuR6HO6soQwQgKY5NYmyaZGuWDrzw0Lor9_jjcx3x7NlXEUffGyUdT_bZ6owsgd-SpvnbqXPXIf-u5JH7afSUuajytHnGVilQOpEg06B0F-AumUEx8vdLPczCx0CED11mhRhT1eRQPJlzxgqA22SN1Yz0P55R8QbfFYcflpEtZbHmdvwMSipEoEUyI8aA9z268oNVnnAGhG3cOqk8-4HOvtqZ9LIc8jUcQLtWX-PJav9EePnWuV6pFwzvKcwl09m08xIfIh9DvFVJz3Fks-X6c1tVo2Valftlj8fnlzu9WgownkwhM4KN2UpcHcff4G-v9zckhcpROSzZ1ax5mPOUMF6B2OVawMhf3li9A9JEpBDxVu2-gZU6NbhvfH1f4PdNPUnlasPylHn4qz4S6_V1fuxho-2O_V72w3V5FDBi-m2D9vDVQvJtuoiJxUEyOWaxsenuzoFlq3jNHwm0SiabwVjaMyre4qktmHopLuLX2ixME3rbTtaXLAaly-t2X6oS4nFyhwP9f_WbJb4Yh_RDxksPj1hR_4nH43NTYjZBlLDM0YRb4xRzFmATQOUhPou6LSUb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Ij1zqner1R3+0E3/IJw1xRXHStLoQZ/MzxVg4bDKIFUECBUOMFeIoGxRVYDeWN861iEsoEMeSqG+hBpzNIjZ8pfsvtzCBd4F1ySho2GejqYKlkFqa7IFnUjLpOeC5CLn0wIIp2JzMil966ZtIMSi/LYhtCY+qV38kjpY65+CV2IhO7eFdHko1rNqfaZzc2sq7VIRdml3NvjAllnbpT/XETYYswmu7TnJmhU0SQ3vYOFqAzVHmiofA/NFyfdqF1i9TMOg/pQcSlrvoDbeWpp9jsX3yXrqGYCddeUQrMRXC2FijFYA1i1WzGz02S00l00wHc4IycKj0FaR5+aOWvMwlKQE//WZ/E3ajdbW0w1emTk5A87bT95Y8XeJiGhtKjx9zHNe3D1uDUFevRMAOPSGX/PiPD3fBUYYuWwDepiy1rLQj3ImAcFmaHFztXUnM1Z3DEgOZGADl4KbUQtUHGki6n1YZmVSzWvPCpfMj7fuLuXd3AV8J/+LaDyb6A1CO4zpiqRLP5cpyf6wkSDVdIyGgHXmyBgT1T7Y5778QYsrR05TbPIc7jQXyCG+Epam4BwhNf9CcQyt6bCyIKXQ8ScZn3wFfOVG93UwU1zRlTDM37BNXGziM2S141unQyMgoDljoWIIRfqSg1Zj1wtdI2DhcbgixZFCt8ifZZYXP+eHOVpk2b81QzWSYpFEQ+ay9AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEATPINk/17H+RLz459iCVQAGes8kc5sxYj3CkMlWrGMiCxvsgu2kak6dCa0f3DfiVt54Fry7s0OklHiZmipoiF4RCtyJwUSAzRrZFAbkpDg8oIu4Ui/Bt13kY7xON+u4m0IgkLZSE+8BSjMrfjVvVxe+qH5i7X/ibUTDjgyfdA8XI=', ], - $result->all() - ); + 'x5t' => 'KGApLybHWJmBwZGgBk07AlRD9nU', + 'x5t#256' => 'YD12k6kc4xuh_5vEHMyyOFpGs6VqTyaKMlxg0Nt2crA', + ], $result->all()); } - /** - * @test - */ + #[Test] public function createFrom32kRSACertificateFileInPEMFormat(): void { $result = JWKFactory::createFromCertificateFile(__DIR__ . '/RSA/PEM/32k-rsa-example-cert.pem'); - static::assertSame( - [ - 'kty' => 'RSA', - 'n' => 'qzPFsFIf3cSes25DloV3y3d8gKMcZVE_EQ_6e_MZnyqDbuOEP39yQs3aunzbZRoO8Xw8lLoJNduiKKsco7odI753kBvz1eLyke-sWBVZttbnYyz9AE3ZXfAb9rHW2AxgIqHNsQOsLJS_douGZwxawNdE90WM4QG80bDpkxxHfObtmZIbZoOFSeokDHA5jokQGzJ65t6ARtQOIht84pIlAr8RO0vCUiJ0R4TdAffbdIukMcVfSoZBlZJ_q-yBtPoqB1Nmr1x1FqCtR81NrEtdp7CUHy4yLIskMzHTwJL24dx8zPS9RBIAuR6HO6soQwQgKY5NYmyaZGuWDrzw0Lor9_jjcx3x7NlXEUffGyUdT_bZ6owsgd-SpvnbqXPXIf-u5JH7afSUuajytHnGVilQOpEg06B0F-AumUEx8vdLPczCx0CED11mhRhT1eRQPJlzxgqA22SN1Yz0P55R8QbfFYcflpEtZbHmdvwMSipEoEUyI8aA9z268oNVnnAGhG3cOqk8-4HOvtqZ9LIc8jUcQLtWX-PJav9EePnWuV6pFwzvKcwl09m08xIfIh9DvFVJz3Fks-X6c1tVo2Valftlj8fnlzu9WgownkwhM4KN2UpcHcff4G-v9zckhcpROSzZ1ax5mPOUMF6B2OVawMhf3li9A9JEpBDxVu2-gZU6NbhvfH1f4PdNPUnlasPylHn4qz4S6_V1fuxho-2O_V72w3V5FDBi-m2D9vDVQvJtuoiJxUEyOWaxsenuzoFlq3jNHwm0SiabwVjaMyre4qktmHopLuLX2ixME3rbTtaXLAaly-t2X6oS4nFyhwP9f_WbJb4Yh_RDxksPj1hR_4nH43NTYjZBlLDM0YRb4xRzFmATQOUhPou6LSUbl8Tl2z7WYFzlcKgHwkWRaTGUV8Sz_h-_IfgZDvCtyyLhzvWOmfJBhsV1nTbDrr8DivZGH5huBNH88v_gbCVw36aAjH8BnmcHQ0ImUUwXoiB1iWSWB3x1xdYnAyQf5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IIp2JzMil966ZtIMSi/LYhtCY+qV38kjpY65+CV2IhO7eFdHko1rNqfaZzc2sq7VIRdml3NvjAllnbpT/XETYYswmu7TnJmhU0SQ3vYOFqAzVHmiofA/NFyfdqF1i9TMOg/pQcSlrvoDbeWpp9jsX3yXrqGYCddeUQrMRXC2FijFYA1i1WzGz02S00l00wHc4IycKj0FaR5+aOWvMwlKQE//WZ/E3ajdbW0w1emTk5A87bT95Y8XeJiGhtKjx9zHNe3D1uDUFevRMAOPSGX/PiPD3fBUYYuWwDepiy1rLQj3ImAcFmaHFztXUnM1Z3DEgOZGADl4KbUQtUHGki6n1YZmVSzWvPCpfMj7fuLuXd3AV8J/+LaDyb6A1CO4zpiqRLP5cpyf6wkSDVdIyGgHXmyBgT1T7Y5778QYsrR05TbPIc7jQXyCG+Epam4BwhNf9CcQyt6bCyIKXQ8ScZn3wFfOVG93UwU1zRlTDM37BNXGziM2S141unQyMgoDljoWIIRfqSg1Zj1wtdI2DhcbgixZFCt8ifZZYXP+eHOVpk2b81QzWSYpFEQ+ay9AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEATPINk/17H+RLz459iCVQAGes8kc5sxYj3CkMlWrGMiCxvsgu2kak6dCa0f3DfiVt54Fry7s0OklHiZmipoiF4RCtyJwUSAzRrZFAbkpDg8oIu4Ui/Bt13kY7xON+u4m0IgkLZSE+8BSjMrfjVvVxe+qH5i7X/ibUTDjgyfdA8XI=', ], - $result->all() - ); + 'x5t' => 'KGApLybHWJmBwZGgBk07AlRD9nU', + 'x5t#256' => 'YD12k6kc4xuh_5vEHMyyOFpGs6VqTyaKMlxg0Nt2crA', + ], $result->all()); } - /** - * @test - */ + #[Test] public function createFromPrivateEC256KeyFileEncrypted(): void { $result = JWKFactory::createFromKeyFile(__DIR__ . '/Keys/EC/private.es256.encrypted.key', 'test'); @@ -193,9 +159,7 @@ public function createFromPrivateEC256KeyFileEncrypted(): void ); } - /** - * @test - */ + #[Test] public function createFromPrivateEC384KeyFileEncrypted(): void { $result = JWKFactory::createFromKeyFile(__DIR__ . '/Keys/EC/private.es384.encrypted.key', 'test'); @@ -206,9 +170,7 @@ public function createFromPrivateEC384KeyFileEncrypted(): void ); } - /** - * @test - */ + #[Test] public function createFromPrivateEC512KeyFileEncrypted(): void { $result = JWKFactory::createFromKeyFile(__DIR__ . '/Keys/EC/private.es512.encrypted.key', 'test'); @@ -219,10 +181,8 @@ public function createFromPrivateEC512KeyFileEncrypted(): void ); } - /** - * @dataProvider publicKeysAndPem - * @test - */ + #[DataProvider('publicKeysAndPem')] + #[Test] public function createFromPublicEC512KeyFile(string $filename, string $expectedJWK): void { // Given @@ -252,9 +212,7 @@ public static function publicKeysAndPem(): iterable ]; } - /** - * @test - */ + #[Test] public function createFromValues(): void { $result = JWKFactory::createFromValues([ @@ -271,10 +229,8 @@ public function createFromValues(): void ); } - /** - * @test - * @dataProvider dataKeys - */ + #[DataProvider('dataKeys')] + #[Test] public function loadKeyPEMEncoded(string $filename, array $expectedValues): void { $jwk = JWKFactory::createFromKeyFile($filename); @@ -341,7 +297,7 @@ public static function dataKeys(): iterable 'kty' => 'OKP', 'crv' => 'Ed25519', 'd' => 'Pr9AxZivB-zSq95wLrZfYa7DQ3TUPqZTkP_0w33r3rc', - 'x' => 'uRhai1TsvrSB43HD-36TQ2hMQfV8ruJz7F8o0wIe1VI', + 'x' => 'wrI33AEj15KHHYplueUE5cnJKtbM8oVHFf6wGnw2oOE', ], ]; yield [ diff --git a/tests/Component/KeyManagement/JWKSetAnalyzerTest.php b/tests/Component/KeyManagement/JWKSetAnalyzerTest.php index 167b4f130..280a4b33c 100644 --- a/tests/Component/KeyManagement/JWKSetAnalyzerTest.php +++ b/tests/Component/KeyManagement/JWKSetAnalyzerTest.php @@ -9,6 +9,7 @@ use Jose\Component\KeyManagement\Analyzer\KeysetAnalyzerManager; use Jose\Component\KeyManagement\Analyzer\MixedKeyTypes; use Jose\Component\KeyManagement\Analyzer\MixedPublicAndPrivateKeys; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -18,9 +19,7 @@ final class JWKSetAnalyzerTest extends TestCase { private ?KeysetAnalyzerManager $keysetAnalyzerManager = null; - /** - * @test - */ + #[Test] public function theKeysetHasNoKey(): void { $jwkset = new JWKSet([]); @@ -30,9 +29,7 @@ public function theKeysetHasNoKey(): void static::assertEmpty($messages); } - /** - * @test - */ + #[Test] public function theKeysetDoesNotMixesKeys(): void { $jwkset = new JWKSet([ @@ -55,9 +52,7 @@ public function theKeysetDoesNotMixesKeys(): void static::assertEmpty($messages); } - /** - * @test - */ + #[Test] public function theKeysetMixesKeys(): void { $jwkset = new JWKSet([ @@ -83,9 +78,7 @@ public function theKeysetMixesKeys(): void static::assertNotEmpty($messages); } - /** - * @test - */ + #[Test] public function theKeysetHasOnlyPrivateKeys(): void { $jwkset = new JWKSet([ @@ -108,9 +101,7 @@ public function theKeysetHasOnlyPrivateKeys(): void static::assertEmpty($messages); } - /** - * @test - */ + #[Test] public function theKeysetHasOnlyPublicKeys(): void { $jwkset = new JWKSet([ @@ -130,9 +121,7 @@ public function theKeysetHasOnlyPublicKeys(): void static::assertEmpty($messages); } - /** - * @test - */ + #[Test] public function theKeysetMixesPublicAndPrivateKeys(): void { $jwkset = new JWKSet([ diff --git a/tests/Component/KeyManagement/JWKSetTest.php b/tests/Component/KeyManagement/JWKSetTest.php index ca928036c..5fa9e987a 100644 --- a/tests/Component/KeyManagement/JWKSetTest.php +++ b/tests/Component/KeyManagement/JWKSetTest.php @@ -4,20 +4,19 @@ namespace Jose\Tests\Component\KeyManagement; -use function count; use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\KeyManagement\JWKFactory; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use function count; /** * @internal */ final class JWKSetTest extends TestCase { - /** - * @test - */ + #[Test] public function keySelection(): void { $jwkset = $this->getPublicKeySet(); @@ -26,29 +25,22 @@ public function keySelection(): void static::assertInstanceOf(JWK::class, $jwk); } - /** - * @test - */ + #[Test] public function keySelectionWithAlgorithm(): void { $jwkset = $this->getPublicKeySet(); $jwk = $jwkset->selectKey('sig', new FooAlgorithm()); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '71ee230371d19630bc17fb90ccf20ae632ad8cf8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'sig', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '71ee230371d19630bc17fb90ccf20ae632ad8cf8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'sig', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function keySelectionWithAlgorithmAndKeyId(): void { $jwkset = $this->getPublicKeySet(); @@ -57,20 +49,15 @@ public function keySelectionWithAlgorithmAndKeyId(): void 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', ]); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'sig', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'sig', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function keySelectionWithKeyId(): void { $jwkset = $this->getPublicKeySet(); @@ -79,20 +66,15 @@ public function keySelectionWithKeyId(): void 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', ]); static::assertInstanceOf(JWK::class, $jwk); - static::assertSame( - [ - 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', - 'kty' => 'FOO', - 'alg' => 'foo', - 'use' => 'sig', - ], - $jwk->all() - ); + static::assertSame([ + 'kid' => '02491f945c951adf156f370788e8ccdabf8877a8', + 'kty' => 'FOO', + 'alg' => 'foo', + 'use' => 'sig', + ], $jwk->all()); } - /** - * @test - */ + #[Test] public function keySelectionReturnsNothing(): void { $jwkset = $this->getPublicKeySet(); @@ -103,9 +85,7 @@ public function keySelectionReturnsNothing(): void static::assertNull($jwk); } - /** - * @test - */ + #[Test] public function createKeySetFromValues(): void { $values = [ diff --git a/tests/Component/KeyManagement/JWKTest.php b/tests/Component/KeyManagement/JWKTest.php index 8e19773da..f76e9d917 100644 --- a/tests/Component/KeyManagement/JWKTest.php +++ b/tests/Component/KeyManagement/JWKTest.php @@ -9,18 +9,17 @@ use Jose\Component\Core\JWKSet; use Jose\Component\Core\Util\RSAKey; use Jose\Component\KeyManagement\JWKFactory; -use const JSON_THROW_ON_ERROR; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class JWKTest extends TestCase { - /** - * @test - */ + #[Test] public function key(): void { $jwk = new JWK([ @@ -52,9 +51,7 @@ public function key(): void ); } - /** - * @test - */ + #[Test] public function badConstruction(): void { $this->expectException(InvalidArgumentException::class); @@ -63,9 +60,7 @@ public function badConstruction(): void new JWK([]); } - /** - * @test - */ + #[Test] public function badCall(): void { $this->expectException(InvalidArgumentException::class); @@ -85,9 +80,7 @@ public function badCall(): void $jwk->get('ABCD'); } - /** - * @test - */ + #[Test] public function keySet(): void { $jwk1 = new JWK([ @@ -142,9 +135,7 @@ public function keySet(): void static::assertSame(0, $jwkset->count()); } - /** - * @test - */ + #[Test] public function keySet2(): void { $this->expectException(InvalidArgumentException::class); @@ -178,9 +169,7 @@ public function keySet2(): void $jwkset->get(2); } - /** - * @test - */ + #[Test] public function privateToPublic(): void { $private = new JWK([ @@ -209,9 +198,7 @@ public function privateToPublic(): void ]), json_encode($public, JSON_THROW_ON_ERROR)); } - /** - * @test - */ + #[Test] public function loadCertificateChain(): void { $key = JWKFactory::createFromCertificateFile( @@ -225,25 +212,20 @@ public function loadCertificateChain(): void '178f7e93a74ed73d88c29042220b9ae6e4b371cd', mb_strtolower(bin2hex(Base64UrlSafe::decode($key->get('x5t')))) ); - static::assertEqualsCanonicalizing( -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2cuc3ltY2QuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwNQYDVR0fBC4wLDAqoCigJoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9iYWwuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAHWeQIFATANBgkqhkiG9w0BAQsFAAOCAQEAqvqpIM1qZ4PtXtR+3h3Ef+AlBgDFJPupyC1tft6dgmUsgWM0Zj7pUsIItMsv91+ZOmqcUHqFBYx90SpIhNMJbHzCzTWf84LuUt5oX+QAihcglvcpjZpNy6jehsgNb1aHA30DP9z6eX0hGfnIOi9RdozHQZJxjyXON/hKTAAj78Q1EK7gI4BzfE00LshukNYQHpmEcxpw8u1VDu4XBupn7jLrLN1nBz/2i8Jw3lsA5rsb0zYaImxssDVCbJAJPZPpZAkiDoUGn8JzIdPmX4DkjYUiOnMDsWCOrmji9D6X52ASCWg23jrW4kOVWzeBkoEfu43XrVJkFleW2V40fsg12A==', ], - $key->all() - ); + ], $key->all()); } - /** - * @test - */ + #[Test] public function theRSAKeyIsCorrectlyConvertedIntoPEM(): void { // Given @@ -257,8 +239,7 @@ public function theRSAKeyIsCorrectlyConvertedIntoPEM(): void $pem = RSAKey::createFromJWK($key)->toPEM(); // Then - static::assertSame( - '-----BEGIN PUBLIC KEY----- + static::assertSame('-----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz62tHQzm4fDHipqlcrNh C1gUdn0N38pmlcQbVlLvtZf1aRm1OO43cB9YQyWr1MsTrYH4nyWZDMPIGY/BsIfY w1lp9fo2D1tpG2vtCaKRETVimu+N9DySQ9vYs6n8lG0vXy/spK7sGrOLFooijDSt @@ -271,8 +252,6 @@ public function theRSAKeyIsCorrectlyConvertedIntoPEM(): void XCARX1IObFJNoinxYJ5SNX9bCSRtgefuBKE7BSNukAkHyBPf+++kEi9GbYXzlJr+ yCMAIsA0UoiEx264hkAF9zF+N1yRhS/QmrhzU5hpj1IE8WRCqyIZV8f/IbSGXBue 7MmgknLVRWHuGqehkTSfiNECAwEAAQ== ------END PUBLIC KEY-----', - $pem - ); +-----END PUBLIC KEY-----', $pem); } } diff --git a/tests/Component/KeyManagement/Keys/ECKeysTest.php b/tests/Component/KeyManagement/Keys/ECKeysTest.php index caf719f70..7a29b8b8b 100644 --- a/tests/Component/KeyManagement/Keys/ECKeysTest.php +++ b/tests/Component/KeyManagement/Keys/ECKeysTest.php @@ -4,22 +4,21 @@ namespace Jose\Tests\Component\KeyManagement\Keys; -use const DIRECTORY_SEPARATOR; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Core\Util\ECKey; use Jose\Component\KeyManagement\JWKFactory; use Jose\Component\KeyManagement\KeyConverter\KeyConverter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const DIRECTORY_SEPARATOR; /** * @internal */ final class ECKeysTest extends TestCase { - /** - * @test - */ + #[Test] public function keyTypeNotSupported(): void { $this->expectException(InvalidArgumentException::class); @@ -32,9 +31,8 @@ public function keyTypeNotSupported(): void /** * @see https://github.com/Spomky-Labs/jose/issues/141 * @see https://gist.github.com/Spomky/246eca6aaeeb7a40f11d3a2d98960282 - * - * @test */ + #[Test] public function loadPrivateEC256KeyGenerateByAPN(): void { $pem = file_get_contents( @@ -50,9 +48,7 @@ public function loadPrivateEC256KeyGenerateByAPN(): void ]); } - /** - * @test - */ + #[Test] public function loadPublicEC256Key(): void { $pem = file_get_contents( @@ -67,9 +63,7 @@ public function loadPublicEC256Key(): void ]); } - /** - * @test - */ + #[Test] public function loadPrivateEC256Key(): void { // Given @@ -93,9 +87,7 @@ public function loadPrivateEC256Key(): void static::assertSame($private_pem, $ecKey); } - /** - * @test - */ + #[Test] public function loadEncryptedPrivateEC256Key(): void { $private_pem = file_get_contents( @@ -111,9 +103,7 @@ public function loadEncryptedPrivateEC256Key(): void ]); } - /** - * @test - */ + #[Test] public function loadEncryptedPrivateEC256KeyWithoutPassword(): void { $this->expectException(InvalidArgumentException::class); @@ -124,9 +114,7 @@ public function loadEncryptedPrivateEC256KeyWithoutPassword(): void ); } - /** - * @test - */ + #[Test] public function loadPublicEC384Key(): void { $pem = file_get_contents( @@ -141,9 +129,7 @@ public function loadPublicEC384Key(): void ]); } - /** - * @test - */ + #[Test] public function loadPrivateEC384Key(): void { $private_pem = file_get_contents( @@ -159,9 +145,7 @@ public function loadPrivateEC384Key(): void ]); } - /** - * @test - */ + #[Test] public function loadEncryptedPrivateEC384Key(): void { $private_pem = file_get_contents( @@ -177,9 +161,7 @@ public function loadEncryptedPrivateEC384Key(): void ]); } - /** - * @test - */ + #[Test] public function loadPublicEC512Key(): void { $pem = file_get_contents( @@ -194,9 +176,7 @@ public function loadPublicEC512Key(): void ]); } - /** - * @test - */ + #[Test] public function loadPrivateEC512Key(): void { $private_pem = file_get_contents( @@ -212,9 +192,7 @@ public function loadPrivateEC512Key(): void ]); } - /** - * @test - */ + #[Test] public function loadEncryptedPrivateEC512Key(): void { $private_pem = file_get_contents( @@ -230,9 +208,7 @@ public function loadEncryptedPrivateEC512Key(): void ]); } - /** - * @test - */ + #[Test] public function convertPrivateKeyToPublic(): void { $jwk = new JWK([ @@ -258,9 +234,7 @@ public function convertPrivateKeyToPublic(): void ->all()); } - /** - * @test - */ + #[Test] public function createECKeyOnP256(): void { $jwk = JWKFactory::createECKey('P-256'); @@ -271,9 +245,7 @@ public function createECKeyOnP256(): void static::assertTrue($jwk->has('y')); } - /** - * @test - */ + #[Test] public function createECKeyOnP384(): void { $jwk = JWKFactory::createECKey('P-384'); @@ -284,9 +256,7 @@ public function createECKeyOnP384(): void static::assertTrue($jwk->has('y')); } - /** - * @test - */ + #[Test] public function createECKeyOnP521(): void { $jwk = JWKFactory::createECKey('P-521'); diff --git a/tests/Component/KeyManagement/Keys/NoneKeysTest.php b/tests/Component/KeyManagement/Keys/NoneKeysTest.php index dc1896570..38ef022e2 100644 --- a/tests/Component/KeyManagement/Keys/NoneKeysTest.php +++ b/tests/Component/KeyManagement/Keys/NoneKeysTest.php @@ -6,8 +6,9 @@ use Jose\Component\Core\JWK; use Jose\Component\KeyManagement\JWKFactory; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal @@ -16,9 +17,8 @@ final class NoneKeysTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7638#section-3.1 - * - * @test */ + #[Test] public function keyThumbprint(): void { $key = new JWK([ @@ -37,9 +37,7 @@ public function keyThumbprint(): void static::assertSame('JI3gujreJtPt2gzxlbGnLQ', $key->thumbprint('md5')); } - /** - * @test - */ + #[Test] public function createNoneKey(): void { $key = JWKFactory::createNoneKey([ diff --git a/tests/Component/KeyManagement/Keys/OKPKeysTest.php b/tests/Component/KeyManagement/Keys/OKPKeysTest.php index 1293fe162..e75ef03dc 100644 --- a/tests/Component/KeyManagement/Keys/OKPKeysTest.php +++ b/tests/Component/KeyManagement/Keys/OKPKeysTest.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use Jose\Component\KeyManagement\JWKFactory; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class OKPKeysTest extends TestCase { - /** - * @test - */ + #[Test] public function createOKPKeyWithInvalidKeySize(): void { $this->expectException(InvalidArgumentException::class); @@ -24,9 +23,7 @@ public function createOKPKeyWithInvalidKeySize(): void JWKFactory::createOKPKey('Ed455'); } - /** - * @test - */ + #[Test] public function createOKPKeyWithCurveX25519(): void { $jwk = JWKFactory::createOKPKey('X25519', [ @@ -43,9 +40,7 @@ public function createOKPKeyWithCurveX25519(): void static::assertSame('enc', $jwk->get('use')); } - /** - * @test - */ + #[Test] public function createOKPKeyWithCurveEd25519(): void { $jwk = JWKFactory::createOKPKey('Ed25519', [ diff --git a/tests/Component/KeyManagement/Keys/OctKeysTest.php b/tests/Component/KeyManagement/Keys/OctKeysTest.php index 3f9a9a1d0..de2a8c06f 100644 --- a/tests/Component/KeyManagement/Keys/OctKeysTest.php +++ b/tests/Component/KeyManagement/Keys/OctKeysTest.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use Jose\Component\KeyManagement\JWKFactory; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -13,9 +14,7 @@ */ final class OctKeysTest extends TestCase { - /** - * @test - */ + #[Test] public function createOctKeyWithInvalidKeySize(): void { $this->expectException(InvalidArgumentException::class); @@ -24,9 +23,7 @@ public function createOctKeyWithInvalidKeySize(): void JWKFactory::createOctKey(12); } - /** - * @test - */ + #[Test] public function createOctKey(): void { $jwk = JWKFactory::createOctKey(64); diff --git a/tests/Component/KeyManagement/Keys/RSAKeysTest.php b/tests/Component/KeyManagement/Keys/RSAKeysTest.php index b5da31cf2..0cf1f0a78 100644 --- a/tests/Component/KeyManagement/Keys/RSAKeysTest.php +++ b/tests/Component/KeyManagement/Keys/RSAKeysTest.php @@ -4,12 +4,13 @@ namespace Jose\Tests\Component\KeyManagement\Keys; -use const DIRECTORY_SEPARATOR; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\KeyManagement\JWKFactory; use Jose\Component\KeyManagement\KeyConverter\RSAKey; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const DIRECTORY_SEPARATOR; /** * @internal @@ -18,9 +19,8 @@ final class RSAKeysTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7638#section-3.1 - * - * @test */ + #[Test] public function keyThumbprint(): void { $key = new JWK([ @@ -34,9 +34,7 @@ public function keyThumbprint(): void static::assertSame('NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs', $key->thumbprint('sha256')); } - /** - * @test - */ + #[Test] public function hashAlgorithmNotSupported(): void { $this->expectException(InvalidArgumentException::class); @@ -53,9 +51,7 @@ public function hashAlgorithmNotSupported(): void $key->thumbprint('foo'); } - /** - * @test - */ + #[Test] public function unsupportedKeyType(): void { $this->expectException(InvalidArgumentException::class); @@ -70,9 +66,7 @@ public function unsupportedKeyType(): void ])); } - /** - * @test - */ + #[Test] public function loadPublicRSAKeyFromPEM(): void { $file = 'file://' . __DIR__ . DIRECTORY_SEPARATOR . 'RSA' . DIRECTORY_SEPARATOR . 'public.key'; @@ -86,9 +80,7 @@ public function loadPublicRSAKeyFromPEM(): void static::assertTrue($rsa_key->isPublic()); } - /** - * @test - */ + #[Test] public function loadPublicRSAKeyFromJWK(): void { $jwk = new JWK([ @@ -110,9 +102,7 @@ public function loadPublicRSAKeyFromJWK(): void static::assertTrue($rsa_key->isPublic()); } - /** - * @test - */ + #[Test] public function loadPublicRSAKeyFromValues(): void { $rsa_key = RSAKey::createFromJWK(new JWK([ @@ -129,9 +119,7 @@ public function loadPublicRSAKeyFromValues(): void static::assertTrue($rsa_key->isPublic()); } - /** - * @test - */ + #[Test] public function loadPrivateRSAKey(): void { // Given @@ -165,9 +153,7 @@ public function loadPrivateRSAKey(): void static::assertSame($content, \Jose\Component\Core\Util\RSAKey::createFromJWK($rsaKey->toJwk())->toPEM()); } - /** - * @test - */ + #[Test] public function loadPrivateRSAKeyFromJWK(): void { $jwk = new JWK([ @@ -205,9 +191,7 @@ public function loadPrivateRSAKeyFromJWK(): void static::assertTrue($public_key->isPublic()); } - /** - * @test - */ + #[Test] public function loadPrivateRSAKeyFromValues(): void { $rsa_key = RSAKey::createFromJWK(new JWK([ @@ -245,9 +229,7 @@ public function loadPrivateRSAKeyFromValues(): void static::assertTrue($public_key->isPublic()); } - /** - * @test - */ + #[Test] public function convertPrivateKeyToPublic(): void { $private_ec_key = RSAKey::createFromJWK(new JWK([ @@ -275,9 +257,7 @@ public function convertPrivateKeyToPublic(): void ], $public_ec_key->toArray()); } - /** - * @test - */ + #[Test] public function createRSAKey512Bits(): void { $jwk = JWKFactory::createRSAKey(512); @@ -292,9 +272,7 @@ public function createRSAKey512Bits(): void static::assertTrue($jwk->has('qi')); } - /** - * @test - */ + #[Test] public function loadPrivateRSAKeyFromMinimalValues(): void { $rsa_key = RSAKey::createFromJWK(new JWK([ diff --git a/tests/Component/KeyManagement/MessageBagTest.php b/tests/Component/KeyManagement/MessageBagTest.php index 27498b777..14902e69b 100644 --- a/tests/Component/KeyManagement/MessageBagTest.php +++ b/tests/Component/KeyManagement/MessageBagTest.php @@ -6,17 +6,16 @@ use Jose\Component\KeyManagement\Analyzer\Message; use Jose\Component\KeyManagement\Analyzer\MessageBag; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class MessageBagTest extends TestCase { - /** - * @test - */ + #[Test] public function iCanGetAMessageWithLowSeverity(): void { $message = Message::low('Not important'); @@ -25,9 +24,7 @@ public function iCanGetAMessageWithLowSeverity(): void static::assertSame('Not important', $message->getMessage()); } - /** - * @test - */ + #[Test] public function iCanGetAMessageWithMediumSeverity(): void { $message = Message::medium('Quite important'); @@ -36,9 +33,7 @@ public function iCanGetAMessageWithMediumSeverity(): void static::assertSame('Quite important', $message->getMessage()); } - /** - * @test - */ + #[Test] public function iCanGetAMessageWithHighSeverity(): void { $message = Message::high('Very important'); @@ -47,9 +42,7 @@ public function iCanGetAMessageWithHighSeverity(): void static::assertSame('Very important', $message->getMessage()); } - /** - * @test - */ + #[Test] public function iCanSerializeAMessageIntoJson(): void { $message = Message::high('Very important'); @@ -60,9 +53,7 @@ public function iCanSerializeAMessageIntoJson(): void ); } - /** - * @test - */ + #[Test] public function aMessageBagCanHaveSeveralMessages(): void { $bag = new MessageBag(); @@ -74,9 +65,7 @@ public function aMessageBagCanHaveSeveralMessages(): void static::assertContainsOnlyInstancesOf(Message::class, $bag); } - /** - * @test - */ + #[Test] public function iCanSerializeAMessageBagIntoJson(): void { $bag = new MessageBag(); diff --git a/tests/Component/KeyManagement/UrlKeySetFactoryTest.php b/tests/Component/KeyManagement/UrlKeySetFactoryTest.php index 08e2ddc02..9cce4e701 100644 --- a/tests/Component/KeyManagement/UrlKeySetFactoryTest.php +++ b/tests/Component/KeyManagement/UrlKeySetFactoryTest.php @@ -5,10 +5,11 @@ namespace Jose\Tests\Component\KeyManagement; use Http\Mock\Client; +use InvalidArgumentException; use Jose\Component\KeyManagement\JKUFactory; use Jose\Component\KeyManagement\X5UFactory; -use JsonException; use Nyholm\Psr7\Factory\Psr17Factory; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -30,9 +31,7 @@ protected function setUp(): void $this->messageFactory = new Psr17Factory(); } - /** - * @test - */ + #[Test] public function iCanGetAKeySetFromAJWKUrl(): void { $response = $this->messageFactory->createResponse(200); @@ -50,13 +49,11 @@ public function iCanGetAKeySetFromAJWKUrl(): void static::assertSame(3, $keyset->count()); } - /** - * @test - */ + #[Test] public function theJWKUrlIsValidButDoesNotContainAKeySet(): void { - $this->expectException(JsonException::class); - $this->expectExceptionMessage('Syntax error'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Unsupported input.'); $response = $this->messageFactory->createResponse(200); $response->getBody() @@ -69,9 +66,7 @@ public function theJWKUrlIsValidButDoesNotContainAKeySet(): void ->loadFromUrl('https://foo.bar/bad/url'); } - /** - * @test - */ + #[Test] public function theUrlIsNotValidAndJWKSetCannotBeLoaded(): void { $this->expectException(RuntimeException::class); @@ -88,9 +83,7 @@ public function theUrlIsNotValidAndJWKSetCannotBeLoaded(): void ->loadFromUrl('https://foo.bar/bad/url'); } - /** - * @test - */ + #[Test] public function iCanGetAKeySetFromAX509Url(): void { $response = $this->messageFactory->createResponse(200); @@ -108,13 +101,11 @@ public function iCanGetAKeySetFromAX509Url(): void static::assertSame(3, $keyset->count()); } - /** - * @test - */ + #[Test] public function theX509UrlIsValidButDoesNotContainAKeySet(): void { - $this->expectException(JsonException::class); - $this->expectExceptionMessage('Syntax error'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Unsupported input.'); $response = $this->messageFactory->createResponse(200); $response->getBody() @@ -127,9 +118,7 @@ public function theX509UrlIsValidButDoesNotContainAKeySet(): void ->loadFromUrl('https://foo.bar/bad/url'); } - /** - * @test - */ + #[Test] public function theUrlIsNotValidAndX509CertificatesCannotBeLoaded(): void { $this->expectException(RuntimeException::class); diff --git a/tests/Component/NestedToken/NestedTokenTest.php b/tests/Component/NestedToken/NestedTokenTest.php deleted file mode 100644 index 13d4ab819..000000000 --- a/tests/Component/NestedToken/NestedTokenTest.php +++ /dev/null @@ -1,162 +0,0 @@ -algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('A128GCM', new A128GCM()); - $this->algorithmManagerFactory->add('A192GCM', new A192GCM()); - $this->algorithmManagerFactory->add('A256GCM', new A256GCM()); - $this->algorithmManagerFactory->add('A128CBC-HS256', new A128CBCHS256()); - $this->algorithmManagerFactory->add('A192CBC-HS384', new A192CBCHS384()); - $this->algorithmManagerFactory->add('A256CBC-HS512', new A256CBCHS512()); - $this->algorithmManagerFactory->add('A128GCMKW', new A128GCMKW()); - $this->algorithmManagerFactory->add('A192GCMKW', new A192GCMKW()); - $this->algorithmManagerFactory->add('A256GCMKW', new A256GCMKW()); - $this->algorithmManagerFactory->add('A128KW', new A128KW()); - $this->algorithmManagerFactory->add('A192KW', new A192KW()); - $this->algorithmManagerFactory->add('A256KW', new A256KW()); - $this->algorithmManagerFactory->add('dir', new Dir()); - $this->algorithmManagerFactory->add('ECDH-ES', new ECDHES()); - $this->algorithmManagerFactory->add('ECDH-ES+A128KW', new ECDHESA128KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A192KW', new ECDHESA192KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A256KW', new ECDHESA256KW()); - $this->algorithmManagerFactory->add('PBES2-HS256+A128KW', new PBES2HS256A128KW()); - $this->algorithmManagerFactory->add('PBES2-HS384+A192KW', new PBES2HS384A192KW()); - $this->algorithmManagerFactory->add('PBES2-HS512+A256KW', new PBES2HS512A256KW()); - $this->algorithmManagerFactory->add('RSA1_5', new RSA15()); - $this->algorithmManagerFactory->add('RSA-OAEP', new RSAOAEP()); - $this->algorithmManagerFactory->add('RSA-OAEP-256', new RSAOAEP256()); - } - - return $this->algorithmManagerFactory; - } - - protected function getCompressionMethodManagerFactory(): CompressionMethodManagerFactory - { - if ($this->compressionMethodManagerFactory === null) { - $this->compressionMethodManagerFactory = new CompressionMethodManagerFactory(); - $this->compressionMethodManagerFactory->add('DEF', new Deflate()); - } - - return $this->compressionMethodManagerFactory; - } - - protected function getJWEBuilderFactory(): JWEBuilderFactory - { - if ($this->jweBuilderFactory === null) { - $this->jweBuilderFactory = new JWEBuilderFactory( - $this->getAlgorithmManagerFactory(), - $this->getCompressionMethodManagerFactory() - ); - } - - return $this->jweBuilderFactory; - } - - protected function getJWEDecrypterFactory(): JWEDecrypterFactory - { - if ($this->jweDecrypterFactory === null) { - $this->jweDecrypterFactory = new JWEDecrypterFactory( - $this->getAlgorithmManagerFactory(), - $this->getCompressionMethodManagerFactory() - ); - } - - return $this->jweDecrypterFactory; - } - - protected function getJWELoaderFactory(): JWELoaderFactory - { - if ($this->jweLoaderFactory === null) { - $this->jweLoaderFactory = new JWELoaderFactory( - $this->getJWESerializerManagerFactory(), - $this->getJWEDecrypterFactory(), - null - ); - } - - return $this->jweLoaderFactory; - } - - protected function getJWESerializerManagerFactory(): JWESerializerManagerFactory - { - if ($this->jwsSerializerManagerFactory === null) { - $this->jwsSerializerManagerFactory = new JWESerializerManagerFactory(); - $this->jwsSerializerManagerFactory->add(new CompactSerializer()); - $this->jwsSerializerManagerFactory->add(new JSONFlattenedSerializer()); - $this->jwsSerializerManagerFactory->add(new JSONGeneralSerializer()); - } - - return $this->jwsSerializerManagerFactory; - } - - protected function getJWESerializerManager(): JWESerializerManager - { - if ($this->jwsSerializerManager === null) { - $this->jwsSerializerManager = new JWESerializerManager([ - new CompactSerializer(), - new JSONFlattenedSerializer(), - new JSONGeneralSerializer(), - ]); - } - - return $this->jwsSerializerManager; - } -} diff --git a/tests/Component/NestedToken/NestedTokenTestCase.php b/tests/Component/NestedToken/NestedTokenTestCase.php index b790ead72..70de496bf 100644 --- a/tests/Component/NestedToken/NestedTokenTestCase.php +++ b/tests/Component/NestedToken/NestedTokenTestCase.php @@ -59,30 +59,31 @@ abstract class NestedTokenTestCase extends TestCase protected function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('A128GCM', new A128GCM()); - $this->algorithmManagerFactory->add('A192GCM', new A192GCM()); - $this->algorithmManagerFactory->add('A256GCM', new A256GCM()); - $this->algorithmManagerFactory->add('A128CBC-HS256', new A128CBCHS256()); - $this->algorithmManagerFactory->add('A192CBC-HS384', new A192CBCHS384()); - $this->algorithmManagerFactory->add('A256CBC-HS512', new A256CBCHS512()); - $this->algorithmManagerFactory->add('A128GCMKW', new A128GCMKW()); - $this->algorithmManagerFactory->add('A192GCMKW', new A192GCMKW()); - $this->algorithmManagerFactory->add('A256GCMKW', new A256GCMKW()); - $this->algorithmManagerFactory->add('A128KW', new A128KW()); - $this->algorithmManagerFactory->add('A192KW', new A192KW()); - $this->algorithmManagerFactory->add('A256KW', new A256KW()); - $this->algorithmManagerFactory->add('dir', new Dir()); - $this->algorithmManagerFactory->add('ECDH-ES', new ECDHES()); - $this->algorithmManagerFactory->add('ECDH-ES+A128KW', new ECDHESA128KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A192KW', new ECDHESA192KW()); - $this->algorithmManagerFactory->add('ECDH-ES+A256KW', new ECDHESA256KW()); - $this->algorithmManagerFactory->add('PBES2-HS256+A128KW', new PBES2HS256A128KW()); - $this->algorithmManagerFactory->add('PBES2-HS384+A192KW', new PBES2HS384A192KW()); - $this->algorithmManagerFactory->add('PBES2-HS512+A256KW', new PBES2HS512A256KW()); - $this->algorithmManagerFactory->add('RSA1_5', new RSA15()); - $this->algorithmManagerFactory->add('RSA-OAEP', new RSAOAEP()); - $this->algorithmManagerFactory->add('RSA-OAEP-256', new RSAOAEP256()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([ + new A128GCM(), + new A192GCM(), + new A256GCM(), + new A128CBCHS256(), + new A192CBCHS384(), + new A256CBCHS512(), + new A128GCMKW(), + new A192GCMKW(), + new A256GCMKW(), + new A128KW(), + new A192KW(), + new A256KW(), + new Dir(), + new ECDHES(), + new ECDHESA128KW(), + new ECDHESA192KW(), + new ECDHESA256KW(), + new PBES2HS256A128KW(), + new PBES2HS384A192KW(), + new PBES2HS512A256KW(), + new RSA15(), + new RSAOAEP(), + new RSAOAEP256(), + ]); } return $this->algorithmManagerFactory; } diff --git a/tests/Component/NestedToken/NestingTest.php b/tests/Component/NestedToken/NestingTest.php index 9d1bd70dc..f1589ce29 100644 --- a/tests/Component/NestedToken/NestingTest.php +++ b/tests/Component/NestedToken/NestingTest.php @@ -5,17 +5,16 @@ namespace Jose\Tests\Component\NestedToken; use Jose\Component\Core\JWK; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-6 * * @internal */ -final class NestingTest extends NestedTokenTest +final class NestingTest extends NestedTokenTestCase { - /** - * @test - */ + #[Test] public function decryption(): void { $payload = 'eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJob2JiaXRvbi5leGFtcGxlIiwiZXhwIjoxMzAwODE5MzgwLCJodHRwOi8vZXhhbXBsZS5jb20vaXNfcm9vdCI6dHJ1ZX0.dPpMqwRZxFYi1UfcDAaf8M99o7kwUWtiXZ-ByvVuJih4MhJ_aZqciprz0OWaIAkIvn1qskChirjKvY9ESZNUCP4JjvfyPS-nqjJxYoA5ztWOyFk2cZNIPXjcJXSQwXPO9tEe-v4VSqgD0aKHqPxYog4N6Cz1lKph1U1sYDSI67_bLL7elg_vkjfMp5_W5l5LuUYGMeh6hxQIaIUXf9EwV2JmvTMuZ-vBOWy0Sniy1EFo72CRTvmtrIf5AROo5MNliY3KtUxeP-SOmD-LEYwW9SlkohYzMVAZDDOrVbv7KVRHpeYNaK75KEQqdCEEkS_rskZS-Qtt_nlegTWh1mEYaA'; diff --git a/tests/Component/NestedToken/NestingTokenBuilderTest.php b/tests/Component/NestedToken/NestingTokenBuilderTest.php index a46e7903b..99661f2bc 100644 --- a/tests/Component/NestedToken/NestingTokenBuilderTest.php +++ b/tests/Component/NestedToken/NestingTokenBuilderTest.php @@ -19,6 +19,8 @@ use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\JWSBuilderFactory; use Jose\Component\Signature\Serializer as JwsSerializer; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -50,10 +52,8 @@ protected function setUp(): void } } - /** - * @test - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] + #[Test] public function decryption(): void { $payload = '{"iss":"hobbiton.example","exp":1300819380,"http://example.com/is_root":true}'; @@ -163,10 +163,11 @@ private function getJWSSerializerManagerFactory(): JwsSerializer\JWSSerializerMa private function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('A128GCM', new A128GCM()); - $this->algorithmManagerFactory->add('RSA-OAEP', new RSAOAEP()); - $this->algorithmManagerFactory->add('PS256', new PS256()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([ + new A128GCM(), + new RSAOAEP(), + new PS256(), + ]); } return $this->algorithmManagerFactory; diff --git a/tests/Component/NestedToken/NestingTokenUsingNestedTokenLoaderTest.php b/tests/Component/NestedToken/NestingTokenUsingNestedTokenLoaderTest.php index c98c55eb8..40830cfab 100644 --- a/tests/Component/NestedToken/NestingTokenUsingNestedTokenLoaderTest.php +++ b/tests/Component/NestedToken/NestingTokenUsingNestedTokenLoaderTest.php @@ -24,6 +24,7 @@ use Jose\Component\Signature\JWSTokenSupport; use Jose\Component\Signature\JWSVerifierFactory; use Jose\Component\Signature\Serializer as JwsSerializer; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -57,9 +58,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function decryption(): void { $payload = '{"iss":"hobbiton.example","exp":1300819380,"http://example.com/is_root":true}'; @@ -204,10 +203,11 @@ private function getJWSVerifierFactory(): JWSVerifierFactory private function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('A128GCM', new A128GCM()); - $this->algorithmManagerFactory->add('RSA-OAEP', new RSAOAEP()); - $this->algorithmManagerFactory->add('PS256', new PS256()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([ + new A128GCM(), + new RSAOAEP(), + new PS256(), + ]); } return $this->algorithmManagerFactory; diff --git a/tests/Component/Signature/ForeignJWTTestCase.php b/tests/Component/Signature/ForeignJWTTest.php similarity index 96% rename from tests/Component/Signature/ForeignJWTTestCase.php rename to tests/Component/Signature/ForeignJWTTest.php index a460c8cde..f5270cd6c 100644 --- a/tests/Component/Signature/ForeignJWTTestCase.php +++ b/tests/Component/Signature/ForeignJWTTest.php @@ -5,20 +5,18 @@ namespace Jose\Tests\Component\Signature; use Jose\Component\Core\JWK; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class ForeignJWTTestCase extends SignatureTestCase +final class ForeignJWTTest extends SignatureTestCase { /* * The following test uses an assertion created with another library. * This assertion is valid if verified with the JWK. */ - - /** - * @test - */ + #[Test] public function validJWTFromOtherLibrary(): void { $jwk = new JWK([ diff --git a/tests/Component/Signature/JWSFlattenedTestCase.php b/tests/Component/Signature/JWSFlattenedTest.php similarity index 82% rename from tests/Component/Signature/JWSFlattenedTestCase.php rename to tests/Component/Signature/JWSFlattenedTest.php index 8b0298d6f..1b3d58790 100644 --- a/tests/Component/Signature/JWSFlattenedTestCase.php +++ b/tests/Component/Signature/JWSFlattenedTest.php @@ -4,18 +4,18 @@ namespace Jose\Tests\Component\Signature; +use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; /** * @internal */ -final class JWSFlattenedTestCase extends SignatureTestCase +final class JWSFlattenedTest extends SignatureTestCase { /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.5 - * - * @test */ + #[Test] public function loadFlattenedJWS(): void { $loaded = $this->getJWSSerializerManager() @@ -28,6 +28,6 @@ public function loadFlattenedJWS(): void 'iss' => 'joe', 'exp' => 1_300_819_380, 'http://example.com/is_root' => true, - ], json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)); + ], json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)); } } diff --git a/tests/Component/Signature/JWSLoaderTestCase.php b/tests/Component/Signature/JWSLoaderTest.php similarity index 97% rename from tests/Component/Signature/JWSLoaderTestCase.php rename to tests/Component/Signature/JWSLoaderTest.php index 0aed2fbcb..4c8aef96f 100644 --- a/tests/Component/Signature/JWSLoaderTestCase.php +++ b/tests/Component/Signature/JWSLoaderTest.php @@ -7,17 +7,16 @@ use Exception; use Jose\Component\Core\JWK; use Jose\Component\Signature\JWSLoader; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class JWSLoaderTestCase extends SignatureTestCase +final class JWSLoaderTest extends SignatureTestCase { private ?JWSLoader $jwsLoader = null; - /** - * @test - */ + #[Test] public function theFlattenedTokenCannotBeLoaded(): void { $this->expectException(Exception::class); @@ -36,9 +35,7 @@ public function theFlattenedTokenCannotBeLoaded(): void ->loadAndVerifyWithKey($token, $key, $signature); } - /** - * @test - */ + #[Test] public function theTokenCannotBeVerifiedBecauseOfAnUnsupportedAlgorithm(): void { $this->expectException(Exception::class); @@ -57,9 +54,7 @@ public function theTokenCannotBeVerifiedBecauseOfAnUnsupportedAlgorithm(): void ->loadAndVerifyWithKey($token, $key, $signature); } - /** - * @test - */ + #[Test] public function theTokenCannotBeVerifiedBecauseOfABadKey(): void { $this->expectException(Exception::class); @@ -78,9 +73,7 @@ public function theTokenCannotBeVerifiedBecauseOfABadKey(): void ->loadAndVerifyWithKey($token, $key, $signature); } - /** - * @test - */ + #[Test] public function theTokenCanBeVerified(): void { $token = 'eyJhbGciOiJIUzI1NiIsImtpZCI6IjAxOGMwYWU1LTRkOWItNDcxYi1iZmQ2LWVlZjMxNGJjNzAzNyJ9.SXTigJlzIGEgZGFuZ2Vyb3VzIGJ1c2luZXNzLCBGcm9kbywgZ29pbmcgb3V0IHlvdXIgZG9vci4gWW91IHN0ZXAgb250byB0aGUgcm9hZCwgYW5kIGlmIHlvdSBkb24ndCBrZWVwIHlvdXIgZmVldCwgdGhlcmXigJlzIG5vIGtub3dpbmcgd2hlcmUgeW91IG1pZ2h0IGJlIHN3ZXB0IG9mZiB0by4.s0h6KThzkfBBBkLspW1h84VsJZFTsPPqMDA7g1Md7p0'; diff --git a/tests/Component/Signature/JWSSplitTestCase.php b/tests/Component/Signature/JWSSplitTest.php similarity index 96% rename from tests/Component/Signature/JWSSplitTestCase.php rename to tests/Component/Signature/JWSSplitTest.php index 7a73a9735..27b27ef83 100644 --- a/tests/Component/Signature/JWSSplitTestCase.php +++ b/tests/Component/Signature/JWSSplitTest.php @@ -5,15 +5,14 @@ namespace Jose\Tests\Component\Signature; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; +use PHPUnit\Framework\Attributes\Test; /** * @internal */ -final class JWSSplitTestCase extends SignatureTestCase +final class JWSSplitTest extends SignatureTestCase { - /** - * @test - */ + #[Test] public function aJwsObjectWithMoreThanOneRecipientCanBeSplittedIntoSeveralJwsObjects(): void { $input = '{"payload":"SXTigJlzIGEgZGFuZ2Vyb3VzIGJ1c2luZXNzLCBGcm9kbywgZ29pbmcgb3V0IHlvdXIgZG9vci4gWW91IHN0ZXAgb250byB0aGUgcm9hZCwgYW5kIGlmIHlvdSBkb24ndCBrZWVwIHlvdXIgZmVldCwgdGhlcmXigJlzIG5vIGtub3dpbmcgd2hlcmUgeW91IG1pZ2h0IGJlIHN3ZXB0IG9mZiB0by4","signatures":[{"protected":"eyJhbGciOiJSUzI1NiJ9","header":{"kid":"bilbo.baggins@hobbiton.example"},"signature":"MIsjqtVlOpa71KE-Mss8_Nq2YH4FGhiocsqrgi5NvyG53uoimic1tcMdSg-qptrzZc7CG6Svw2Y13TDIqHzTUrL_lR2ZFcryNFiHkSw129EghGpwkpxaTn_THJTCglNbADko1MZBCdwzJxwqZc-1RlpO2HibUYyXSwO97BSe0_evZKdjvvKSgsIqjytKSeAMbhMBdMma622_BG5t4sdbuCHtFjp9iJmkio47AIwqkZV1aIZsv33uPUqBBCXbYoQJwt7mxPftHmNlGoOSMxR_3thmXTCm4US-xiNOyhbm8afKK64jU6_TPtQHiJeQJxz9G3Tx-083B745_AfYOnlC9w"},{"header":{"alg":"ES512","kid":"bilbo.baggins@hobbiton.example"},"signature":"ARcVLnaJJaUWG8fG-8t5BREVAuTY8n8YHjwDO1muhcdCoFZFFjfISu0Cdkn9Ybdlmi54ho0x924DUz8sK7ZXkhc7AFM8ObLfTvNCrqcI3Jkl2U5IX3utNhODH6v7xgy1Qahsn0fyb4zSAkje8bAWz4vIfj5pCMYxxm4fgV3q7ZYhm5eD"},{"protected":"eyJhbGciOiJIUzI1NiIsImtpZCI6IjAxOGMwYWU1LTRkOWItNDcxYi1iZmQ2LWVlZjMxNGJjNzAzNyJ9","signature":"s0h6KThzkfBBBkLspW1h84VsJZFTsPPqMDA7g1Md7p0"}]}'; diff --git a/tests/Component/Signature/JWSTestCase.php b/tests/Component/Signature/JWSTest.php similarity index 95% rename from tests/Component/Signature/JWSTestCase.php rename to tests/Component/Signature/JWSTest.php index 045d78a2f..f2c0c409a 100644 --- a/tests/Component/Signature/JWSTestCase.php +++ b/tests/Component/Signature/JWSTest.php @@ -6,18 +6,17 @@ use InvalidArgumentException; use Jose\Component\Signature\JWS; -use const JSON_THROW_ON_ERROR; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; +use const JSON_THROW_ON_ERROR; /** * @internal */ -final class JWSTestCase extends SignatureTestCase +final class JWSTest extends SignatureTestCase { - /** - * @test - */ + #[Test] public function jWS(): void { $claims = [ @@ -42,9 +41,7 @@ public function jWS(): void static::assertSame([], $jws->getSignature(0)->getHeader()); } - /** - * @test - */ + #[Test] public function toCompactJSONFailed(): void { $this->expectException(InvalidArgumentException::class); @@ -63,9 +60,7 @@ public function toCompactJSONFailed(): void ->serialize('jws_compact', $jws, 0); } - /** - * @test - */ + #[Test] public function toFlattenedJSONFailed(): void { $this->expectException(InvalidArgumentException::class); @@ -84,9 +79,7 @@ public function toFlattenedJSONFailed(): void ->serialize('jws_json_flattened', $jws, 0); } - /** - * @test - */ + #[Test] public function toJSONFailed(): void { $this->expectException(LogicException::class); @@ -105,9 +98,7 @@ public function toJSONFailed(): void ->serialize('jws_json_general', $jws, 0); } - /** - * @test - */ + #[Test] public function signatureContainsUnprotectedHeader(): void { $this->expectException(LogicException::class); @@ -135,9 +126,7 @@ public function signatureContainsUnprotectedHeader(): void ->serialize('jws_compact', $jws, 0); } - /** - * @test - */ + #[Test] public function signatureDoesNotContainHeader(): void { $this->expectException(InvalidArgumentException::class); @@ -160,9 +149,7 @@ public function signatureDoesNotContainHeader(): void ->getHeaderParameter('foo'); } - /** - * @test - */ + #[Test] public function signatureDoesNotContainProtectedHeader(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/Component/Signature/RFC7520/MultipleSignaturesTestCase.php b/tests/Component/Signature/RFC7520/MultipleSignaturesTest.php similarity index 98% rename from tests/Component/Signature/RFC7520/MultipleSignaturesTestCase.php rename to tests/Component/Signature/RFC7520/MultipleSignaturesTest.php index 32191d5cd..9f3e5f1d9 100644 --- a/tests/Component/Signature/RFC7520/MultipleSignaturesTestCase.php +++ b/tests/Component/Signature/RFC7520/MultipleSignaturesTest.php @@ -6,17 +6,16 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Signature\SignatureTestCase; +use PHPUnit\Framework\Attributes\Test; /** * @see https://tools.ietf.org/html/rfc7520#section-4.8 * * @internal */ -final class MultipleSignaturesTestCase extends SignatureTestCase +final class MultipleSignaturesTest extends SignatureTestCase { - /** - * @test - */ + #[Test] public function multipleSignatures(): void { /** diff --git a/tests/Component/Signature/RFC7520/NestingTestCase.php b/tests/Component/Signature/RFC7520/NestingTest.php similarity index 92% rename from tests/Component/Signature/RFC7520/NestingTestCase.php rename to tests/Component/Signature/RFC7520/NestingTest.php index 7e072d682..40ddb17e8 100644 --- a/tests/Component/Signature/RFC7520/NestingTestCase.php +++ b/tests/Component/Signature/RFC7520/NestingTest.php @@ -6,6 +6,7 @@ use Jose\Component\Core\JWK; use Jose\Tests\Component\Signature\SignatureTestCase; +use PHPUnit\Framework\Attributes\Test; use const JSON_THROW_ON_ERROR; /** @@ -13,11 +14,9 @@ * * @internal */ -final class NestingTestCase extends SignatureTestCase +final class NestingTest extends SignatureTestCase { - /** - * @test - */ + #[Test] public function signatureVerification(): void { $payload = [ @@ -54,6 +53,9 @@ public function signatureVerification(): void static::assertTrue($jwsVerifier->verifyWithKey($loaded_compact_json, $signature_key, 0)); static::assertSame($signature_header, $loaded_compact_json->getSignature(0)->getProtectedHeader()); - static::assertSame($payload, json_decode($loaded_compact_json->getPayload(), true, 512, JSON_THROW_ON_ERROR)); + static::assertSame( + $payload, + json_decode((string) $loaded_compact_json->getPayload(), true, 512, JSON_THROW_ON_ERROR) + ); } } diff --git a/tests/Component/Signature/SignatureTestCase.php b/tests/Component/Signature/SignatureTestCase.php index 3b17a0592..bc7feb132 100644 --- a/tests/Component/Signature/SignatureTestCase.php +++ b/tests/Component/Signature/SignatureTestCase.php @@ -46,21 +46,22 @@ abstract class SignatureTestCase extends TestCase protected function getAlgorithmManagerFactory(): AlgorithmManagerFactory { if ($this->algorithmManagerFactory === null) { - $this->algorithmManagerFactory = new AlgorithmManagerFactory(); - $this->algorithmManagerFactory->add('HS256', new HS256()); - $this->algorithmManagerFactory->add('HS384', new HS384()); - $this->algorithmManagerFactory->add('HS512', new HS512()); - $this->algorithmManagerFactory->add('ES256', new ES256()); - $this->algorithmManagerFactory->add('ES384', new ES384()); - $this->algorithmManagerFactory->add('ES512', new ES512()); - $this->algorithmManagerFactory->add('RS256', new RS256()); - $this->algorithmManagerFactory->add('RS384', new RS384()); - $this->algorithmManagerFactory->add('RS512', new RS512()); - $this->algorithmManagerFactory->add('PS256', new PS256()); - $this->algorithmManagerFactory->add('PS384', new PS384()); - $this->algorithmManagerFactory->add('PS512', new PS512()); - $this->algorithmManagerFactory->add('none', new None()); - $this->algorithmManagerFactory->add('EdDSA', new EdDSA()); + $this->algorithmManagerFactory = new AlgorithmManagerFactory([ + new HS256(), + new HS384(), + new HS512(), + new ES256(), + new ES384(), + new ES512(), + new RS256(), + new RS384(), + new RS512(), + new PS256(), + new PS384(), + new PS512(), + new None(), + new EdDSA(), + ]); } return $this->algorithmManagerFactory; diff --git a/tests/Component/Signature/SignerTestCase.php b/tests/Component/Signature/SignerTest.php similarity index 92% rename from tests/Component/Signature/SignerTestCase.php rename to tests/Component/Signature/SignerTest.php index d2607be32..80a66d07c 100644 --- a/tests/Component/Signature/SignerTestCase.php +++ b/tests/Component/Signature/SignerTest.php @@ -8,18 +8,17 @@ use Jose\Component\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Signature\Serializer\CompactSerializer; -use const JSON_THROW_ON_ERROR; use LogicException; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; +use const JSON_THROW_ON_ERROR; /** * @internal */ -final class SignerTestCase extends SignatureTestCase +final class SignerTest extends SignatureTestCase { - /** - * @test - */ + #[Test] public function algParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -34,9 +33,7 @@ public function algParameterIsMissing(): void ->build(); } - /** - * @test - */ + #[Test] public function algParameterIsNotSupported(): void { $this->expectException(InvalidArgumentException::class); @@ -53,9 +50,7 @@ public function algParameterIsNotSupported(): void ->build(); } - /** - * @test - */ + #[Test] public function duplicatedHeader(): void { $this->expectException(InvalidArgumentException::class); @@ -74,9 +69,7 @@ public function duplicatedHeader(): void ]); } - /** - * @test - */ + #[Test] public function signAndLoadCompact(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -101,9 +94,7 @@ public function signAndLoadCompact(): void static::assertSame('RS512', $loaded->getSignature(1)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function signMultipleInstructionWithCompactRepresentation(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -132,9 +123,7 @@ public function signMultipleInstructionWithCompactRepresentation(): void ); } - /** - * @test - */ + #[Test] public function signMultipleInstructionWithCompactRepresentationUsingBuilder(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -163,9 +152,7 @@ public function signMultipleInstructionWithCompactRepresentationUsingBuilder(): ); } - /** - * @test - */ + #[Test] public function signMultipleInstructionWithCompactRepresentationUsingBuilderAndDetachedPayload(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -194,9 +181,7 @@ public function signMultipleInstructionWithCompactRepresentationUsingBuilderAndD ); } - /** - * @test - */ + #[Test] public function createCompactJWSUsingFactory(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -268,9 +253,7 @@ public function createCompactJWSUsingFactory(): void static::assertTrue($jwsVerifier->verifyWithKey($loaded_3, $this->getKey2(), 0, 'Live long and Prosper.')); } - /** - * @test - */ + #[Test] public function signMultipleInstructionWithFlattenedRepresentation(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -299,9 +282,7 @@ public function signMultipleInstructionWithFlattenedRepresentation(): void ); } - /** - * @test - */ + #[Test] public function createFlattenedJWSUsingFactory(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -380,9 +361,7 @@ public function createFlattenedJWSUsingFactory(): void static::assertTrue($jwsVerifier->verifyWithKey($loaded_3, $this->getKey2(), 0, 'Live long and Prosper.')); } - /** - * @test - */ + #[Test] public function algorithmNotAllowedForTheKey(): void { $this->expectException(InvalidArgumentException::class); @@ -399,9 +378,7 @@ public function algorithmNotAllowedForTheKey(): void ->build(); } - /** - * @test - */ + #[Test] public function operationNotAllowedForTheKey(): void { $this->expectException(InvalidArgumentException::class); @@ -418,9 +395,7 @@ public function operationNotAllowedForTheKey(): void ->build(); } - /** - * @test - */ + #[Test] public function signAndLoadFlattened(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -442,9 +417,7 @@ public function signAndLoadFlattened(): void static::assertSame('HS512', $loaded->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function signAndLoad(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -476,9 +449,7 @@ public function signAndLoad(): void static::assertSame('RS512', $loaded->getSignature(1)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function signAndLoadWithWrongKeys(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -502,9 +473,7 @@ public function signAndLoadWithWrongKeys(): void static::assertFalse($jwsVerifier->verifyWithKeySet($loaded, $this->getSymmetricKeySet(), 0)); } - /** - * @test - */ + #[Test] public function signAndLoadWithUnsupportedAlgorithm(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -528,9 +497,7 @@ public function signAndLoadWithUnsupportedAlgorithm(): void static::assertFalse($jwsVerifier->verifyWithKeySet($loaded, $this->getSymmetricKeySet(), 0)); } - /** - * @test - */ + #[Test] public function signAndLoadWithJWSWithoutSignatures(): void { $this->expectException(InvalidArgumentException::class); @@ -553,9 +520,8 @@ public function signAndLoadWithJWSWithoutSignatures(): void /** * @see https://tools.ietf.org/html/rfc7797#section-4 * @see https://tools.ietf.org/html/rfc7797#section-4.2 - * - * @test */ + #[Test] public function compactJSONWithUnencodedPayloadFailsBecauseOfForbiddenCharacters(): void { $this->expectException(LogicException::class); @@ -587,9 +553,8 @@ public function compactJSONWithUnencodedPayloadFailsBecauseOfForbiddenCharacters /** * @see https://tools.ietf.org/html/rfc7797#section-4 * @see https://tools.ietf.org/html/rfc7797#section-4.2 - * - * @test */ + #[Test] public function compactJSONWithUnencodedPayloadSucceeded(): void { $protectedHeader = [ @@ -629,12 +594,13 @@ public function compactJSONWithUnencodedPayloadSucceeded(): void /** * @see https://tools.ietf.org/html/rfc7797#section-4 * @see https://tools.ietf.org/html/rfc7797#section-4.2 - * - * @test */ + #[Test] public function compactJSONWithUnencodedDetachedPayload(): void { - $payload = '$.02'; + $payload = hex2bin( + '43a40763650d45edcfc7e22bda5bf3ea3039464a53617c83bbffd815f48bb7fade3cacb6c8885ca7ef923ae04cc0567a450473b6e8777640e159e5aba4f6d653fa00c06ca1d48ca826eb68e32d10378716406577a5f92d759e887a3d3d4c496e60cfa1a8700c08aa59b9f1d34039f16119deb8c30ec6195ef352ba7526fbff6fab47360a1e743dd86ba11878c8f9f7bbc901bf04d7843fd0125c310337afef704e1d281b879f0f5dfecd21b69b29d413a597efa2092cbe7ba0e1de5a996b845004047446524f199a08da259d1c5564984e4d8d65058c37577aa344e10e7f188202f330b8f61f66b22e530659d023203efbf91852ddc6babef9dbbf012149dc86678016a2c0351a432f6e652da6913e215c506eb68e0b71f2a2842ae75b7c605d5c1495d53610beff10b11e4991929e2dece56c8472ea8b6a4ee5d846123545efa4d234534d669c8031cb719cc1c8dee3c7072bdf9534616ecf3b53be8be1983734c1e91f6a33cc0d5c34aaecb043b65113fb55a335f8f65a023ae2dba2e8b1488ae1a505bdd7aabc794fffbf1e0ea0ce437df92ac8ad3a4b12e2d5d4bfbaf2f3a1e69f15fc44c3beb310e3bd302407bf265a752a4d09f1f0f5715d409a4b82a5e16748f22934d34592dc5995c16dc73fde436867e576033fcc47a4ff51d6a24b41311d41f8a4f1af78c81ad966dd3baab94b4140' + ); $protectedHeader = [ 'alg' => 'HS256', 'b64' => false, @@ -658,7 +624,7 @@ public function compactJSONWithUnencodedDetachedPayload(): void $jws = $this->getJWSSerializerManager() ->serialize('jws_compact', $jws, 0); static::assertSame( - 'eyJhbGciOiJIUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..A5dxf2s96_n5FLueVuW1Z_vh161FwXZC4YLPff6dmDY', + 'eyJhbGciOiJIUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..fSKLLXhwLhGW6L4hftrjw9EkAiIikH4KDn9YZ3FDlz8', $jws ); @@ -669,11 +635,44 @@ public function compactJSONWithUnencodedDetachedPayload(): void static::assertSame($protectedHeader, $loaded->getSignature(0)->getProtectedHeader()); } + /** + * @see https://tools.ietf.org/html/rfc7797#section-4 + * @see https://tools.ietf.org/html/rfc7797#section-4.2 + */ + #[Test] + public function compactJSONWithUnencodedAttachedPayloadButNotUTF8(): void + { + static::expectException(InvalidArgumentException::class); + static::expectExceptionMessage('The payload must be encoded in UTF-8'); + $payload = hex2bin( + '43a40763650d45edcfc7e22bda5bf3ea3039464a53617c83bbffd815f48bb7fade3cacb6c8885ca7ef923ae04cc0567a450473b6e8777640e159e5aba4f6d653fa00c06ca1d48ca826eb68e32d10378716406577a5f92d759e887a3d3d4c496e60cfa1a8700c08aa59b9f1d34039f16119deb8c30ec6195ef352ba7526fbff6fab47360a1e743dd86ba11878c8f9f7bbc901bf04d7843fd0125c310337afef704e1d281b879f0f5dfecd21b69b29d413a597efa2092cbe7ba0e1de5a996b845004047446524f199a08da259d1c5564984e4d8d65058c37577aa344e10e7f188202f330b8f61f66b22e530659d023203efbf91852ddc6babef9dbbf012149dc86678016a2c0351a432f6e652da6913e215c506eb68e0b71f2a2842ae75b7c605d5c1495d53610beff10b11e4991929e2dece56c8472ea8b6a4ee5d846123545efa4d234534d669c8031cb719cc1c8dee3c7072bdf9534616ecf3b53be8be1983734c1e91f6a33cc0d5c34aaecb043b65113fb55a335f8f65a023ae2dba2e8b1488ae1a505bdd7aabc794fffbf1e0ea0ce437df92ac8ad3a4b12e2d5d4bfbaf2f3a1e69f15fc44c3beb310e3bd302407bf265a752a4d09f1f0f5715d409a4b82a5e16748f22934d34592dc5995c16dc73fde436867e576033fcc47a4ff51d6a24b41311d41f8a4f1af78c81ad966dd3baab94b4140' + ); + $protectedHeader = [ + 'alg' => 'HS256', + 'b64' => false, + 'crit' => ['b64'], + ]; + + $key = new JWK([ + 'kty' => 'oct', + 'k' => 'AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow', + ]); + + $jwsBuilder = $this->getJWSBuilderFactory() + ->create(['HS256']); + $this->getJWSVerifierFactory() + ->create(['HS256']); + $jwsBuilder + ->create() + ->withPayload($payload) + ->addSignature($key, $protectedHeader) + ->build(); + } + /** * The library is able to support multiple payload encoding and conversion in JSON if payload is detached. - * - * @test */ + #[Test] public function compactJSONWithUnencodedDetachedPayloadAndMultipleSignatures(): void { $payload = '$.02'; @@ -706,11 +705,8 @@ public function compactJSONWithUnencodedDetachedPayloadAndMultipleSignatures(): $expected_result = '{"signatures":[{"signature":"A5dxf2s96_n5FLueVuW1Z_vh161FwXZC4YLPff6dmDY","protected":"eyJhbGciOiJIUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19"},{"signature":"Mp-m-Vyst0zYCNkpg2RiIN8W9GO4nLU3FKsFtHzEcP4tgR4QcMys1_2m9HrDwszi0Cp2gv_Lioe6UPCcTNn6tQ","protected":"eyJhbGciOiJIUzUxMiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19"}]}'; - static::assertSame( - $expected_result, - $this->getJWSSerializerManager() - ->serialize('jws_json_general', $jws, 0) - ); + static::assertSame($expected_result, $this->getJWSSerializerManager() + ->serialize('jws_json_general', $jws, 0)); $loaded = $this->getJWSSerializerManager() ->unserialize($expected_result); @@ -721,9 +717,8 @@ public function compactJSONWithUnencodedDetachedPayloadAndMultipleSignatures(): /** * The library is able to support multiple payload encoding and conversion in JSON is not available if payload is * not detached. - * - * @test */ + #[Test] public function compactJSONWithUnencodedPayloadAndMultipleSignatures(): void { $this->expectException(LogicException::class); @@ -757,9 +752,7 @@ public function compactJSONWithUnencodedPayloadAndMultipleSignatures(): void ->serialize('jws_json_general', $jws, 0); } - /** - * @test - */ + #[Test] public function jWSWithUnencodedPayloadButNoCritHeader(): void { $this->expectException(LogicException::class); @@ -789,9 +782,7 @@ public function jWSWithUnencodedPayloadButNoCritHeader(): void ->serialize('jws_compact', $jws, 0); } - /** - * @test - */ + #[Test] public function jWSWithUnencodedPayloadButCritHeaderIsNotAnArray(): void { $this->expectException(LogicException::class); @@ -820,9 +811,7 @@ public function jWSWithUnencodedPayloadButCritHeaderIsNotAnArray(): void ->serialize('jws_compact', $jws, 0); } - /** - * @test - */ + #[Test] public function jWSWithUnencodedPayloadButCritHeaderDoesNotContainB64(): void { $this->expectException(LogicException::class); @@ -856,9 +845,8 @@ public function jWSWithUnencodedPayloadButCritHeaderDoesNotContainB64(): void /** * @see https://tools.ietf.org/html/rfc7797#section-4 * @see https://tools.ietf.org/html/rfc7797#section-4.2 - * - * @test */ + #[Test] public function flattenedJSONWithUnencodedPayload(): void { $payload = '$.02'; @@ -904,9 +892,8 @@ public function flattenedJSONWithUnencodedPayload(): void /** * @see https://tools.ietf.org/html/rfc7797#section-4 * @see https://tools.ietf.org/html/rfc7797#section-4.2 - * - * @test */ + #[Test] public function flattenedJSONWithUnencodedDetachedPayload(): void { $payload = '$.02'; @@ -939,9 +926,7 @@ public function flattenedJSONWithUnencodedDetachedPayload(): void static::assertSame($expected_result, json_decode($jws, true, 512, JSON_THROW_ON_ERROR)); } - /** - * @test - */ + #[Test] public function signAndLoadWithoutAlgParameterInTheHeader(): void { $this->expectException(InvalidArgumentException::class); @@ -961,9 +946,7 @@ public function signAndLoadWithoutAlgParameterInTheHeader(): void static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, $this->getSymmetricKeySet(), 0)); } - /** - * @test - */ + #[Test] public function signAndLoadJWKSet(): void { $jwsBuilder = $this->getJWSBuilderFactory() @@ -988,7 +971,7 @@ public function signAndLoadJWKSet(): void static::assertSame(2, $loaded->countSignatures()); static::assertEqualsCanonicalizing( $this->getKeyset(), - JWKSet::createFromKeyData(json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)) + JWKSet::createFromKeyData(json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)) ); static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, $this->getSymmetricKeySet(), 0)); static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, $this->getPublicKeySet(), 1)); @@ -997,9 +980,7 @@ public function signAndLoadJWKSet(): void static::assertSame('RS512', $loaded->getSignature(1)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function keySetIsEmpty(): void { $this->expectException(InvalidArgumentException::class); @@ -1028,7 +1009,7 @@ public function keySetIsEmpty(): void static::assertSame(2, $loaded->countSignatures()); static::assertEqualsCanonicalizing( $this->getKeyset(), - JWKSet::createFromKeyData(json_decode($loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)) + JWKSet::createFromKeyData(json_decode((string) $loaded->getPayload(), true, 512, JSON_THROW_ON_ERROR)) ); static::assertTrue($jwsVerifier->verifyWithKeySet($loaded, new JWKSet([]), 0)); static::assertTrue($jwsVerifier->verifyWithKey($loaded, new JWK([ diff --git a/tests/ComposerJsonTest.php b/tests/ComposerJsonTest.php index 6177951e4..2415b7bfd 100644 --- a/tests/ComposerJsonTest.php +++ b/tests/ComposerJsonTest.php @@ -5,10 +5,10 @@ namespace Jose; use DirectoryIterator; -use function in_array; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Traversable; +use const JSON_THROW_ON_ERROR; /** * @internal @@ -20,9 +20,7 @@ final class ComposerJsonTest extends TestCase { private const SRC_DIR = __DIR__ . '/../src'; - /** - * @test - */ + #[Test] public function packageDependenciesEqualRootDependencies(): void { $usedDependencies = ['symfony/symfony']; // Some builds add this to composer.json @@ -63,9 +61,7 @@ public function packageDependenciesEqualRootDependencies(): void static::assertCount(0, $unusedDependencies, $message); } - /** - * @test - */ + #[Test] public function rootReplacesSubPackages(): void { $rootReplaces = $this->getComposerReplaces(__DIR__ . '/../composer.json'); @@ -78,19 +74,13 @@ public function rootReplacesSubPackages(): void private function listSubPackages(?string $path = self::SRC_DIR): Traversable { - $packageFolders = [ - 'Bundle', - 'Component', - 'EncryptionAlgorithm', - 'ContentEncryption', - 'KeyEncryption', - 'SignatureAlgorithm', - ]; foreach (new DirectoryIterator($path) as $dirInfo) { - if (in_array($dirInfo->getFilename(), $packageFolders, true)) { + if ($dirInfo->getFilename() === 'composer.json') { + yield $dirInfo->getPath(); + } elseif ($dirInfo->isDir() && $dirInfo->isDot()) { + continue; + } elseif ($dirInfo->isDir()) { yield from $this->listSubPackages($dirInfo->getRealPath()); - } elseif ($dirInfo->isDir() && ! $dirInfo->isDot() && $dirInfo->getFilename() !== '.github') { - yield $dirInfo->getRealPath(); } } } diff --git a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php index 2794c4972..672642e3a 100644 --- a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php @@ -2,12 +2,13 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\AESCBC; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256CBCHS512; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use ReflectionClass; use ReflectionMethod; @@ -21,9 +22,8 @@ final class AESCBC_HSContentEncryptionTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7516#appendix-B - * - * @test */ + #[Test] public function a128CBCHS256EncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([ @@ -120,9 +120,7 @@ public function a128CBCHS256EncryptAndDecrypt(): void static::assertSame($expected_T, $T); } - /** - * @test - */ + #[Test] public function badTag(): void { $this->expectException(RuntimeException::class); @@ -214,9 +212,8 @@ public function badTag(): void /** * @see https://tools.ietf.org/html/rfc7518#appendix-B.1 - * - * @test */ + #[Test] public function a128CBCHS256EncryptAndDecryptBis(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([ @@ -252,9 +249,8 @@ public function a128CBCHS256EncryptAndDecryptBis(): void /** * @see https://tools.ietf.org/html/rfc7518#appendix-B.2 - * - * @test */ + #[Test] public function a192CBCHS384EncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([])); @@ -288,9 +284,8 @@ public function a192CBCHS384EncryptAndDecrypt(): void /** * @see https://tools.ietf.org/html/rfc7518#appendix-B.3 - * - * @test */ + #[Test] public function a256CBCHS512EncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([])); diff --git a/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php b/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php index f671c2bb7..f659f745c 100644 --- a/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCMContentEncryptionTest.php @@ -2,12 +2,13 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\ContentEncryption; +namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\AESGCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; @@ -16,9 +17,7 @@ */ final class AESGCMContentEncryptionTest extends TestCase { - /** - * @test - */ + #[Test] public function a128GCMEncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([ @@ -39,9 +38,7 @@ public function a128GCMEncryptAndDecrypt(): void static::assertSame($plaintext, $algorithm->decryptContent($cyphertext, $cek, $iv, null, $header, $tag)); } - /** - * @test - */ + #[Test] public function a192GCMEncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([ @@ -62,9 +59,7 @@ public function a192GCMEncryptAndDecrypt(): void static::assertSame($plaintext, $algorithm->decryptContent($cyphertext, $cek, $iv, null, $header, $tag)); } - /** - * @test - */ + #[Test] public function a256GCMEncryptAndDecrypt(): void { $header = Base64UrlSafe::encodeUnpadded(json_encode([ @@ -87,9 +82,8 @@ public function a256GCMEncryptAndDecrypt(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.1 - * - * @test */ + #[Test] public function a256GCMDecryptTestVector(): void { $algorithm = new A256GCM(); diff --git a/tests/EncryptionAlgorithm/Experimental/AESCTRContentEncryptionTest.php b/tests/EncryptionAlgorithm/Experimental/AESCTRContentEncryptionTest.php index 5d74eb708..1b21c43d5 100644 --- a/tests/EncryptionAlgorithm/Experimental/AESCTRContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/Experimental/AESCTRContentEncryptionTest.php @@ -2,12 +2,13 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm; +namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\Experimental; use Jose\Component\Core\JWK; -use Jose\Component\Encryption\Algorithm\KeyEncryption\A128CTR; -use Jose\Component\Encryption\Algorithm\KeyEncryption\A192CTR; -use Jose\Component\Encryption\Algorithm\KeyEncryption\A256CTR; +use Jose\Experimental\KeyEncryption\A128CTR; +use Jose\Experimental\KeyEncryption\A192CTR; +use Jose\Experimental\KeyEncryption\A256CTR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -15,9 +16,7 @@ */ final class AESCTRContentEncryptionTest extends TestCase { - /** - * @test - */ + #[Test] public function a128CTRKeyEncryptionAndDecryption(): void { $header = []; @@ -32,9 +31,7 @@ public function a128CTRKeyEncryptionAndDecryption(): void static::assertSame($cek, $decrypted); } - /** - * @test - */ + #[Test] public function a192CTRKeyEncryptionAndDecryption(): void { $header = []; @@ -49,9 +46,7 @@ public function a192CTRKeyEncryptionAndDecryption(): void static::assertSame($cek, $decrypted); } - /** - * @test - */ + #[Test] public function a256CTRKeyEncryptionAndDecryption(): void { $header = []; diff --git a/tests/EncryptionAlgorithm/Experimental/Chacha20Poly1305ContentEncryptionTest.php b/tests/EncryptionAlgorithm/Experimental/Chacha20Poly1305ContentEncryptionTest.php index 8d4f64df7..f27933976 100644 --- a/tests/EncryptionAlgorithm/Experimental/Chacha20Poly1305ContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/Experimental/Chacha20Poly1305ContentEncryptionTest.php @@ -2,13 +2,14 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm; +namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\Experimental; -use function in_array; use Jose\Component\Core\JWK; -use Jose\Component\Encryption\Algorithm\KeyEncryption\Chacha20Poly1305; +use Jose\Experimental\KeyEncryption\Chacha20Poly1305; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Throwable; +use function in_array; /** * @internal @@ -22,9 +23,7 @@ protected function setUp(): void } } - /** - * @test - */ + #[Test] public function contentEncryptionAndDecryption(): void { $header = []; diff --git a/tests/EncryptionAlgorithm/Experimental/RSAOAEPKeyEncryptionTest.php b/tests/EncryptionAlgorithm/Experimental/RSAOAEPKeyEncryptionTest.php index 71dbc0328..fa9ef4d4b 100644 --- a/tests/EncryptionAlgorithm/Experimental/RSAOAEPKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/Experimental/RSAOAEPKeyEncryptionTest.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm; +namespace Jose\Tests\EncryptionAlgorithm\ContentEncryption\Experimental; use Jose\Component\Core\JWK; -use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP384; -use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP512; +use Jose\Experimental\KeyEncryption\RSAOAEP384; +use Jose\Experimental\KeyEncryption\RSAOAEP512; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -16,9 +17,7 @@ */ final class RSAOAEPKeyEncryptionTest extends TestCase { - /** - * @test - */ + #[Test] public function rSAOAEP384EncryptionAndDecryption(): void { $header = []; @@ -33,9 +32,7 @@ public function rSAOAEP384EncryptionAndDecryption(): void static::assertSame($cek, $decrypted); } - /** - * @test - */ + #[Test] public function rSAOAEP512EncryptionAndDecryption(): void { $header = []; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php index 77b73bf77..409033898 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/AESGCMKW/AESGCMKWKeyEncryptionTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\AESGCMKW; use InvalidArgumentException; use Jose\Component\Core\JWK; @@ -10,6 +10,7 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\A192GCMKW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A256GCMKW; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -17,9 +18,7 @@ */ final class AESGCMKWKeyEncryptionTest extends TestCase { - /** - * @test - */ + #[Test] public function a128GCMKW(): void { $header = []; @@ -41,9 +40,7 @@ public function a128GCMKW(): void static::assertSame($cek, $aeskw->unwrapKey($key, $wrapped_cek, $header)); } - /** - * @test - */ + #[Test] public function badKey(): void { $this->expectException(InvalidArgumentException::class); @@ -61,9 +58,7 @@ public function badKey(): void $aeskw->wrapKey($key, $cek, $header, $header); } - /** - * @test - */ + #[Test] public function missingParameters(): void { $this->expectException(InvalidArgumentException::class); @@ -82,9 +77,7 @@ public function missingParameters(): void $aeskw->unwrapKey($key, $cek, $header); } - /** - * @test - */ + #[Test] public function a192GCMKW(): void { $header = []; @@ -106,9 +99,7 @@ public function a192GCMKW(): void static::assertSame($cek, $aeskw->unwrapKey($key, $wrapped_cek, $header)); } - /** - * @test - */ + #[Test] public function a256GCMKW(): void { $header = []; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php index a543e69ea..3f7117e90 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/AESKW/AESKWKeyEncryptionTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\AESKW; use InvalidArgumentException; use Jose\Component\Core\JWK; @@ -10,6 +10,7 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\A192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\A256KW; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -17,9 +18,7 @@ */ final class AESKWKeyEncryptionTest extends TestCase { - /** - * @test - */ + #[Test] public function a128KW(): void { $header = []; @@ -41,9 +40,7 @@ public function a128KW(): void static::assertSame($cek, $aeskw->unwrapKey($key, $wrapped_cek, $header)); } - /** - * @test - */ + #[Test] public function badKey(): void { $this->expectException(InvalidArgumentException::class); @@ -61,9 +58,7 @@ public function badKey(): void $aeskw->wrapKey($key, $cek, $header, $header); } - /** - * @test - */ + #[Test] public function a192KW(): void { $header = []; @@ -85,9 +80,7 @@ public function a192KW(): void static::assertSame($cek, $aeskw->unwrapKey($key, $wrapped_cek, $header)); } - /** - * @test - */ + #[Test] public function a256KW(): void { $header = []; diff --git a/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php b/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php index 0210e0152..6f249c9c6 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/Direct/DirAlgorithmTest.php @@ -2,12 +2,13 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\Direct; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Encryption\Algorithm\KeyEncryption\Dir; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -17,9 +18,7 @@ */ final class DirAlgorithmTest extends TestCase { - /** - * @test - */ + #[Test] public function invalidKey(): void { $this->expectException(InvalidArgumentException::class); @@ -34,9 +33,7 @@ public function invalidKey(): void $dir->getCEK($key); } - /** - * @test - */ + #[Test] public function validCEK(): void { $key = new JWK([ diff --git a/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php b/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php index 5ae4d9c33..513335437 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/ECDHES/ECDHESKeyAgreementTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\ECDHES; use InvalidArgumentException; use Jose\Component\Core\JWK; @@ -11,6 +11,7 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA256KW; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; @@ -23,9 +24,8 @@ final class ECDHESKeyAgreementTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7518#appendix-C - * - * @test */ + #[Test] public function getAgreementKeyWithEllipticCurveKey(): void { $receiver = new JWK([ @@ -53,9 +53,8 @@ public function getAgreementKeyWithEllipticCurveKey(): void /** * @see https://tools.ietf.org/html/rfc7518#appendix-C - * - * @test */ + #[Test] public function getAgreementKeyWithA128KeyWrapAndWithOctetKeyPairKey(): void { $header = [ @@ -121,9 +120,7 @@ public function getAgreementKeyWithA128KeyWrapAndWithOctetKeyPairKey(): void static::assertSame($cek, $ecdh_es->unwrapAgreementKey($private, null, $encrypted_cek, 128, $header)); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA128KeyWrap(): void { $header = [ @@ -190,9 +187,7 @@ public function getAgreementKeyWithA128KeyWrap(): void static::assertSame($cek, $ecdh_es->unwrapAgreementKey($private, null, $encrypted_cek, 128, $header)); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA192KeyWrap(): void { $header = [ @@ -259,9 +254,7 @@ public function getAgreementKeyWithA192KeyWrap(): void static::assertSame($cek, $ecdh_es->unwrapAgreementKey($private, null, $encrypted_cek, 192, $header)); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA256KeyWrap(): void { $header = [ @@ -334,9 +327,7 @@ public function getAgreementKeyWithA256KeyWrap(): void static::assertSame($cek, $ecdh_es->unwrapAgreementKey($private, null, $encrypted_cek, 256, $header)); } - /** - * @test - */ + #[Test] public function ePKParameterAreMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -354,9 +345,7 @@ public function ePKParameterAreMissing(): void $ecdh_es->getAgreementKey(256, 'A128GCM', $sender, null); } - /** - * @test - */ + #[Test] public function badEPKParameter(): void { $this->expectException(InvalidArgumentException::class); @@ -377,9 +366,7 @@ public function badEPKParameter(): void $ecdh_es->getAgreementKey(256, 'A128GCM', $sender, null, $header); } - /** - * @test - */ + #[Test] public function eCKeyHasMissingParameters(): void { $this->expectException(InvalidArgumentException::class); @@ -394,9 +381,7 @@ public function eCKeyHasMissingParameters(): void $ecdh_es->getAgreementKey(256, 'A128GCM', $receiver, null); } - /** - * @test - */ + #[Test] public function unsupportedCurve(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/EncryptionAlgorithm/KeyEncryption/ECDHSS/ECDHSSKeyAgreementTest.php b/tests/EncryptionAlgorithm/KeyEncryption/ECDHSS/ECDHSSKeyAgreementTest.php index 2ee6dd081..aa7108e03 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/ECDHSS/ECDHSSKeyAgreementTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/ECDHSS/ECDHSSKeyAgreementTest.php @@ -2,13 +2,14 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\ECDHSS; use Jose\Component\Core\JWK; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSS; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA128KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSSA256KW; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; @@ -21,9 +22,8 @@ final class ECDHSSKeyAgreementTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7518#appendix-C - * - * @test */ + #[Test] public function getAgreementKey(): void { $receiver = new JWK([ @@ -52,9 +52,7 @@ public function getAgreementKey(): void static::assertArrayNotHasKey('epk', $additional_header_values); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA128KeyWrapAndOctetKeyPairKey(): void { $additional_header_values = [ @@ -128,9 +126,7 @@ public function getAgreementKeyWithA128KeyWrapAndOctetKeyPairKey(): void ); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA128KeyWrap(): void { $additional_header_values = [ @@ -206,9 +202,7 @@ public function getAgreementKeyWithA128KeyWrap(): void ); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA192KeyWrap(): void { $additional_header_values = [ @@ -285,9 +279,7 @@ public function getAgreementKeyWithA192KeyWrap(): void ); } - /** - * @test - */ + #[Test] public function getAgreementKeyWithA256KeyWrap(): void { $additional_header_values = [ diff --git a/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php b/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php index 961619fcd..e09fbd422 100644 --- a/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php +++ b/tests/EncryptionAlgorithm/KeyEncryption/PBES2/PBES2_HS_AESKWKeyEncryptionTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Encryption\Algorithm\KeyEncryption; +namespace Jose\Tests\EncryptionAlgorithm\KeyEncryption\PBES2; use InvalidArgumentException; use Jose\Component\Core\JWK; @@ -10,6 +10,7 @@ use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS384A192KW; use Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS512A256KW; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use const STR_PAD_LEFT; @@ -22,9 +23,8 @@ final class PBES2_HS_AESKWKeyEncryptionTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc7517#appendix-C - * - * @test */ + #[Test] public function pBES2HS256A128KW(): void { $header = [ @@ -132,9 +132,7 @@ public function pBES2HS256A128KW(): void static::assertSame($expected_cek, $pbes2->unwrapKey($key, $wrapped_cek, $header)); } - /** - * @test - */ + #[Test] public function pBES2HS256A128KWBis(): void { $header = [ @@ -240,9 +238,7 @@ public function pBES2HS256A128KWBis(): void static::assertSame($cek, $pbes2->unwrapKey($key, $encrypted_cek, $header)); } - /** - * @test - */ + #[Test] public function pBES2HS384A192KW(): void { $header = [ @@ -348,9 +344,7 @@ public function pBES2HS384A192KW(): void static::assertSame($cek, $pbes2->unwrapKey($key, $encrypted_cek, $header)); } - /** - * @test - */ + #[Test] public function pBES2HS512A256KW(): void { $header = [ @@ -456,9 +450,7 @@ public function pBES2HS512A256KW(): void static::assertSame($cek, $pbes2->unwrapKey($key, $encrypted_cek, $header)); } - /** - * @test - */ + #[Test] public function badKeyType(): void { $this->expectException(InvalidArgumentException::class); @@ -563,9 +555,7 @@ public function badKeyType(): void $pbes2->wrapKey($key, $cek, $header, $header); } - /** - * @test - */ + #[Test] public function invalidKeyType(): void { $this->expectException(InvalidArgumentException::class); @@ -670,9 +660,7 @@ public function invalidKeyType(): void $pbes2->wrapKey($key, $cek, $header, $header); } - /** - * @test - */ + #[Test] public function algorithmParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -776,9 +764,7 @@ public function algorithmParameterIsMissing(): void $pbes2->wrapKey($key, $cek, $header, $header); } - /** - * @test - */ + #[Test] public function p2CParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); @@ -850,9 +836,7 @@ public function p2CParameterIsMissing(): void $pbes2->unwrapKey($key, $wrapped_cek, $header); } - /** - * @test - */ + #[Test] public function p2SParameterIsMissing(): void { $this->expectException(InvalidArgumentException::class); diff --git a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php index 3cbeb1fb4..40d53ed7a 100644 --- a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php +++ b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC6979Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\ECDSA; use Jose\Component\Core\JWK; use Jose\Component\Signature\Algorithm\ES256; @@ -10,6 +10,8 @@ use Jose\Component\Signature\Algorithm\ES512; use Jose\Component\Signature\Algorithm\SignatureAlgorithm; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -31,11 +33,9 @@ final class ECDSAFromRFC6979Test extends TestCase /** * @param string $message * @param string $signature - * - * @dataProvider dataWithVectors - * - * @test */ + #[Test] + #[DataProvider('dataWithVectors')] public function withVectors(SignatureAlgorithm $algorithm, $message, JWK $key, $signature): void { $is_valid = $algorithm->verify($key, $message, $signature); diff --git a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC7520Test.php b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC7520Test.php index c521bf1c7..286cf98e0 100644 --- a/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC7520Test.php +++ b/tests/SignatureAlgorithm/ECDSA/ECDSAFromRFC7520Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\ECDSA; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -12,6 +12,7 @@ use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -26,9 +27,8 @@ final class ECDSAFromRFC7520Test extends TestCase * always different). This test case create a signature and verifies it. Then the output given in the RFC is used * and verified. This way, we can say that the library is able to create/verify ECDSA signatures and verify * signature from test vectors. - * - * @test */ + #[Test] public function eS512(): void { /** diff --git a/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php b/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php index 1888a19a6..a6f97b2d6 100644 --- a/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php +++ b/tests/SignatureAlgorithm/ECDSA/ECDSASignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\ECDSA; use InvalidArgumentException; use Jose\Component\Core\JWK; @@ -10,6 +10,7 @@ use Jose\Component\Signature\Algorithm\ES384; use Jose\Component\Signature\Algorithm\ES512; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -17,9 +18,7 @@ */ final class ECDSASignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function invalidKey(): void { $this->expectException(InvalidArgumentException::class); @@ -34,9 +33,7 @@ public function invalidKey(): void $ecdsa->sign($key, $data); } - /** - * @test - */ + #[Test] public function eS256Verify(): void { $key = new JWK([ @@ -57,9 +54,7 @@ public function eS256Verify(): void static::assertTrue($ecdsa->verify($key, $data, Base64UrlSafe::decode($signature))); } - /** - * @test - */ + #[Test] public function eS256SignVerify(): void { $key = new JWK([ @@ -78,9 +73,7 @@ public function eS256SignVerify(): void static::assertTrue($ecdsa->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function keyNotPrivate(): void { $this->expectException(InvalidArgumentException::class); @@ -98,9 +91,7 @@ public function keyNotPrivate(): void $ecdsa->sign($key, $data); } - /** - * @test - */ + #[Test] public function eS384SignVerify(): void { $key = new JWK([ @@ -119,9 +110,7 @@ public function eS384SignVerify(): void static::assertTrue($ecdsa->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function eS512Verify(): void { $key = new JWK([ @@ -142,9 +131,7 @@ public function eS512Verify(): void static::assertTrue($ecdsa->verify($key, $data, Base64UrlSafe::decode($signature))); } - /** - * @test - */ + #[Test] public function eS512SignVerify(): void { $key = new JWK([ @@ -163,9 +150,7 @@ public function eS512SignVerify(): void static::assertTrue($ecdsa->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function badSignature(): void { $key = new JWK([ diff --git a/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php b/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php index cc5a6d727..77ee9baad 100644 --- a/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php +++ b/tests/SignatureAlgorithm/EdDSA/EdDSASignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\EdDSA; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -10,6 +10,7 @@ use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\JWSVerifier; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -19,9 +20,8 @@ final class EdDSASignatureTest extends TestCase { /** * @see https://tools.ietf.org/html/rfc8037#appendix-A.5 - * - * @test */ + #[Test] public function edDSAVerifyAlgorithm(): void { $key = new JWK([ @@ -42,9 +42,8 @@ public function edDSAVerifyAlgorithm(): void /** * @see https://tools.ietf.org/html/rfc8037#appendix-A.5 - * - * @test */ + #[Test] public function edDSASignAndVerifyAlgorithm(): void { $key = new JWK([ diff --git a/tests/SignatureAlgorithm/Experimental/Blake2bTest.php b/tests/SignatureAlgorithm/Experimental/Blake2bTest.php index e45a2aba2..bcc9c455d 100644 --- a/tests/SignatureAlgorithm/Experimental/Blake2bTest.php +++ b/tests/SignatureAlgorithm/Experimental/Blake2bTest.php @@ -2,12 +2,14 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\Experimental; use InvalidArgumentException; use Jose\Component\Core\JWK; -use Jose\Component\Signature\Algorithm\Blake2b; +use Jose\Experimental\Signature\Blake2b; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Before; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -31,9 +33,7 @@ final class Blake2bTest extends TestCase private string $expectedHashWithKeyOne; - /** - * @before - */ + #[Before] public function initializeKey(): void { $this->keyOne = new JWK([ @@ -47,9 +47,7 @@ public function initializeKey(): void $this->expectedHashWithKeyOne = Base64UrlSafe::decode(self::EXPECTED_HASH_WITH_KEY_ONE); } - /** - * @test - */ + #[Test] public function algorithmIdMustBeCorrect(): void { $algorithm = new Blake2b(); @@ -57,9 +55,7 @@ public function algorithmIdMustBeCorrect(): void static::assertSame('BLAKE2B', $algorithm->name()); } - /** - * @test - */ + #[Test] public function generatedSignatureMustBeSuccessfullyVerified(): void { $algorithm = new Blake2b(); @@ -68,9 +64,7 @@ public function generatedSignatureMustBeSuccessfullyVerified(): void static::assertTrue($algorithm->verify($this->keyOne, self::CONTENTS, $this->expectedHashWithKeyOne)); } - /** - * @test - */ + #[Test] public function signShouldRejectShortKeys(): void { $algorithm = new Blake2b(); @@ -85,9 +79,7 @@ public function signShouldRejectShortKeys(): void $algorithm->hash($key, self::CONTENTS); } - /** - * @test - */ + #[Test] public function verifyShouldReturnFalseWhenExpectedHashWasNotCreatedWithSameInformation(): void { $algorithm = new Blake2b(); diff --git a/tests/SignatureAlgorithm/Experimental/ExperimentalHMACSignatureTest.php b/tests/SignatureAlgorithm/Experimental/ExperimentalHMACSignatureTest.php index eb51cfc12..3c758725e 100644 --- a/tests/SignatureAlgorithm/Experimental/ExperimentalHMACSignatureTest.php +++ b/tests/SignatureAlgorithm/Experimental/ExperimentalHMACSignatureTest.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\Experimental; use Jose\Component\Core\JWK; -use Jose\Component\Signature\Algorithm\HS1; -use Jose\Component\Signature\Algorithm\HS256_64; +use Jose\Experimental\Signature\HS1; +use Jose\Experimental\Signature\HS256_64; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -14,9 +15,7 @@ */ final class ExperimentalHMACSignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function hS1SignAndVerify(): void { $key = $this->getKey(); @@ -30,9 +29,7 @@ public function hS1SignAndVerify(): void static::assertTrue($hmac->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function hS256SignAndVerify(): void { $key = $this->getKey(); diff --git a/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php b/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php index 77437481f..bcece1422 100644 --- a/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php +++ b/tests/SignatureAlgorithm/Experimental/P256KSignatureTest.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\Experimental; use Jose\Component\Core\JWK; -use Jose\Component\Signature\Algorithm\ES256K; +use Jose\Experimental\Signature\ES256K; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -14,25 +15,19 @@ */ final class P256KSignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function es256KVerify(): void { $key = $this->getKey(); $algorithm = new ES256K(); $data = 'Hello'; - static::assertTrue( - $algorithm->verify($key, $data, hex2bin( - '9c75b9d171d9690a37f2474d4bfab5c234911cb150950ea5cbfc9aedda5ec360725cc47978de95b4efb2a3ed617c7b36b1cd0a26b536662a79d0f3ae873a7924' - )) - ); + static::assertTrue($algorithm->verify($key, $data, hex2bin( + '9c75b9d171d9690a37f2474d4bfab5c234911cb150950ea5cbfc9aedda5ec360725cc47978de95b4efb2a3ed617c7b36b1cd0a26b536662a79d0f3ae873a7924' + ))); } - /** - * @test - */ + #[Test] public function es256KSignAndVerify(): void { $key = $this->getKey(); diff --git a/tests/SignatureAlgorithm/HMAC/HMACFromRFC7520Test.php b/tests/SignatureAlgorithm/HMAC/HMACFromRFC7520Test.php index 8128922a9..1c0101661 100644 --- a/tests/SignatureAlgorithm/HMAC/HMACFromRFC7520Test.php +++ b/tests/SignatureAlgorithm/HMAC/HMACFromRFC7520Test.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\HMAC; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -12,8 +12,9 @@ use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @see https://tools.ietf.org/html/rfc7520#section-4.4 @@ -27,9 +28,8 @@ final class HMACFromRFC7520Test extends TestCase { /** * @see https://tools.ietf.org/html/rfc7520#section-4.4 - * - * @test */ + #[Test] public function hS256(): void { /** @@ -101,9 +101,8 @@ public function hS256(): void /** * @see https://tools.ietf.org/html/rfc7520#section-4.5 - * - * @test */ + #[Test] public function hS256WithDetachedPayload(): void { /** @@ -176,9 +175,8 @@ public function hS256WithDetachedPayload(): void /** * @see https://tools.ietf.org/html/rfc7520#section-4.6 - * - * @test */ + #[Test] public function hS256WithUnprotectedHeader(): void { /** @@ -246,9 +244,8 @@ public function hS256WithUnprotectedHeader(): void /** * @see https://tools.ietf.org/html/rfc7520#section-4.7 - * - * @test */ + #[Test] public function hS256WithoutProtectedHeader(): void { /** diff --git a/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php b/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php index ee35b6d8c..80856a43e 100644 --- a/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php +++ b/tests/SignatureAlgorithm/HMAC/HMACSignatureTest.php @@ -2,13 +2,15 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\HMAC; use InvalidArgumentException; use Jose\Component\Core\JWK; use Jose\Component\Signature\Algorithm\HS256; use Jose\Component\Signature\Algorithm\HS384; use Jose\Component\Signature\Algorithm\HS512; +use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -16,9 +18,7 @@ */ final class HMACSignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function invalidKey(): void { $this->expectException(InvalidArgumentException::class); @@ -33,14 +33,14 @@ public function invalidKey(): void $hmac->hash($key, $data); } - /** - * @test - */ + #[Test] public function signatureHasBadBadLength(): void { $key = new JWK([ 'kty' => 'oct', - 'k' => 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo', + 'k' => Base64UrlSafe::encodeUnpadded( + 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo' + ), ]); $hmac = new HS256(); $data = 'Live long and Prosper.'; @@ -48,48 +48,41 @@ public function signatureHasBadBadLength(): void static::assertFalse($hmac->verify($key, $data, hex2bin('326eb338c465d3587f3349df0b96ba81'))); } - /** - * @test - */ + #[Test] public function hS256SignAndVerify(): void { $key = new JWK([ 'kty' => 'oct', - 'k' => 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo', + 'k' => Base64UrlSafe::encodeUnpadded( + 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo' + ), ]); $hmac = new HS256(); $data = 'Live long and Prosper.'; $signature = $hmac->hash($key, $data); - static::assertSame(hex2bin('7ed268ef179f530a4a1c56225c352a6782cf5379085c484b4f355b6744d6f19d'), $signature); static::assertTrue($hmac->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function hS384SignAndVerify(): void { $key = new JWK([ 'kty' => 'oct', - 'k' => 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo', + 'k' => Base64UrlSafe::encodeUnpadded( + 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo' + ), ]); $hmac = new HS384(); $data = 'Live long and Prosper.'; $signature = $hmac->hash($key, $data); - static::assertSame( - hex2bin('903ce2ef2878090d6117f88210d5a822d260fae66760186cb3326770748b9fa47c2d4531a4d5d868f99bcf7ea45c1ab4'), - $signature - ); static::assertTrue($hmac->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function hS512SignAndVerify(): void { $key = new JWK([ @@ -101,12 +94,9 @@ public function hS512SignAndVerify(): void $signature = $hmac->hash($key, $data); - static::assertSame( - hex2bin( - 'e8b36712b6c6dc422eec77f31ce372ccac769450413238158bd702069630456a148d0c10dd3a661a774217fb90b0d5f94fa6c3c985438bade92ff975b9e4dc04' - ), - $signature - ); + static::assertSame(hex2bin( + 'e8b36712b6c6dc422eec77f31ce372ccac769450413238158bd702069630456a148d0c10dd3a661a774217fb90b0d5f94fa6c3c985438bade92ff975b9e4dc04' + ), $signature); static::assertTrue($hmac->verify($key, $data, $signature)); } } diff --git a/tests/SignatureAlgorithm/None/NoneSignatureTest.php b/tests/SignatureAlgorithm/None/NoneSignatureTest.php index 1a6870160..efda2b144 100644 --- a/tests/SignatureAlgorithm/None/NoneSignatureTest.php +++ b/tests/SignatureAlgorithm/None/NoneSignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\None; use InvalidArgumentException; use Jose\Component\Core\AlgorithmManager; @@ -10,6 +10,7 @@ use Jose\Component\Signature\Algorithm\None; use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\Serializer\CompactSerializer; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -17,9 +18,7 @@ */ final class NoneSignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function noneSignAndVerifyAlgorithm(): void { $key = new JWK([ @@ -35,9 +34,7 @@ public function noneSignAndVerifyAlgorithm(): void static::assertTrue($none->verify($key, $data, $signature)); } - /** - * @test - */ + #[Test] public function invalidKey(): void { $this->expectException(InvalidArgumentException::class); @@ -52,9 +49,7 @@ public function invalidKey(): void $none->sign($key, $data); } - /** - * @test - */ + #[Test] public function noneSignAndVerifyComplete(): void { $jwk = new JWK([ diff --git a/tests/SignatureAlgorithm/RSA/RSA15SignatureTest.php b/tests/SignatureAlgorithm/RSA/RSA15SignatureTest.php index 276cc2119..780e816b5 100644 --- a/tests/SignatureAlgorithm/RSA/RSA15SignatureTest.php +++ b/tests/SignatureAlgorithm/RSA/RSA15SignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\RSA; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -12,8 +12,9 @@ use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; -use const JSON_THROW_ON_ERROR; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @see https://tools.ietf.org/html/rfc7520#section-4.1 @@ -22,9 +23,7 @@ */ final class RSA15SignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function rS256(): void { /** diff --git a/tests/SignatureAlgorithm/RSA/RSAKeyWithoutAllPrimesTest.php b/tests/SignatureAlgorithm/RSA/RSAKeyWithoutAllPrimesTest.php index aa1717d6c..094373f0c 100644 --- a/tests/SignatureAlgorithm/RSA/RSAKeyWithoutAllPrimesTest.php +++ b/tests/SignatureAlgorithm/RSA/RSAKeyWithoutAllPrimesTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\RSA; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -15,6 +15,8 @@ use Jose\Component\Signature\JWSBuilder; use Jose\Component\Signature\JWSVerifier; use Jose\Component\Signature\Serializer\CompactSerializer; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -22,11 +24,8 @@ */ final class RSAKeyWithoutAllPrimesTest extends TestCase { - /** - * @dataProvider dataSignatureAlgorithms - * - * @test - */ + #[DataProvider('dataSignatureAlgorithms')] + #[Test] public function signatureAlgorithms(string $signature_algorithm): void { $algorithm = new $signature_algorithm(); diff --git a/tests/SignatureAlgorithm/RSA/RSAPSSSignatureTest.php b/tests/SignatureAlgorithm/RSA/RSAPSSSignatureTest.php index 636554231..4324cad0a 100644 --- a/tests/SignatureAlgorithm/RSA/RSAPSSSignatureTest.php +++ b/tests/SignatureAlgorithm/RSA/RSAPSSSignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\RSA; use Jose\Component\Core\AlgorithmManager; use Jose\Component\Core\JWK; @@ -12,6 +12,7 @@ use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; /** @@ -26,9 +27,8 @@ final class RSAPSSSignatureTest extends TestCase * always different). This test case create a signature and verifies it. Then the output given in the RFC is used * and verified. This way, we can say that the library is able to create/verify RSA-PSS signatures and verify * signature from test vectors. - * - * @test */ + #[Test] public function pS384(): void { /** diff --git a/tests/SignatureAlgorithm/RSA/RSASignatureTest.php b/tests/SignatureAlgorithm/RSA/RSASignatureTest.php index a10aef20a..da510cd90 100644 --- a/tests/SignatureAlgorithm/RSA/RSASignatureTest.php +++ b/tests/SignatureAlgorithm/RSA/RSASignatureTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jose\Tests\Component\Signature\Algorithm; +namespace Jose\Tests\SignatureAlgorithm\RSA; use InvalidArgumentException; use Jose\Component\Core\AlgorithmManager; @@ -18,18 +18,17 @@ use Jose\Component\Signature\JWSVerifier; use Jose\Component\Signature\Serializer\CompactSerializer; use Jose\Component\Signature\Serializer\JSONGeneralSerializer; -use const JSON_THROW_ON_ERROR; use ParagonIE\ConstantTime\Base64UrlSafe; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use const JSON_THROW_ON_ERROR; /** * @internal */ final class RSASignatureTest extends TestCase { - /** - * @test - */ + #[Test] public function completeRS256Sign(): void { $key = new JWK([ @@ -74,9 +73,7 @@ public function completeRS256Sign(): void static::assertSame('RS256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completeRS256SignWithDetachedPayload(): void { $key = new JWK([ @@ -121,9 +118,7 @@ public function completeRS256SignWithDetachedPayload(): void static::assertSame('RS256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completeRS384Sign(): void { $key = new JWK([ @@ -168,9 +163,7 @@ public function completeRS384Sign(): void static::assertSame('RS384', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completeRS512Sign(): void { $key = new JWK([ @@ -216,9 +209,7 @@ public function completeRS512Sign(): void static::assertSame('RS512', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completePS256Sign(): void { $key = new JWK([ @@ -261,9 +252,7 @@ public function completePS256Sign(): void static::assertSame('PS256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completePS384Sign(): void { $key = new JWK([ @@ -304,9 +293,7 @@ public function completePS384Sign(): void static::assertSame('PS384', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } - /** - * @test - */ + #[Test] public function completePS512Sign(): void { $key = new JWK([ @@ -349,9 +336,8 @@ public function completePS512Sign(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.4 - * - * @test */ + #[Test] public function loadJWSJSONSerialization(): void { $serializer = new JSONGeneralSerializer(); @@ -359,7 +345,7 @@ public function loadJWSJSONSerialization(): void '{"payload":"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ","signatures":[{"protected":"eyJhbGciOiJSUzI1NiJ9","header":{"kid":"2010-12-29"},"signature":"cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw"},{"protected":"eyJhbGciOiJFUzI1NiJ9","header":{"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"},"signature":"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSApmWQxfKTUJqPP3-Kg6NU1Q"}]}' ); - $claims = json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR); + $claims = json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR); static::assertSame([ 'iss' => 'joe', 'exp' => 1_300_819_380, @@ -372,9 +358,8 @@ public function loadJWSJSONSerialization(): void /** * @see https://tools.ietf.org/html/rfc7516#appendix-A.4 - * - * @test */ + #[Test] public function loadJWSJSONSerializationWithDetachedPayload(): void { $jwsVerifier = new JWSVerifier(new AlgorithmManager([new RS256()])); @@ -396,9 +381,7 @@ public function loadJWSJSONSerializationWithDetachedPayload(): void ); } - /** - * @test - */ + #[Test] public function loadJWSJSONSerializationWithDetachedPayloadAndPayloadInJWS(): void { $this->expectException(InvalidArgumentException::class); @@ -420,9 +403,7 @@ public function loadJWSJSONSerializationWithDetachedPayloadAndPayloadInJWS(): vo ); } - /** - * @test - */ + #[Test] public function loadInvalidInput(): void { $this->expectException(InvalidArgumentException::class); @@ -433,9 +414,7 @@ public function loadInvalidInput(): void ); } - /** - * @test - */ + #[Test] public function loadInvalidInput2(): void { $this->expectException(InvalidArgumentException::class); @@ -448,9 +427,8 @@ public function loadInvalidInput2(): void /** * @see https://tools.ietf.org/html/rfc7515#appendix-A.1 - * - * @test */ + #[Test] public function loadIETFExample1(): void { $serializer = new CompactSerializer(); @@ -462,16 +440,15 @@ public function loadIETFExample1(): void 'iss' => 'joe', 'exp' => 1_300_819_380, 'http://example.com/is_root' => true, - ], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); + ], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); static::assertSame(1, $result->countSignatures()); static::assertSame('HS256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } /** * @see https://tools.ietf.org/html/rfc7515#appendix-A.2 - * - * @test */ + #[Test] public function loadIETFExample2(): void { $serializer = new CompactSerializer(); @@ -483,16 +460,15 @@ public function loadIETFExample2(): void 'iss' => 'joe', 'exp' => 1_300_819_380, 'http://example.com/is_root' => true, - ], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); + ], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); static::assertSame(1, $result->countSignatures()); static::assertSame('RS256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } /** * @see https://tools.ietf.org/html/rfc7515#appendix-A.3 - * - * @test */ + #[Test] public function loadIETFExample3(): void { $serializer = new CompactSerializer(); @@ -504,16 +480,15 @@ public function loadIETFExample3(): void 'iss' => 'joe', 'exp' => 1_300_819_380, 'http://example.com/is_root' => true, - ], json_decode($result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); + ], json_decode((string) $result->getPayload(), true, 512, JSON_THROW_ON_ERROR)); static::assertSame(1, $result->countSignatures()); static::assertSame('ES256', $result->getSignature(0)->getProtectedHeaderParameter('alg')); } /** * @see https://tools.ietf.org/html/rfc7515#appendix-A.4 - * - * @test */ + #[Test] public function loadIETFExample4(): void { $serializer = new CompactSerializer();