From 946aad10bce27dda6a77077c16fb3b8dd4b91974 Mon Sep 17 00:00:00 2001 From: rhertogh Date: Sun, 15 Aug 2021 12:00:59 +0200 Subject: [PATCH 1/5] Added exception chaining in BearerTokenValidator Added exception chaining for RequiredConstraintsViolated in `\League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator::validateAuthorization()` similar to line 103. --- src/AuthorizationValidators/BearerTokenValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AuthorizationValidators/BearerTokenValidator.php b/src/AuthorizationValidators/BearerTokenValidator.php index e41e1a2b7..6f767ceef 100644 --- a/src/AuthorizationValidators/BearerTokenValidator.php +++ b/src/AuthorizationValidators/BearerTokenValidator.php @@ -108,7 +108,7 @@ public function validateAuthorization(ServerRequestInterface $request) $constraints = $this->jwtConfiguration->validationConstraints(); $this->jwtConfiguration->validator()->assert($token, ...$constraints); } catch (RequiredConstraintsViolated $exception) { - throw OAuthServerException::accessDenied('Access token could not be verified'); + throw OAuthServerException::accessDenied('Access token could not be verified', null, $exception); } $claims = $token->claims(); From dc8a8af319c54683eb2f2193747d19c5dc144151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Fri, 21 Apr 2023 11:18:22 +0200 Subject: [PATCH 2/5] Remove requirement of json extension --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 9699116ee..24684a273 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "lcobucci/jwt": "^4.3 || ^5.0", "psr/http-message": "^1.0.1", "defuse/php-encryption": "^2.3", - "ext-json": "*", "lcobucci/clock": "^2.2 || ^3.0" }, "require-dev": { From 8f89bf254d3975a4dc263660dd724dedc21511b5 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Tue, 6 Jun 2023 21:44:02 +0100 Subject: [PATCH 3/5] Remove skipping of test --- tests/Utils/CryptKeyTest.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/Utils/CryptKeyTest.php b/tests/Utils/CryptKeyTest.php index 7190864c6..b9c53b660 100644 --- a/tests/Utils/CryptKeyTest.php +++ b/tests/Utils/CryptKeyTest.php @@ -54,9 +54,6 @@ public function testKeyString() public function testUnsupportedKeyType() { - if (\str_starts_with(\phpversion(), '8.0')) { - $this->markTestSkipped('Cannot generate key on PHP 8.0 runner. Investigating'); - } $this->expectException(\LogicException::class); $this->expectExceptionMessage('Unable to read key'); From 75f210dc7be2d81761a9a13a79b5e9b3c5f37b3c Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Tue, 6 Jun 2023 21:56:22 +0100 Subject: [PATCH 4/5] Run 8.0 tests on Ubuntu 20.04 --- .github/workflows/tests.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b82845c8..1d17d65c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,13 +8,17 @@ on: jobs: tests: - runs-on: ubuntu-latest - strategy: fail-fast: false matrix: - php: [8.0, 8.1, 8.2] + php: [8.1, 8.2] + os: [ubuntu-22.04] stability: [prefer-lowest, prefer-stable] + include: + - os: ubuntu-20.04 + php: 8.0 + + runs-on: ${{ matrix.os }} name: PHP ${{ matrix.php }} - ${{ matrix.stability }} From a10cde3daf65c0c19c5c8a05e9b40cd435016489 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Tue, 6 Jun 2023 21:58:33 +0100 Subject: [PATCH 5/5] Include stability preferences for composer install --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d17d65c5..ade0c245b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,10 @@ jobs: include: - os: ubuntu-20.04 php: 8.0 + stability: prefer-lowest + - os: ubuntu-20.04 + php: 8.0 + stability: prefer-stable runs-on: ${{ matrix.os }}