Skip to content

Commit c5651c0

Browse files
authored
Merge pull request #1968 from hwi/stloyd-patch-1
2 parents f1e6f17 + ea065cd commit c5651c0

File tree

7 files changed

+57
-22
lines changed

7 files changed

+57
-22
lines changed

.github/workflows/ci.yaml

+15-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
68

9+
# See https://stackoverflow.com/a/72408109
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
714
jobs:
815
php-cs-fixer:
916
runs-on: ubuntu-latest
10-
timeout-minutes: 10
17+
timeout-minutes: 5
1118
env:
1219
PHP_CS_FIXER_FUTURE_MODE: '1'
1320
steps:
@@ -29,7 +36,7 @@ jobs:
2936

3037
phpstan:
3138
runs-on: ubuntu-latest
32-
timeout-minutes: 20
39+
timeout-minutes: 5
3340
steps:
3441
- name: Checkout
3542
uses: actions/checkout@v3
@@ -53,7 +60,7 @@ jobs:
5360
phpunit:
5461
name: PHPUnit (PHP ${{ matrix.php }} + ${{ matrix.symfony-version }})
5562
runs-on: ubuntu-latest
56-
timeout-minutes: 20
63+
timeout-minutes: 10
5764
strategy:
5865
matrix:
5966
include:
@@ -64,14 +71,16 @@ jobs:
6471
bc: true
6572
- php: '8.0'
6673
symfony-version: '^5.4'
67-
- php: '8.1'
68-
symfony-version: '^5.4'
6974
- php: '8.1'
7075
symfony-version: '^6.3'
7176
- php: '8.2'
7277
symfony-version: '^6.3'
78+
- php: '8.2'
79+
symfony-version: '^7.0'
7380
- php: '8.3'
7481
symfony-version: '^6.3'
82+
- php: '8.3'
83+
symfony-version: '^7.0'
7584
fail-fast: false
7685

7786
steps:
@@ -108,7 +117,7 @@ jobs:
108117
109118
- name: Upload test artifacts
110119
if: always()
111-
uses: actions/upload-artifact@v1
120+
uses: actions/upload-artifact@v3
112121
with:
113122
name: phpunit-logs-php${{ matrix.php }}
114123
path: build/logs/phpunit

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Changelog
22
=========
3+
## 2.1.0 (2023-11-30)
4+
* BC Break: Dropped support for Symfony: `>6.0, <6.3`,
5+
* Added: New Passage resource owner,
6+
* Bugfix: Remove deprecations reported by Symfony 6.4,
7+
* Chore: Added support for Symfony 7,
8+
39
## 2.0.0 (2023-10-01)
410
* Bugfix: Prevent refreshing non-expired tokens
511
* Bugfix: Remove deprecations reported by Symfony 6.x

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Installation
1212

1313
All the installation instructions are located in the documentation, check it for a specific version:
1414

15-
* [__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`),
15+
* [__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`),
1616

