From 684d0fe2b6b905c254699ad42cd25c51fcb90104 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:08:32 +0530 Subject: [PATCH 1/9] fix : Unit Tests --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ca448a..79449a8 100644 --- a/README.md +++ b/README.md @@ -298,4 +298,4 @@ Please do not report security vulnerabilities on the public Github issue tracker

Auth0 is an easy to implement, adaptable authentication and authorization platform.
To learn more checkout Why Auth0?

-

This project is licensed under the MIT license. See the LICENSE file for more info.

+

This project is licensed under the MIT license. See the LICENSE file for more info.

\ No newline at end of file From f96527c81fe345d24ce381252d694d22ca748fa3 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:17:56 +0530 Subject: [PATCH 2/9] Fixing the PHP CS and STAN Issues --- src/Auth0Bundle.php | 2 +- src/Models/User.php | 2 +- src/Stores/SessionStore.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Auth0Bundle.php b/src/Auth0Bundle.php index 59127b7..25a6c89 100644 --- a/src/Auth0Bundle.php +++ b/src/Auth0Bundle.php @@ -17,8 +17,8 @@ use Psr\Http\Client\ClientInterface; use Psr\Http\Message\{RequestFactoryInterface, ResponseFactoryInterface, StreamFactoryInterface}; use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\DependencyInjection\{ContainerBuilder, Reference}; +use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\HttpKernel\Bundle\AbstractBundle; final class Auth0Bundle extends AbstractBundle implements BundleInterface diff --git a/src/Models/User.php b/src/Models/User.php index c2ed1f5..6c9f801 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -300,7 +300,7 @@ public function getUserIdentifier(): string $userIdentifier = $this->getId() ?? $this->data['sub']; if (! is_string($userIdentifier)) { - return ''; + return 'unknown'; } return $userIdentifier; diff --git a/src/Stores/SessionStore.php b/src/Stores/SessionStore.php index 0cf5ada..467f3bb 100644 --- a/src/Stores/SessionStore.php +++ b/src/Stores/SessionStore.php @@ -7,8 +7,8 @@ use Auth0\SDK\Contract\StoreInterface; use InvalidArgumentException; use Psr\Log\LoggerInterface; -use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\{Request, RequestStack}; +use Symfony\Component\HttpFoundation\Session\SessionInterface; use Throwable; use function gettype; From 81c33e2293676a83217d6f910355927c30489a7a Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:41:50 +0530 Subject: [PATCH 3/9] Changes to Psalm Rules --- psalm.xml.dist | 1 + src/Models/User.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index 0cf0f11..fc3c69e 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -29,5 +29,6 @@ + diff --git a/src/Models/User.php b/src/Models/User.php index 6c9f801..c2ed1f5 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -300,7 +300,7 @@ public function getUserIdentifier(): string $userIdentifier = $this->getId() ?? $this->data['sub']; if (! is_string($userIdentifier)) { - return 'unknown'; + return ''; } return $userIdentifier; From 85879cad1d24af93866d6c32f1dbb457d3b764e1 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:44:59 +0530 Subject: [PATCH 4/9] Reverting Psalm Changes --- psalm.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index fc3c69e..0cf0f11 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -29,6 +29,5 @@ - From 0cf7e726c8c037a1636cc8c9e986540c652113a1 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:51:57 +0530 Subject: [PATCH 5/9] Adding ignore rule for PHP Stan --- phpstan.neon.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 344901d..8970ada 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -49,6 +49,9 @@ parameters: - message: '#Parameter \#1 \$object of function method_exists expects object\|string, Psr\\Http\\Client\\ClientInterface\|null given.#' path: src\Utility\HttpRequest.php + - + message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns string.#' + path: src\Models\User.php reportUnmatchedIgnoredErrors: false checkGenericClassInNonGenericObjectType: false From 3dd2d41b890a2e79bbf328e3bcccc7c08e9d10ce Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 14:55:23 +0530 Subject: [PATCH 6/9] Updating the PHP Stan Rule --- phpstan.neon.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8970ada..f9a7e8c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -52,6 +52,9 @@ parameters: - message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns string.#' path: src\Models\User.php + - + message: '#Method Auth0\Symfony\Models\User::getUserIdentifier() should return non-empty-string but returns ''.#' + path: src\Models\User.php reportUnmatchedIgnoredErrors: false checkGenericClassInNonGenericObjectType: false From 5b209acf8b1046c5b57d4088635e0ef8a9a20f1f Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 15:05:36 +0530 Subject: [PATCH 7/9] Changes to Psalm and Stan rules --- phpstan.neon.dist | 4 ++-- psalm.xml.dist | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f9a7e8c..3dbba3a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -52,8 +52,8 @@ parameters: - message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns string.#' path: src\Models\User.php - - - message: '#Method Auth0\Symfony\Models\User::getUserIdentifier() should return non-empty-string but returns ''.#' + - + message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns \"\".#' path: src\Models\User.php reportUnmatchedIgnoredErrors: false diff --git a/psalm.xml.dist b/psalm.xml.dist index 0cf0f11..1b90dad 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -13,6 +13,7 @@ + From 2670a40d9ef95952cb611ad1f0fef5c63983e896 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 15:12:23 +0530 Subject: [PATCH 8/9] PHP Stan Rule Changes --- phpstan.neon.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3dbba3a..daa9730 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -53,7 +53,7 @@ parameters: message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns string.#' path: src\Models\User.php - - message: '#Method Auth0\\Symfony\\Models\\User::getUserIdentifier\(\) should return non-empty-string but returns \"\".#' + message: "#^Method Auth0\\\\Symfony\\\\Models\\\\User::getUserIdentifier\\(\\) should return non-empty-string but returns ''\\.$#" path: src\Models\User.php reportUnmatchedIgnoredErrors: false From 0599a4b778c3f2aa17a4280ecbf01602eaa04885 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 13 May 2025 15:19:43 +0530 Subject: [PATCH 9/9] Psalm Rule Modification --- psalm.xml.dist | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/psalm.xml.dist b/psalm.xml.dist index 1b90dad..a230e27 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -30,5 +30,15 @@ + + + + + + + + + +