Skip to content

Commit

Permalink
Update dependencies to PHP 8 and fix broken code
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Eelen committed Feb 28, 2024
1 parent 1986880 commit 1f105e7
Show file tree
Hide file tree
Showing 12 changed files with 2,238 additions and 1,244 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: up down build install install-npm install-githooks bash init

up:
docker-compose up -d

down:
docker-compose down

build:
docker-compose up --build

install:
docker exec -it jwt-provider composer install

bash:
docker exec -it jwt-provider bash

init: install
12 changes: 3 additions & 9 deletions app/ActionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,23 @@
use CultuurNet\UDB3\JwtProvider\Domain\Action\RequestToken;
use CultuurNet\UDB3\JwtProvider\Domain\Factory\ResponseFactoryInterface;
use CultuurNet\UDB3\JwtProvider\Domain\Repository\ClientInformationRepositoryInterface;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\ExtractClientInformationFromRequest;
use CultuurNet\UDB3\JwtProvider\Domain\Service\LoginServiceInterface;
use CultuurNet\UDB3\JwtProvider\Domain\Service\GenerateAuthorizedDestinationUrl;
use CultuurNet\UDB3\JwtProvider\Domain\Service\LoginServiceInterface;
use CultuurNet\UDB3\JwtProvider\Domain\Service\LogOutServiceInterface;
use CultuurNet\UDB3\JwtProvider\Domain\Service\RefreshServiceInterface;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Factory\SlimResponseFactory;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Repository\SessionClientInformation;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\ExtractClientInformationFromRequest;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\ExtractLocaleFromRequest;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\IsAllowedRefreshToken;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\LoginAuth0Adapter;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\LogOutAuth0Adapter;
use CultuurNet\UDB3\JwtProvider\Infrastructure\Service\RefreshAuth0Adapter;
use Firebase\JWT\JWT;
use GuzzleHttp\Client;
use Slim\Psr7\Factory\UriFactory;

final class ActionServiceProvider extends BaseServiceProvider
{
// @see https://community.auth0.com/t/help-with-leeway-setting-using-auth0-php/14657
// @see https://community.auth0.com/t/help-with-leeway-setting-using-auth0-php/14657/7
private const JWT_IAT_LEEWAY = 30;

/**
* @var string[]
*/
Expand Down Expand Up @@ -156,7 +151,6 @@ function () {
$this->addShared(
Auth0::class,
function () {
JWT::$leeway = self::JWT_IAT_LEEWAY;
return new Auth0(
[
'domain' => $this->parameter('auth0.domain'),
Expand All @@ -176,7 +170,7 @@ function () {
function () {
return new IsAllowedRefreshToken(
$this->get(ConsumerReadRepositoryInterface::class),
(string) $this->parameter('auth0.allowed_refresh_permission')
(string)$this->parameter('auth0.allowed_refresh_permission')
);
}
);
Expand Down
2 changes: 1 addition & 1 deletion app/Error/ApiExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

use CultuurNet\UDB3\JwtProvider\Domain\Exception\JwtProviderExceptionInterface;
use Fig\Http\Message\StatusCodeInterface;
use Laminas\HttpHandlerRunner\Emitter\EmitterInterface;
use Psr\Http\Message\ResponseInterface;
use Slim\Psr7\Response;
use Whoops\Handler\Handler;
use Zend\HttpHandlerRunner\Emitter\EmitterInterface;

final class ApiExceptionHandler extends Handler
{
Expand Down
2 changes: 1 addition & 1 deletion app/Factory/ErrorHandlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use CultuurNet\UDB3\JwtProvider\Error\ErrorLoggerHandler;
use CultuurNet\UDB3\JwtProvider\Error\ApiExceptionHandler;
use Laminas\HttpHandlerRunner\Emitter\SapiStreamEmitter;
use Psr\Log\LoggerInterface;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
use Whoops\RunInterface;
use Zend\HttpHandlerRunner\Emitter\SapiStreamEmitter;

final class ErrorHandlerFactory
{
Expand Down
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@
}
],
"require": {
"php": "^7.1.27",
"php": ">=7.1",
"aura/session": "^2.1",
"filp/whoops": "^2.5",
"guzzlehttp/psr7": "^1.3",
"hassankhan/config": "^2.1",
"league/container": "^3.3",
"league/route": "^4.3",
"monolog/monolog": "^1.11",
"slim/psr7": "^0.6",
"slim/psr7": "^1.6",
"symfony/yaml": "^4.3",
"zendframework/zend-httphandlerrunner": "^1.1",
"auth0/auth0-php": "^5.7",
"laminas/laminas-httphandlerrunner": "^2.0",
"auth0/auth0-php": "^7.0",
"beberlei/assert": "^3.2",
"cultuurnet/culturefeed-php": "^1.10",
"cultuurnet/udb3-api-guard": "^v4.0.0",
"sentry/sdk": "^2.2.0"
"sentry/sdk": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "^8.0",
"publiq/php-cs-fixer-config": "^1.3",
"phpstan/phpstan": "^0.12.80",
"jangregor/phpstan-prophecy": "^0.8.1"
"jangregor/phpstan-prophecy": "^0.8.1",
"phpspec/prophecy": "^1.18"
},
"autoload": {
"psr-4": {
Expand All @@ -54,6 +55,9 @@
"preferred-install": {
"cultuurnet/*": "source",
"*": "dist"
},
"allow-plugins": {
"php-http/discovery": true
}
},
"scripts": {
Expand Down
Loading

0 comments on commit 1f105e7

Please sign in to comment.