diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee436d978..1d2d723a4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,12 +2,19 @@ name: CI on: push: + branches: + - master pull_request: +# See https://stackoverflow.com/a/72408109 +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: php-cs-fixer: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 env: PHP_CS_FIXER_FUTURE_MODE: '1' steps: @@ -29,7 +36,7 @@ jobs: phpstan: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@v3 @@ -53,7 +60,7 @@ jobs: phpunit: name: PHPUnit (PHP ${{ matrix.php }} + ${{ matrix.symfony-version }}) runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 10 strategy: matrix: include: @@ -64,14 +71,16 @@ jobs: bc: true - php: '8.0' symfony-version: '^5.4' - - php: '8.1' - symfony-version: '^5.4' - php: '8.1' symfony-version: '^6.3' - php: '8.2' symfony-version: '^6.3' + - php: '8.2' + symfony-version: '^7.0' - php: '8.3' symfony-version: '^6.3' + - php: '8.3' + symfony-version: '^7.0' fail-fast: false steps: @@ -108,7 +117,7 @@ jobs: - name: Upload test artifacts if: always() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: phpunit-logs-php${{ matrix.php }} path: build/logs/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index 5421c60de..0c7557ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ Changelog ========= +## 2.1.0 (2023-11-30) +* BC Break: Dropped support for Symfony: `>6.0, <6.3`, +* Added: New Passage resource owner, +* Bugfix: Remove deprecations reported by Symfony 6.4, +* Chore: Added support for Symfony 7, + ## 2.0.0 (2023-10-01) * Bugfix: Prevent refreshing non-expired tokens * Bugfix: Remove deprecations reported by Symfony 6.x diff --git a/README.md b/README.md index 8fb68ff71..67552d536 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Installation All the installation instructions are located in the documentation, check it for a specific version: -* [__2.0__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/1-setting_up_the_bundle.md) (current) - with support for Symfony: `^5.4` & `^6.1` (PHP: `^7.4`, `^8.0`), +* [__2.x__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/1-setting_up_the_bundle.md) (current) - with support for Symfony: `^5.4`, `^6.3` & `^7.0` (PHP: `^7.4`, `^8.0`), * [__1.4__](https://github.com/hwi/HWIOAuthBundle/blob/1.4/Resources/doc/1-setting_up_the_bundle.md) (unsupported) - with support for Symfony: `^4.4` & `^5.1` (PHP: `^7.3` & `^8.0`), @@ -22,7 +22,7 @@ Documentation The bulk of the documentation is stored in the `Resources/doc/index.md` file in this bundle. Read the documentation for version: -* [__2.0__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/index.md) +* [__2.x__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/index.md) * [__1.4__](https://github.com/hwi/HWIOAuthBundle/blob/1.4/Resources/doc/index.md) (unsupported) This bundle contains support for 58 different providers: diff --git a/composer.json b/composer.json index 23b8d0a50..88902edce 100644 --- a/composer.json +++ b/composer.json @@ -95,25 +95,25 @@ "require": { "php": "^7.4 || ^8.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", - "symfony/framework-bundle": "^5.4 || ^6.1", - "symfony/security-bundle": "^5.4 || ^6.1", - "symfony/options-resolver": "^5.4 || ^6.1", - "symfony/form": "^5.4 || ^6.1", - "symfony/http-client": "^5.4 || ^6.1" + "symfony/framework-bundle": "^5.4 || ^6.3 || ^7.0", + "symfony/security-bundle": "^5.4 || ^6.3 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.3 || ^7.0", + "symfony/form": "^5.4 || ^6.3 || ^7.0", + "symfony/http-client": "^5.4 || ^6.3 || ^7.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.4", "doctrine/orm": "^2.9", - "symfony/browser-kit": "^5.4 || ^6.1", - "symfony/css-selector": "^5.4 || ^6.1", - "symfony/phpunit-bridge": "^5.4 || ^6.1", - "symfony/property-access": "^5.4 || ^6.1", - "symfony/validator": "^5.4 || ^6.1", - "symfony/twig-bundle": "^5.4 || ^6.1", - "symfony/stopwatch": "^5.4 || ^6.1", - "symfony/translation": "^5.4 || ^6.1", - "symfony/yaml": "^5.4 || ^6.1", + "symfony/browser-kit": "^5.4 || ^6.3 || ^7.0", + "symfony/css-selector": "^5.4 || ^6.3 || ^7.0", + "symfony/phpunit-bridge": "^5.4 || ^6.3 || ^7.0", + "symfony/property-access": "^5.4 || ^6.3 || ^7.0", + "symfony/validator": "^5.4 || ^6.3 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.3 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.3 || ^7.0", + "symfony/translation": "^5.4 || ^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.3 || ^7.0", "phpunit/phpunit": "^9.6.11", "friendsofphp/php-cs-fixer": "^3.23", "symfony/monolog-bundle": "^3.4", diff --git a/tests/App/config/config_v6.yaml b/tests/App/config/config_v6.yaml index 14d31dace..1929c7a3a 100644 --- a/tests/App/config/config_v6.yaml +++ b/tests/App/config/config_v6.yaml @@ -10,7 +10,12 @@ framework: csrf_protection: ~ session: handler_id: 'session.handler.native' + cookie_secure: auto + cookie_samesite: lax http_method_override: false + handle_all_throwables: true + php_errors: + log: false monolog: handlers: @@ -57,6 +62,7 @@ doctrine: orm: auto_generate_proxy_classes: '%kernel.debug%' auto_mapping: true + enable_lazy_ghost_objects: true hwi_oauth: connect: diff --git a/tests/Controller/LoginControllerTest.php b/tests/Controller/LoginControllerTest.php index 082ea1dbe..232c4beb9 100644 --- a/tests/Controller/LoginControllerTest.php +++ b/tests/Controller/LoginControllerTest.php @@ -26,6 +26,7 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Security as DeprecatedSecurity; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; +use Symfony\Component\Security\Http\SecurityRequestAttributes; use Twig\Environment; final class LoginControllerTest extends TestCase @@ -211,6 +212,12 @@ private function createController(): LoginController private function getSecurityErrorKey(): string { + // Symfony 6.4+ compatibility + if (class_exists(SecurityRequestAttributes::class)) { + return SecurityRequestAttributes::AUTHENTICATION_ERROR; + } + + // Symfony 5.4 & <6.4 compatibility return class_exists(Security::class) ? Security::AUTHENTICATION_ERROR : DeprecatedSecurity::AUTHENTICATION_ERROR; } } diff --git a/tests/Functional/Controller/LoginControllerTest.php b/tests/Functional/Controller/LoginControllerTest.php index 577d85694..ff0bf90c9 100644 --- a/tests/Functional/Controller/LoginControllerTest.php +++ b/tests/Functional/Controller/LoginControllerTest.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\Security\Core\Exception\UserNotFoundException; use Symfony\Component\Security\Core\Security as DeprecatedSecurity; +use Symfony\Component\Security\Http\SecurityRequestAttributes; use Symfony\Contracts\HttpClient\HttpClientInterface; final class LoginControllerTest extends WebTestCase @@ -84,6 +85,12 @@ public function testLoginPageWithError(): void private function getSecurityErrorKey(): string { + // Symfony 6.4+ compatibility + if (class_exists(SecurityRequestAttributes::class)) { + return SecurityRequestAttributes::AUTHENTICATION_ERROR; + } + + // Symfony 5.4 & <6.4 compatibility return class_exists(Security::class) ? Security::AUTHENTICATION_ERROR : DeprecatedSecurity::AUTHENTICATION_ERROR; } }