Skip to content

Commit a1f17c6

Browse files
authored
Merge pull request #18 from careerbuilder/RDP-51913
[RDP-51913] Update PHP-JWT version
2 parents 9cf2390 + 3e6f165 commit a1f17c6

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

.circleci/config.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
base: &base
22
working_directory: ~/php-oauth
33
docker:
4-
- image: circleci/php:7.4-cli
4+
- image: cimg/php:8.4
55

66
remote-docker: &remote_docker
77
setup_remote_docker
@@ -11,47 +11,47 @@ docker-info: &docker_info
1111

1212
version: 2
1313
jobs:
14-
build-php71:
14+
build-php81:
1515
<<: *base
1616
steps:
1717
- checkout
1818
- *remote_docker
1919
- *docker_info
20-
- run: docker build --build-arg PHP_VERSION=7.1 -t tests-php71 .
21-
- run: docker run tests-php71
20+
- run: docker build --build-arg PHP_VERSION=8.1 -t tests-php81 .
21+
- run: docker run tests-php81
2222

23-
build-php72:
23+
build-php82:
2424
<<: *base
2525
steps:
2626
- checkout
2727
- *remote_docker
2828
- *docker_info
29-
- run: docker build --build-arg PHP_VERSION=7.2 -t tests-php72 .
30-
- run: docker run tests-php72
29+
- run: docker build --build-arg PHP_VERSION=8.2 -t tests-php82 .
30+
- run: docker run tests-php82
3131

32-
build-php73:
32+
build-php83:
3333
<<: *base
3434
steps:
3535
- checkout
3636
- *remote_docker
3737
- *docker_info
38-
- run: docker build --build-arg PHP_VERSION=7.3 -t tests-php73 .
39-
- run: docker run tests-php73
38+
- run: docker build --build-arg PHP_VERSION=8.3 -t tests-php83 .
39+
- run: docker run tests-php83
4040

41-
build-php74:
41+
build-php84:
4242
<<: *base
4343
steps:
4444
- checkout
4545
- *remote_docker
4646
- *docker_info
47-
- run: docker build --build-arg PHP_VERSION=7.4 -t tests-php74 .
48-
- run: docker run tests-php74
47+
- run: docker build --build-arg PHP_VERSION=8.4 -t tests-php84 .
48+
- run: docker run tests-php84
4949

5050
workflows:
5151
version: 2
5252
all:
5353
jobs:
54-
- build-php71
55-
- build-php72
56-
- build-php73
57-
- build-php74
54+
- build-php81
55+
- build-php82
56+
- build-php83
57+
- build-php84

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PHP_VERSION
2-
FROM php:${PHP_VERSION:-7.4}-alpine
3-
RUN apk add --no-cache git $PHPIZE_DEPS && \
2+
FROM php:${PHP_VERSION:-8.4}-alpine
3+
RUN apk add --no-cache linux-headers git $PHPIZE_DEPS && \
44
pecl install xdebug && \
55
docker-php-ext-enable xdebug && \
66
curl -# https://getcomposer.org/installer | php && \

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"require": {
66
"guzzlehttp/guzzle": "^6.5",
77
"psr/log": "^1.1",
8-
"firebase/php-jwt": "^5.0"
8+
"firebase/php-jwt": "6.5.0"
99
},
1010
"require-dev": {
11-
"phpunit/phpunit": "^5.7"
11+
"phpunit/phpunit": "^8.0"
1212
},
1313
"autoload": {
1414
"psr-0": {

tests/CareerBuilder/OAuth2/Flows/ClientCredentialsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use CareerBuilder\OAuth2\AccessToken;
1616
use Firebase\JWT\JWT;
17+
use Firebase\JWT\Key;
1718
use GuzzleHttp\Client;
1819
use GuzzleHttp\Handler\MockHandler;
1920
use GuzzleHttp\Psr7\Response;
@@ -54,7 +55,7 @@ public function testGetToken()
5455
$postFields = [];
5556
parse_str($body, $postFields);
5657

57-
$jwt = JWT::decode($postFields['client_assertion'], 'sharedsecret', ['HS512']);
58+
$jwt = JWT::decode($postFields['client_assertion'], new Key('sharedsecret','HS512'));
5859

5960
$this->assertEquals('POST', $request->getMethod());
6061
$this->assertEquals('clientid', $postFields['client_id']);

tests/CareerBuilder/OAuth2/Flows/JWTBearerAssertionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace CareerBuilder\OAuth2\Flows;
1414

1515
use Firebase\JWT\JWT;
16+
use Firebase\JWT\Key;
1617
use GuzzleHttp\Client;
1718
use GuzzleHttp\Handler\MockHandler;
1819
use GuzzleHttp\Psr7\Response;
@@ -55,7 +56,7 @@ public function testGetToken()
5556
$postFields = [];
5657
parse_str($body, $postFields);
5758

58-
$jwt = JWT::decode($postFields['assertion'], 'sharedsecret', ['HS512']);
59+
$jwt = JWT::decode($postFields['assertion'], new Key('sharedsecret','HS512'));
5960

6061
$this->assertEquals('POST', $request->getMethod());
6162
$this->assertEquals('clientid', $postFields['client_id']);

0 commit comments

Comments
 (0)