-
Notifications
You must be signed in to change notification settings - Fork 179
feat: Added support for plain dbal #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
295feb8 to
b698fce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces plain DBAL adapter support for JWT refresh tokens, enabling direct database access without requiring an ORM or ODM layer. This provides performance benefits through optimized queries and allows custom table and column configurations.
Key Changes:
- Added
RefreshTokenManagerfor DBAL with direct SQL queries and custom column mapping - Implemented automatic table creation via
TableSchemaManagerandEnsureTableExistsListener - Extended configuration to support DBAL connection settings with mutual exclusivity validation against object manager
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Functional/Doctrine/DBAL/RefreshTokenManagerTest.php | New test suite for DBAL refresh token manager covering save, retrieve, delete, and revoke operations |
| tests/Functional/DependencyInjection/GesdinetJWTRefreshTokenExtensionTest.php | Added tests for DBAL connection validation and configuration |
| tests/Functional/DependencyInjection/ConfigurationTest.php | Added tests for DBAL configuration options including table name, columns, and mutual exclusivity |
| src/GesdinetJWTRefreshTokenBundle.php | Registered ValidateDBALConnectionCompilerPass for connection validation |
| src/EventListener/EnsureTableExistsListener.php | New listener that automatically creates refresh token table on first request using ConfigCache |
| src/Doctrine/DBAL/TableSchemaManager.php | New service for managing database schema including table creation and configuration |
| src/Doctrine/DBAL/RefreshTokenManager.php | New DBAL-based implementation of RefreshTokenManagerInterface with custom column mapping support |
| src/DependencyInjection/GesdinetJWTRefreshTokenExtension.php | Updated to support DBAL configuration and conditionally load DBAL or ORM services |
| src/DependencyInjection/Configuration.php | Added DBAL configuration nodes including connection, table name, auto-create, and column mapping |
| src/DependencyInjection/Compiler/ValidateDBALConnectionCompilerPass.php | New compiler pass that validates DBAL connection exists and provides helpful error messages |
| config/services.php | Removed inline refresh token manager definition to support conditional loading |
| config/om_services.php | New file defining object manager-based refresh token manager service |
| config/dbal_services.php | New file defining DBAL-based services including manager, schema manager, and table listener |
| composer.json | Updated rector/rector version constraint and added phpstan/phpstan dependency |
| .php-cs-fixer.dist.php | Added PHP CS Fixer configuration file for code style enforcement |
| .php-cs-fixer.cache | Generated cache file from PHP CS Fixer execution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/Functional/DependencyInjection/GesdinetJWTRefreshTokenExtensionTest.php
Outdated
Show resolved
Hide resolved
|
@jorgerobles I will need that you update the PR with the changes properly and pass the unit tests to consider to be merged for release 2.0 or upper |
all the issues are solved, but cannot pass through some pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 18 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jorgerobles please fix all issues mentioned by copilot and dont commit .php-cs-fixer.cache |
6b14cef to
4c1a4bc
Compare
Done! |
…/GesdinetJWTRefreshTokenExtensionTest.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/Functional/DependencyInjection/GesdinetJWTRefreshTokenExtensionTest.php
Outdated
Show resolved
Hide resolved
tests/Functional/EventListener/EnsureTableExistsListenerTest.php
Outdated
Show resolved
Hide resolved
tests/Functional/EventListener/EnsureTableExistsListenerTest.php
Outdated
Show resolved
Hide resolved
function.alreadyNarrowedType which seems unusual. The method.notFound suppression is reasonable for backwards compatibility with Symfony < 5.3, but function.alreadyNarrowedType suggests there might be dead code Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The batch size parameter has a minimum value of 0 in the configuration (line 122), but the PHPDoc annotations throughout the codebase specify positive-int for batch sizes (e.g., RefreshTokenManager.php:30, :192, :295). This is inconsistent. A batch size of 0 doesn't make sense and could cause infinite loops. Consider changing the minimum to 1. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@shakaran Is necessary to support largely deprecated and unmaintained packages for the new 2.0 version? Doctrine introduced several BC, in Connection and QueryBuilder Doctrine < 3.6 Doctrine 2.x |
Features a plain DBAL adapter