Skip to content

Commit 740b68d

Browse files
authored
Bump up firebase/php-jwt to ^7.0 (#760)
1 parent d172a6f commit 740b68d

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require-dev": {
3535
"cakephp/cakephp": "^5.1.0",
3636
"cakephp/cakephp-codesniffer": "^5.0",
37-
"firebase/php-jwt": "^6.2",
37+
"firebase/php-jwt": "^7.0",
3838
"phpunit/phpunit": "^10.5.58 || ^11.5.3 || ^12.4"
3939
},
4040
"suggest": {

tests/TestCase/Authenticator/JwtAuthenticatorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function setUp(): void
7979
'firstname' => 'larry',
8080
];
8181

82-
$this->tokenHS256 = JWT::encode($data, 'secretKey', 'HS256');
82+
$this->tokenHS256 = JWT::encode($data, 'secretKey0123456789secretKey0123456789', 'HS256');
8383

8484
$privKey1 = file_get_contents(__DIR__ . '/../../data/rsa1-private.pem');
8585
$this->tokenRS256 = JWT::encode($data, $privKey1, 'RS256', 'jwk1');
@@ -100,7 +100,7 @@ public function testAuthenticateViaHeaderToken()
100100
$this->request = $this->request->withAddedHeader('Authorization', 'Bearer ' . $this->tokenHS256);
101101

102102
$authenticator = new JwtAuthenticator($this->identifier, [
103-
'secretKey' => 'secretKey',
103+
'secretKey' => 'secretKey0123456789secretKey0123456789',
104104
'subjectKey' => 'subjectId',
105105
]);
106106

@@ -123,7 +123,7 @@ public function testAuthenticateViaQueryParamToken()
123123
);
124124

125125
$authenticator = new JwtAuthenticator($this->identifier, [
126-
'secretKey' => 'secretKey',
126+
'secretKey' => 'secretKey0123456789secretKey0123456789',
127127
'subjectKey' => 'subjectId',
128128
]);
129129

@@ -159,7 +159,7 @@ public function testAuthenticationViaIdentifierAndSubject()
159159
]));
160160

161161
$authenticator = new JwtAuthenticator($this->identifier, [
162-
'secretKey' => 'secretKey',
162+
'secretKey' => 'secretKey0123456789secretKey0123456789',
163163
'returnPayload' => false,
164164
'subjectKey' => 'subjectId',
165165
]);
@@ -242,7 +242,7 @@ public function testInvalidToken()
242242
);
243243

244244
$authenticator = new JwtAuthenticator($this->identifier, [
245-
'secretKey' => 'secretKey',
245+
'secretKey' => 'secretKey0123456789secretKey0123456789',
246246
]);
247247

248248
$result = $authenticator->authenticate($this->request);
@@ -268,7 +268,7 @@ public function testGetPayloadHS256()
268268
);
269269

270270
$authenticator = new JwtAuthenticator($this->identifier, [
271-
'secretKey' => 'secretKey',
271+
'secretKey' => 'secretKey0123456789secretKey0123456789',
272272
]);
273273

274274
$result = $authenticator->getPayload();

tests/TestCase/Middleware/AuthenticationMiddlewareTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,13 @@ public function testJwtTokenAuthorizationThroughTheMiddlewareStack()
578578
'firstname' => 'larry',
579579
];
580580

581-
$token = JWT::encode($data, 'secretKey', 'HS256');
581+
$token = JWT::encode($data, 'secretKey0123456789secretKey0123456789', 'HS256');
582582

583583
$this->service = new AuthenticationService([
584584
'authenticators' => [
585585
'Authentication.Form' => ['identifier' => 'Authentication.Password'],
586586
'Authentication.Jwt' => [
587-
'secretKey' => 'secretKey',
587+
'secretKey' => 'secretKey0123456789secretKey0123456789',
588588
'identifier' => 'Authentication.JwtSubject',
589589
],
590590
],

0 commit comments

Comments
 (0)