Skip to content

Conversation

@jorgerobles
Copy link

Features a plain DBAL adapter

  • Optimized queries beyond object manager
  • Custom table and columns via configuration.

Copy link
Contributor

Copilot AI left a 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 RefreshTokenManager for DBAL with direct SQL queries and custom column mapping
  • Implemented automatic table creation via TableSchemaManager and EnsureTableExistsListener
  • 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.

@shakaran
Copy link
Collaborator

shakaran commented Dec 2, 2025

@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

@jorgerobles
Copy link
Author

@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.
ran locally with nektos/act but are stuck on some mongo errors, not related with current PR.

Copy link
Contributor

Copilot AI left a 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.

@shakaran
Copy link
Collaborator

shakaran commented Dec 3, 2025

@jorgerobles please fix all issues mentioned by copilot and dont commit .php-cs-fixer.cache

@jorgerobles jorgerobles force-pushed the dbal branch 2 times, most recently from 6b14cef to 4c1a4bc Compare December 3, 2025 19:21
@jorgerobles
Copy link
Author

@jorgerobles please fix all issues mentioned by copilot and dont commit .php-cs-fixer.cache

Done!

Copy link
Contributor

Copilot AI left a 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.

shakaran and others added 16 commits December 3, 2025 22:44
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>
@jorgerobles
Copy link
Author

@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
$connection->createSchemaManager())

Doctrine 2.x
$querybuilder->execute()->fetch(PDO::FETCH_ASSOC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants