From 13766a4576bc71e0624c4193448ebaae4ea81654 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Mon, 24 Jun 2024 14:25:45 -0500 Subject: [PATCH 1/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f2cd315..6cbbdc3 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "auth0/auth0-php": "^8.10", + "auth0/auth0-php": "^8.11", "symfony/cache": "^6.4", "symfony/framework-bundle": "^6.4", "symfony/security-bundle": "^6.4" From 9a88c2abbd5596ee4b5bcb0e4ac74dc918ab3f63 Mon Sep 17 00:00:00 2001 From: Marijus Kilmanas Date: Mon, 24 Jun 2024 22:30:13 +0300 Subject: [PATCH 2/3] Remove $container parameter from controller constructors (#190) ### Changes Fix for issue #189 - Removed `$container` parameter from controllers (because it is injected via `setContainer()` by Symfony DI) - Added exception in psalm config not to report this as a problem ### References #189 ### Testing Tested statically and on a Symfony 7.0 project (although controllers are not executed there - verified that container builds without problems and `bin/console list:container` reports no problems) Tested only statically on Symfony 6.4. Testing on older Symfony versions would be much appreciated. [ ] This change adds test coverage [x] This change has been tested on the latest version of Symfony ### Checklist [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) [x] All existing and new tests complete without errors Co-authored-by: Evan Sims --- psalm.xml.dist | 5 +++++ src/Controllers/AuthenticationController.php | 4 ---- src/Controllers/BackchannelLogoutController.php | 5 +---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index 6a528d4..0cf0f11 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -24,5 +24,10 @@ + + + + + diff --git a/src/Controllers/AuthenticationController.php b/src/Controllers/AuthenticationController.php index 5d27454..09f21ca 100644 --- a/src/Controllers/AuthenticationController.php +++ b/src/Controllers/AuthenticationController.php @@ -7,9 +7,7 @@ use Auth0\SDK\Auth0; use Auth0\Symfony\Contracts\Controllers\AuthenticationControllerInterface; use Auth0\Symfony\Security\Authenticator; -use Psr\Container\ContainerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\HttpFoundation\Exception\{BadRequestException, ConflictingHeadersException, SuspiciousOperationException}; use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response}; use Symfony\Component\Routing\RouterInterface; use Throwable; @@ -22,9 +20,7 @@ final class AuthenticationController extends AbstractController implements Authe public function __construct( private Authenticator $authenticator, private RouterInterface $router, - ContainerInterface $container, ) { - $this->container = $container; } /** diff --git a/src/Controllers/BackchannelLogoutController.php b/src/Controllers/BackchannelLogoutController.php index 4e06f5c..eb56a7c 100644 --- a/src/Controllers/BackchannelLogoutController.php +++ b/src/Controllers/BackchannelLogoutController.php @@ -7,9 +7,8 @@ use Auth0\SDK\Auth0; use Auth0\Symfony\Contracts\Controllers\AuthenticationControllerInterface; use Auth0\Symfony\Security\Authenticator; -use Psr\Container\ContainerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response}; +use Symfony\Component\HttpFoundation\{Request, Response}; use Throwable; use function is_string; @@ -18,9 +17,7 @@ final class BackchannelLogoutController extends AbstractController implements Au { public function __construct( private Authenticator $authenticator, - ContainerInterface $container, ) { - $this->container = $container; } /** From d4c3aaca8c3848e632f77b8d2b12d5357292cbb4 Mon Sep 17 00:00:00 2001 From: Marijus Kilmanas Date: Mon, 24 Jun 2024 22:35:25 +0300 Subject: [PATCH 3/3] Allow symfony-7 in composer.json (#188) ### Changes This is simply allowing Symfony 7 in composer.json - could not find any problems or incompatibilities at this point. - composer.json updated - all tests (`composer test`) are passing - tried it out on a minimal Symfony 7 project - no problems found - though I have only verified the JWT authentication use-case ### References #182 ### Testing Attempted to install this bundle on a small Symfony project and perform JWT authentication. Other use-cases should be verified. Maybe instead of merging to `main` branch, this should be "quarantined" in a dedicated branch (e.g. `symfony7`) of this main repository - that way other people would be able to install this version via composer by requiring `auth0/symfony: dev-symfony7` and then test on their applications and their use-cases? [ ] This change adds test coverage [x] This change has been tested on the latest version of Symfony ### Checklist [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) [x] All existing and new tests complete without errors Co-authored-by: Evan Sims --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6cbbdc3..969e982 100644 --- a/composer.json +++ b/composer.json @@ -34,9 +34,9 @@ "ext-mbstring": "*", "ext-openssl": "*", "auth0/auth0-php": "^8.11", - "symfony/cache": "^6.4", - "symfony/framework-bundle": "^6.4", - "symfony/security-bundle": "^6.4" + "symfony/cache": "^6.4 || ^7.0", + "symfony/framework-bundle": "^6.4 || ^7.0", + "symfony/security-bundle": "^6.4 || ^7.0" }, "require-dev": { "ergebnis/composer-normalize": "^2",