Skip to content

Commit ef5fa30

Browse files
[11.x] Allow lcobucci/jwt v5 and cleaned up version constraints (#1649)
* Allow `lcobucci/jwt` v5 * Temp change to see why CI no likey * Update composer.json * Update composer.json * Fixes * Update composer.json
1 parent 2583a0a commit ef5fa30

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": {
1717
"php": "^8.0",
1818
"ext-json": "*",
19-
"firebase/php-jwt": "^6.3.1",
19+
"firebase/php-jwt": "^6.4",
2020
"illuminate/auth": "^9.0|^10.0",
2121
"illuminate/console": "^9.0|^10.0",
2222
"illuminate/container": "^9.0|^10.0",
@@ -26,11 +26,11 @@
2626
"illuminate/encryption": "^9.0|^10.0",
2727
"illuminate/http": "^9.0|^10.0",
2828
"illuminate/support": "^9.0|^10.0",
29-
"lcobucci/jwt": "^3.4|^4.0",
30-
"league/oauth2-server": "^8.2",
31-
"nyholm/psr7": "^1.3",
29+
"lcobucci/jwt": "^4.3|^5.0",
30+
"league/oauth2-server": "^8.5.1",
31+
"nyholm/psr7": "^1.5",
3232
"phpseclib/phpseclib": "^2.0|^3.0",
33-
"symfony/psr-http-message-bridge": "^2.0"
33+
"symfony/psr-http-message-bridge": "^2.1"
3434
},
3535
"require-dev": {
3636
"mockery/mockery": "^1.0",

src/PassportServiceProvider.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
use Laravel\Passport\Bridge\RefreshTokenRepository;
1717
use Laravel\Passport\Guards\TokenGuard;
1818
use Laravel\Passport\Http\Controllers\AuthorizationController;
19-
use Lcobucci\JWT\Configuration;
20-
use Lcobucci\JWT\Parser;
19+
use Lcobucci\JWT\Encoding\JoseEncoder;
20+
use Lcobucci\JWT\Parser as ParserContract;
21+
use Lcobucci\JWT\Token\Parser;
2122
use League\OAuth2\Server\AuthorizationServer;
2223
use League\OAuth2\Server\CryptKey;
2324
use League\OAuth2\Server\Grant\AuthCodeGrant;
@@ -294,8 +295,8 @@ protected function registerClientRepository()
294295
*/
295296
protected function registerJWTParser()
296297
{
297-
$this->app->singleton(Parser::class, function () {
298-
return Configuration::forUnsecuredSigner()->parser();
298+
$this->app->singleton(ParserContract::class, function () {
299+
return new Parser(new JoseEncoder);
299300
});
300301
}
301302

tests/Unit/PersonalAccessTokenFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function test_access_token_can_be_created()
4242
$parsedToken = new PlainToken(
4343
new DataSet([], ''),
4444
new DataSet([RegisteredClaims::ID => 'token'], ''),
45-
Signature::fromEmptyData()
45+
new Signature('', '')
4646
);
4747

4848
$jwt->shouldReceive('parse')->with('foo')->andReturn($parsedToken);

0 commit comments

Comments
 (0)