diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ce9ccd9..fe9667fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,9 +35,17 @@ jobs: symfony: 6.2.* composer-flags: '--prefer-stable' can-fail: false + - php: 8.2 + symfony: 6.3.* + composer-flags: '--prefer-stable' + can-fail: false # Development Symfony branches - php: 8.2 - symfony: 6.3.*@dev + symfony: 6.4.*@dev + composer-flags: '' + can-fail: false + - php: 8.2 + symfony: 7.0.*@dev composer-flags: '' can-fail: false @@ -63,15 +71,15 @@ jobs: tools: "composer:v2,flex" - name: "Set Composer stability" - if: "matrix.symfony == '6.3.*@dev'" + if: "matrix.symfony == '6.4.*@dev' || matrix.symfony == '7.0.*@dev'" run: "composer config minimum-stability dev" - name: "Remove symfony/security-guard" - if: "matrix.symfony == '6.0.*' || matrix.symfony == '6.1.*' || matrix.symfony == '6.2.*' || matrix.symfony == '6.3.*@dev'" + if: "matrix.symfony == '6.0.*' || matrix.symfony == '6.1.*' || matrix.symfony == '6.2.*' || matrix.symfony == '6.3.*' || matrix.symfony == '6.4.*@dev' || matrix.symfony == '7.0.*@dev'" run: "composer remove --dev --no-update symfony/security-guard" - name: "Install api-platform/core" - if: "matrix.symfony == '6.1.*' || matrix.symfony == '6.2.*' || matrix.symfony == '6.3.*@dev'" + if: "matrix.symfony == '6.1.*' || matrix.symfony == '6.2.*' || matrix.symfony == '6.3.*' || matrix.symfony == '6.4.*@dev'" run: "composer require --dev --no-update api-platform/core:^3.0" - name: "Install dependencies" diff --git a/Exception/ExpiredTokenException.php b/Exception/ExpiredTokenException.php index ec1441c9..55e60c8c 100644 --- a/Exception/ExpiredTokenException.php +++ b/Exception/ExpiredTokenException.php @@ -17,7 +17,7 @@ class ExpiredTokenException extends AuthenticationException * * @return string */ - public function getMessageKey() + public function getMessageKey(): string { return 'Expired JWT Token'; } diff --git a/Exception/InvalidPayloadException.php b/Exception/InvalidPayloadException.php index 3be61534..d7fdae81 100644 --- a/Exception/InvalidPayloadException.php +++ b/Exception/InvalidPayloadException.php @@ -26,7 +26,7 @@ public function __construct(string $invalidKey) * * @return string */ - public function getMessageKey() + public function getMessageKey(): string { return sprintf('Unable to find key "%s" in the token payload.', $this->invalidKey); } diff --git a/Exception/InvalidTokenException.php b/Exception/InvalidTokenException.php index 76e474c2..b09fe9df 100644 --- a/Exception/InvalidTokenException.php +++ b/Exception/InvalidTokenException.php @@ -16,7 +16,7 @@ class InvalidTokenException extends AuthenticationException * * @return string */ - public function getMessageKey() + public function getMessageKey(): string { return 'Invalid JWT Token'; } diff --git a/Exception/MissingTokenException.php b/Exception/MissingTokenException.php index e7cee1fc..366e185c 100644 --- a/Exception/MissingTokenException.php +++ b/Exception/MissingTokenException.php @@ -16,7 +16,7 @@ class MissingTokenException extends AuthenticationException * * @return string */ - public function getMessageKey() + public function getMessageKey(): string { return 'JWT Token not found'; } diff --git a/Exception/UserNotFoundException.php b/Exception/UserNotFoundException.php index 62aaed92..fc2e3d46 100644 --- a/Exception/UserNotFoundException.php +++ b/Exception/UserNotFoundException.php @@ -23,7 +23,7 @@ public function __construct(string $userIdentityField, string $identity) /** * {@inheritdoc} */ - public function getMessageKey() + public function getMessageKey(): string { return sprintf('Unable to load an user with property "%s" = "%s". If the user identity has changed, you must renew the token. Otherwise, verify that the "lexik_jwt_authentication.user_identity_field" config option is correctly set.', $this->userIdentityField, $this->identity); } diff --git a/Security/Http/EntryPoint/JWTEntryPoint.php b/Security/Http/EntryPoint/JWTEntryPoint.php index 6ef9a8fe..4be5fc59 100644 --- a/Security/Http/EntryPoint/JWTEntryPoint.php +++ b/Security/Http/EntryPoint/JWTEntryPoint.php @@ -5,6 +5,7 @@ use Lexik\Bundle\JWTAuthenticationBundle\Response\JWTAuthenticationFailureResponse; use Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator\JWTAuthenticator; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; @@ -26,7 +27,7 @@ public function __construct() /** * {@inheritdoc} */ - public function start(Request $request, AuthenticationException $authException = null) + public function start(Request $request, AuthenticationException $authException = null): Response { $response = new JWTAuthenticationFailureResponse(); diff --git a/Security/User/JWTUser.php b/Security/User/JWTUser.php index a7b8a7aa..223e760e 100644 --- a/Security/User/JWTUser.php +++ b/Security/User/JWTUser.php @@ -72,7 +72,7 @@ public function getSalt(): ?string /** * {@inheritdoc} */ - public function eraseCredentials() + public function eraseCredentials(): void { } } diff --git a/Services/JWSProvider/DefaultJWSProvider.php b/Services/JWSProvider/DefaultJWSProvider.php index c56ebbcb..9c50f5ae 100644 --- a/Services/JWSProvider/DefaultJWSProvider.php +++ b/Services/JWSProvider/DefaultJWSProvider.php @@ -83,6 +83,7 @@ public function __construct(KeyLoaderInterface $keyLoader, $cryptoEngine, $signa public function create(array $payload, array $header = []) { $header['alg'] = $this->signatureAlgorithm; + $jws = new JWS($header, $this->cryptoEngine); $claims = ['iat' => time()]; diff --git a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php index f4194bb6..9f45d875 100644 --- a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php +++ b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php @@ -27,7 +27,7 @@ public function testCheckOpenApiExportCommand() $this->assertSame(0, $tester->execute([])); $this->assertJsonStringEqualsJsonString(<<