1717
* [__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`),
1818

@@ -22,7 +22,7 @@ Documentation
2222
The bulk of the documentation is stored in the `Resources/doc/index.md`
2323
file in this bundle. Read the documentation for version:
2424

25-
* [__2.0__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/index.md)
25+
* [__2.x__](https://github.com/hwi/HWIOAuthBundle/blob/master/docs/index.md)
2626
* [__1.4__](https://github.com/hwi/HWIOAuthBundle/blob/1.4/Resources/doc/index.md) (unsupported)
2727

2828
This bundle contains support for 58 different providers:

composer.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,25 @@
9595
"require": {
9696
"php": "^7.4 || ^8.0",
9797
"symfony/deprecation-contracts": "^2.5 || ^3.0",
98-
"symfony/framework-bundle": "^5.4 || ^6.1",
99-
"symfony/security-bundle": "^5.4 || ^6.1",
100-
"symfony/options-resolver": "^5.4 || ^6.1",
101-
"symfony/form": "^5.4 || ^6.1",
102-
"symfony/http-client": "^5.4 || ^6.1"
98+
"symfony/framework-bundle": "^5.4 || ^6.3 || ^7.0",
99+
"symfony/security-bundle": "^5.4 || ^6.3 || ^7.0",
100+
"symfony/options-resolver": "^5.4 || ^6.3 || ^7.0",
101+
"symfony/form": "^5.4 || ^6.3 || ^7.0",
102+
"symfony/http-client": "^5.4 || ^6.3 || ^7.0"
103103
},
104104

105105
"require-dev": {
106106
"doctrine/doctrine-bundle": "^2.4",
107107
"doctrine/orm": "^2.9",
108-
"symfony/browser-kit": "^5.4 || ^6.1",
109-
"symfony/css-selector": "^5.4 || ^6.1",
110-
"symfony/phpunit-bridge": "^5.4 || ^6.1",
111-
"symfony/property-access": "^5.4 || ^6.1",
112-
"symfony/validator": "^5.4 || ^6.1",
113-
"symfony/twig-bundle": "^5.4 || ^6.1",
114-
"symfony/stopwatch": "^5.4 || ^6.1",
115-
"symfony/translation": "^5.4 || ^6.1",
116-
"symfony/yaml": "^5.4 || ^6.1",
108+
"symfony/browser-kit": "^5.4 || ^6.3 || ^7.0",
109+
"symfony/css-selector": "^5.4 || ^6.3 || ^7.0",
110+
"symfony/phpunit-bridge": "^5.4 || ^6.3 || ^7.0",
111+
"symfony/property-access": "^5.4 || ^6.3 || ^7.0",
112+
"symfony/validator": "^5.4 || ^6.3 || ^7.0",
113+
"symfony/twig-bundle": "^5.4 || ^6.3 || ^7.0",
114+
"symfony/stopwatch": "^5.4 || ^6.3 || ^7.0",
115+
"symfony/translation": "^5.4 || ^6.3 || ^7.0",
116+
"symfony/yaml": "^5.4 || ^6.3 || ^7.0",
117117
"phpunit/phpunit": "^9.6.11",
118118
"friendsofphp/php-cs-fixer": "^3.23",
119119
"symfony/monolog-bundle": "^3.4",

tests/App/config/config_v6.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ framework:
1010
csrf_protection: ~
1111
session:
1212
handler_id: 'session.handler.native'
13+
cookie_secure: auto
14+
cookie_samesite: lax
1315
http_method_override: false
16+
handle_all_throwables: true
17+
php_errors:
18+
log: false
1419

1520
monolog:
1621
handlers:
@@ -57,6 +62,7 @@ doctrine:
5762
orm:
5863
auto_generate_proxy_classes: '%kernel.debug%'
5964
auto_mapping: true
65+
enable_lazy_ghost_objects: true
6066

6167
hwi_oauth:
6268
connect:

tests/Controller/LoginControllerTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2727
use Symfony\Component\Security\Core\Security as DeprecatedSecurity;
2828
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
29+
use Symfony\Component\Security\Http\SecurityRequestAttributes;
2930
use Twig\Environment;
3031

3132
final class LoginControllerTest extends TestCase
@@ -211,6 +212,12 @@ private function createController(): LoginController
211212

212213
private function getSecurityErrorKey(): string
213214
{
215+
// Symfony 6.4+ compatibility
216+
if (class_exists(SecurityRequestAttributes::class)) {
217+
return SecurityRequestAttributes::AUTHENTICATION_ERROR;
218+
}
219+
220+
// Symfony 5.4 & <6.4 compatibility
214221
return class_exists(Security::class) ? Security::AUTHENTICATION_ERROR : DeprecatedSecurity::AUTHENTICATION_ERROR;
215222
}
216223
}

tests/Functional/Controller/LoginControllerTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\HttpClient\MockHttpClient;
2121
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
2222
use Symfony\Component\Security\Core\Security as DeprecatedSecurity;
23+
use Symfony\Component\Security\Http\SecurityRequestAttributes;
2324
use Symfony\Contracts\HttpClient\HttpClientInterface;
2425

2526
final class LoginControllerTest extends WebTestCase
@@ -84,6 +85,12 @@ public function testLoginPageWithError(): void
8485

8586
private function getSecurityErrorKey(): string
8687
{
88+
// Symfony 6.4+ compatibility
89+
if (class_exists(SecurityRequestAttributes::class)) {
90+
return SecurityRequestAttributes::AUTHENTICATION_ERROR;
91+
}
92+
93+
// Symfony 5.4 & <6.4 compatibility
8794
return class_exists(Security::class) ? Security::AUTHENTICATION_ERROR : DeprecatedSecurity::AUTHENTICATION_ERROR;
8895
}
8996
}

0 commit comments

Comments
 (0)