From 99a1e94455de17bf3c05aaf7c9eaf56d79ad384c Mon Sep 17 00:00:00 2001 From: rustamwin Date: Mon, 19 Aug 2024 16:26:29 +0500 Subject: [PATCH 1/5] Use `web-token/jwt-library` instead of `web-token/*` --- composer.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 28e6581..48c2bec 100644 --- a/composer.json +++ b/composer.json @@ -31,13 +31,7 @@ "require": { "php": "^8.0", "psr/http-message": "^1.0|^2.0", - "web-token/jwt-checker": "~2.2|~3.0", - "web-token/jwt-core": "~2.2|~3.0", - "web-token/jwt-key-mgmt": "~2.2|~3.0", - "web-token/jwt-signature": "~2.2|~3.0", - "web-token/jwt-signature-algorithm-ecdsa": "~2.2|~3.0", - "web-token/jwt-signature-algorithm-hmac": "~2.2|~3.0", - "web-token/jwt-signature-algorithm-rsa": "~2.2|~3.0", + "web-token/jwt-library": "^3.3", "yiisoft/auth": "^3.0", "yiisoft/http": "^1.2", "yiisoft/json": "^1.0" From 9ec9b6bc827b97c6c773000154e95ba403da2e7e Mon Sep 17 00:00:00 2001 From: rustamwin Date: Mon, 19 Aug 2024 16:36:38 +0500 Subject: [PATCH 2/5] Update min PHP version to 8.1 --- .github/workflows/bc.yml | 2 +- .github/workflows/build.yml | 2 +- .../workflows/composer-require-checker.yml | 2 +- .github/workflows/mutation.yml | 2 +- .github/workflows/static.yml | 8 -------- README.md | 2 +- composer.json | 2 +- psalm80.xml | 19 ------------------- rector.php | 2 +- 9 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 psalm80.xml diff --git a/.github/workflows/bc.yml b/.github/workflows/bc.yml index 9127600..3887ea8 100644 --- a/.github/workflows/bc.yml +++ b/.github/workflows/bc.yml @@ -10,4 +10,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.0'] + ['8.1'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed9a60b..719d5a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,4 +28,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.0', '8.1', '8.2'] + ['8.1', '8.2', '8.3'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index 6cf3cef..2c99e34 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -30,4 +30,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.0', '8.1', '8.2'] + ['8.1', '8.2', '8.3'] diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 03b72c0..842c6ae 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -26,6 +26,6 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.2'] + ['8.3'] secrets: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index e34190e..e33eca8 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -30,11 +30,3 @@ jobs: ['ubuntu-latest'] php: >- ['8.1', '8.2', '8.3'] - psalm80: - uses: yiisoft/actions/.github/workflows/psalm.yml@master - with: - psalm-config: psalm80.xml - os: >- - ['ubuntu-latest'] - php: >- - ['8.0'] diff --git a/README.md b/README.md index 3353897..cf95cdd 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The package provides [JWT authentication](https://tools.ietf.org/html/rfc7519) m ## Requirements -- PHP 8.0 or higher. +- PHP 8.1 or higher. ## Installation diff --git a/composer.json b/composer.json index 48c2bec..7a391b7 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "psr/http-message": "^1.0|^2.0", "web-token/jwt-library": "^3.3", "yiisoft/auth": "^3.0", diff --git a/psalm80.xml b/psalm80.xml deleted file mode 100644 index d091d59..0000000 --- a/psalm80.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/rector.php b/rector.php index 63713ce..8d7ecfe 100644 --- a/rector.php +++ b/rector.php @@ -17,6 +17,6 @@ // define sets of rules $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_80, + LevelSetList::UP_TO_PHP_81, ]); }; From eaa284b9ceba1e0aad59725e14c37d88b0ede9dd Mon Sep 17 00:00:00 2001 From: rustamwin Date: Mon, 19 Aug 2024 11:37:26 +0000 Subject: [PATCH 3/5] Apply Rector changes (CI) --- src/KeyFactory/FromCertificateFile.php | 2 +- src/KeyFactory/FromKeyFile.php | 2 +- src/KeyFactory/FromPKCS12CertificateFile.php | 2 +- src/KeyFactory/FromSecret.php | 2 +- src/TokenFactory.php | 6 +++--- src/TokenRepository.php | 6 +++--- tests/Stub/FakeIdentity.php | 2 +- tests/Stub/FakeIdentityRepository.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/KeyFactory/FromCertificateFile.php b/src/KeyFactory/FromCertificateFile.php index 1cce1e3..af10820 100644 --- a/src/KeyFactory/FromCertificateFile.php +++ b/src/KeyFactory/FromCertificateFile.php @@ -15,7 +15,7 @@ */ final class FromCertificateFile implements KeyFactoryInterface { - public function __construct(private string $file) + public function __construct(private readonly string $file) { } diff --git a/src/KeyFactory/FromKeyFile.php b/src/KeyFactory/FromKeyFile.php index ef9e8c7..1fd2990 100644 --- a/src/KeyFactory/FromKeyFile.php +++ b/src/KeyFactory/FromKeyFile.php @@ -15,7 +15,7 @@ */ final class FromKeyFile implements KeyFactoryInterface { - public function __construct(private string $file, private string $password) + public function __construct(private readonly string $file, private readonly string $password) { } diff --git a/src/KeyFactory/FromPKCS12CertificateFile.php b/src/KeyFactory/FromPKCS12CertificateFile.php index ddcfcd7..8a6e44f 100644 --- a/src/KeyFactory/FromPKCS12CertificateFile.php +++ b/src/KeyFactory/FromPKCS12CertificateFile.php @@ -15,7 +15,7 @@ */ final class FromPKCS12CertificateFile implements KeyFactoryInterface { - public function __construct(private string $file, private string $secret) + public function __construct(private readonly string $file, private readonly string $secret) { } diff --git a/src/KeyFactory/FromSecret.php b/src/KeyFactory/FromSecret.php index 41f6a2a..1cedf5c 100644 --- a/src/KeyFactory/FromSecret.php +++ b/src/KeyFactory/FromSecret.php @@ -13,7 +13,7 @@ */ final class FromSecret implements KeyFactoryInterface { - public function __construct(private string $secret) + public function __construct(private readonly string $secret) { } diff --git a/src/TokenFactory.php b/src/TokenFactory.php index e5a0e4c..f9e8430 100644 --- a/src/TokenFactory.php +++ b/src/TokenFactory.php @@ -22,9 +22,9 @@ final class TokenFactory implements TokenFactoryInterface * @see https://tools.ietf.org/html/rfc7515 */ public function __construct( - private KeyFactoryInterface $keyFactory, - private AlgorithmManager $algorithmManager, - private JWSSerializerManager $serializerManager + private readonly KeyFactoryInterface $keyFactory, + private readonly AlgorithmManager $algorithmManager, + private readonly JWSSerializerManager $serializerManager ) { } diff --git a/src/TokenRepository.php b/src/TokenRepository.php index 95a7877..7904fcc 100644 --- a/src/TokenRepository.php +++ b/src/TokenRepository.php @@ -25,9 +25,9 @@ final class TokenRepository implements TokenRepositoryInterface * @see https://tools.ietf.org/html/rfc7515 */ public function __construct( - private KeyFactoryInterface $keyFactory, - private AlgorithmManager $algorithmManager, - private JWSSerializerManager $serializerManager + private readonly KeyFactoryInterface $keyFactory, + private readonly AlgorithmManager $algorithmManager, + private readonly JWSSerializerManager $serializerManager ) { } diff --git a/tests/Stub/FakeIdentity.php b/tests/Stub/FakeIdentity.php index 008a55a..9d3718c 100644 --- a/tests/Stub/FakeIdentity.php +++ b/tests/Stub/FakeIdentity.php @@ -8,7 +8,7 @@ final class FakeIdentity implements IdentityInterface { - public function __construct(private ?string $id) + public function __construct(private readonly ?string $id) { } diff --git a/tests/Stub/FakeIdentityRepository.php b/tests/Stub/FakeIdentityRepository.php index c61c672..e1327eb 100644 --- a/tests/Stub/FakeIdentityRepository.php +++ b/tests/Stub/FakeIdentityRepository.php @@ -9,7 +9,7 @@ final class FakeIdentityRepository implements IdentityRepositoryInterface { - public function __construct(private ?IdentityInterface $returnIdentity) + public function __construct(private readonly ?IdentityInterface $returnIdentity) { } From 9f2cb12669d1cb57a82d46a587de2efce64a2948 Mon Sep 17 00:00:00 2001 From: rustamwin Date: Mon, 19 Aug 2024 17:10:04 +0500 Subject: [PATCH 4/5] Add changelog & remove scrutinizer --- .scrutinizer.yml | 35 ----------------------------------- CHANGELOG.md | 1 + 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 61fb502..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,35 +0,0 @@ -checks: - php: true - -filter: - paths: - - src/ - -build: - image: default-bionic - - environment: - php: - version: 8.0.18 - ini: - xdebug.mode: coverage - - nodes: - analysis: - tests: - override: - - php-scrutinizer-run - - phpunit: - dependencies: - override: - - composer self-update - - composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - tests: - override: - - command: ./vendor/bin/phpunit --coverage-clover ./coverage.xml - on_node: 1 - coverage: - file: coverage.xml - format: php-clover diff --git a/CHANGELOG.md b/CHANGELOG.md index 6803836..85a8ec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Chg #67: Bump required PHP version to 8.0 (@rustamwin) - Enh #75: Add support for `psr/http-message` version `^2.0` (@vjik) +- Chg #82: Replace `web-token/*` with `web-token/jwt-library` and update min version to of PHP to 8.1 (@rustamwin) ## 2.0.1 September 19, 2023 From d5c4a38e8ffdbba9a4a4c108ad6026b466aaac2f Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 19 Aug 2024 18:57:04 +0300 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a8ec3..7015bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,8 @@ ## 2.1.0 under development -- Chg #67: Bump required PHP version to 8.0 (@rustamwin) - Enh #75: Add support for `psr/http-message` version `^2.0` (@vjik) -- Chg #82: Replace `web-token/*` with `web-token/jwt-library` and update min version to of PHP to 8.1 (@rustamwin) +- Chg #82: Replace `web-token/*` with `web-token/jwt-library` and update min version of PHP to 8.1 (@rustamwin) ## 2.0.1 September 19, 2023