-
Notifications
You must be signed in to change notification settings - Fork 4
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
[FEATURE] TYPO3 v11 and v12 compatibility #9
base: master
Are you sure you want to change the base?
Conversation
TYPO3 11 compatibility
Fatal error: During inheritance of JsonSerializable: Uncaught TYPO3\CMS\Core\Error\Exception: PHP Deprecation Notice: Return type of FGTCLB\OAuth2Server\Domain\Entity\Scope::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/public/typo3conf/ext/oauth2_server/Classes/Domain/Entity/Scope.php line 16 in /var/www/html/vendor/helhum/typo3-console/Classes/Console/Error/ErrorHandler.php:88
Class serialization is not allowed anymore: TYPO3/typo3@733353c#diff-1d396fe456cb8cc5db6a383afa0925cdd834074fa83d38a4f71b770410fa2a95R229
This also changes the repository to use the client entity itself where possible. The entity instances are created using a factory method, which will in the future ease changes in the table's schema.
@andreaswolf Will you guys ever merge this and future PRs as well or is this project cold? |
This will definitely be merged, I just did not get to test it yet. If anyone can confirm that this actually works in the current state, I'm happy to merge this PR. And of course help for v12 is always welcome, so thanks for the offer @bresam :) |
In favour of TYPO3 Core Build and Testing the file phpstan.neon is removed. Instead the file inside Build/phpstan is used for running locally and in pipelines
Run commands `composer --dev remove nimut/testing-framework` `composer --dev require typo3/testing-framework:^7.0`
Changed UnitTestCase from nimut to TYPO3 Core Testing Framework
removed multi-line compose commands
command: `composer req --dev friendsofphp/php-cs-fixer:^v3.52`
command: `Build/Scripts/runTests.sh -s cgl`
command: `composer req --dev phpspec/prophecy-phpunit:^v2.2`
* Add Code and Message expectation * Add associative array keys to data provider * rename test cases for clearer test states
a74a179
to
aaa0ee6
Compare
* adds successful login redirect test with logged-in user * adds login redirect to login page if no logged-in user
As the ResourceServer needs absolute file path to key files, Configuration class returns now the system internal correct file path. Unit Test expected the values from LocalConfiguration "as is", which now is no longer given. In this case, we only check, if the values are given to configuration and handled correct
Use a DataProvider for recurring test cases
Adds basic test for generating a Bearer Token from oauth2_server
Adds basic test for generating a Bearer Token from oauth2_server
Add tests for failing auth with access_token
For a clearer handling with more possibilities, the ResourceServer handling needs to be improved. * Add ResourceHandlerInterface * Add AbstractResourceHandler * Add DefaultResourceHandler with 501 Not implemented response * Add CompilerPass for ResourceHandlerPass to implement tagged handlers * Rework Middleware handling with the handler and return a Response
The current implementation has hard-coded OAuth endpoints. With this commit endpoints for authorization, token generation and refreshing and resource handling are made dynamic via Extension configuration. Additionally, the lifetimes of tokens and authCode are made dynamic with fallback to the previous defined default.
I'm working with high speed, getting this ext v11 compatible. As I changed some behaviour according to the Resource Server handling, I'll also write documentation. |
In preparation for TYPO3 v12 and phpunit v10 support, dataProviders now are static to avoid deprecation warning with phpunit 10
* Add github action for v12 testing * change signatures for phpstan
Adds Functional test for refreshing token and moves test preparation requests to AbstractOauth2ServerTestCase
ResourceServer handles with identity returns. Rename the handlers to IdentityHandler
Generated auth tokens named like a given var in method. Fixed
I built upon the other two MRs and did some more lifting:
I have, however, not tested this in any way, so it might break or eat your cat or whatever. Need to setup a local test instance w/ the required data later on.