Skip to content

Commit c4e0c10

Browse files
committed
Merge branch 'release/4.0.0'
2 parents 52c8455 + 25224c1 commit c4e0c10

24 files changed

Lines changed: 203 additions & 147 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
tags:
4+
- '*.*.*'
5+
6+
name: Create Github Release
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
create-release:
13+
runs-on: ubuntu-latest
14+
env:
15+
COMPOSER_ALLOW_SUPERUSER: 1
16+
APP_ENV: prod
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Create a release in GitHub
22+
run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes
23+
env:
24+
GITHUB_TOKEN: ${{ github.TOKEN }}
25+
shell: bash

.github/workflows/pr.yaml

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: Test & Code Style Review
33
jobs:
44

55
test-composer-install:
6-
name: Validate composer (${{ matrix.php}}) / (${{ matrix.dependency-version}})
6+
name: Validate composer (${{ matrix.php}}) / (${{ matrix.prefer}})
77
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php: [ '8.1', '8.2' ]
12-
dependency-version: [ prefer-lowest, prefer-stable ]
11+
php: [ '8.3', '8.4' ]
12+
prefer: [ prefer-lowest, prefer-stable ]
1313
steps:
14-
- uses: actions/checkout@master
14+
- uses: actions/checkout@v4
1515

1616
- name: Setup PHP, with composer and extensions
1717
uses: shivammathur/setup-php@v2
@@ -21,32 +21,34 @@ jobs:
2121

2222
- name: Get composer cache directory
2323
id: composer-cache
24-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
24+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2525

2626
- name: Cache dependencies
27-
uses: actions/cache@v2
27+
uses: actions/cache@v4
2828
with:
2929
path: ${{ steps.composer-cache.outputs.dir }}
30-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-version }}-
31-
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
30+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
31+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-
3232

3333
- name: Validate composer files
3434
run: composer validate composer.json --strict
3535

3636
- name: Install dependencies
3737
run: |
38-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
38+
composer update --${{ matrix.prefer }} --prefer-dist --no-interaction
3939
4040
unit-tests:
41-
name: Unit tests (${{ matrix.php}}) / (${{ matrix.dependency-version}})
41+
name: Unit tests (${{ matrix.php}}) / (${{ matrix.prefer}})
4242
runs-on: ubuntu-latest
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
php: [ '8.1', '8.2' ]
47-
dependency-version: [ prefer-lowest, prefer-stable ]
46+
php: [ '8.3', '8.4' ]
47+
prefer: [ prefer-lowest, prefer-stable ]
4848
steps:
49-
- uses: actions/checkout@master
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 2
5052

5153
- name: Setup PHP, with composer and extensions
5254
uses: shivammathur/setup-php@v2
@@ -56,24 +58,24 @@ jobs:
5658

5759
- name: Get composer cache directory
5860
id: composer-cache
59-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
61+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6062

6163
- name: Cache dependencies
62-
uses: actions/cache@v2
64+
uses: actions/cache@v4
6365
with:
6466
path: ${{ steps.composer-cache.outputs.dir }}
65-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-version }}-
66-
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
67+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
68+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-
6769

6870
- name: Install dependencies
6971
run: |
70-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
72+
composer update --${{ matrix.prefer }} --prefer-dist --no-interaction
7173
7274
- name: Unit tests
7375
run: ./vendor/bin/phpunit --coverage-clover=coverage/unit.xml
7476

7577
- name: Upload coverage to Codecov
76-
uses: codecov/codecov-action@v3
78+
uses: codecov/codecov-action@v5
7779
with:
7880
token: ${{ secrets.CODECOV_TOKEN }}
7981
files: ./coverage/unit.xml
@@ -82,69 +84,83 @@ jobs:
8284
flags: unittests
8385

8486
phpcsfixer:
87+
name: Coding style (${{ matrix.php }})
8588
runs-on: ubuntu-latest
8689
strategy:
8790
fail-fast: false
8891
matrix:
89-
php: [ '8.1' ]
90-
name: Coding style (${{ matrix.php }})
92+
php: [ '8.3' ]
93+
prefer: [ prefer-stable ]
9194
steps:
92-
- uses: actions/checkout@master
95+
- uses: actions/checkout@v4
9396

9497
- name: Setup PHP, with composer and extensions
9598
uses: shivammathur/setup-php@v2
9699
with:
97100
php-version: ${{ matrix.php}}
98-
extensions: ctype, iconv, imagick, json, redis, soap, xmlreader, zip
99101
coverage: none
102+
tools: cs2pr, phpcs
100103

101104
- name: Get composer cache directory
102105
id: composer-cache
103-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
106+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
104107

105108
- name: Cache dependencies
106-
uses: actions/cache@v2
109+
uses: actions/cache@v4
107110
with:
108111
path: ${{ steps.composer-cache.outputs.dir }}
109-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-version }}-
110-
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
112+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
113+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-
111114

112-
- name: Install Dependencies
113-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
114-
115-
- name: PHP CS Fixer
116-
run: composer coding-standards-check
115+
- name: Install dependencies
116+
run: composer update --prefer-stable --prefer-dist --no-interaction
117117

118-
psalm:
118+
phpstan:
119+
name: PHPStan (${{ matrix.php }})
119120
runs-on: ubuntu-latest
120121
strategy:
121122
fail-fast: false
122123
matrix:
123-
php: [ '8.1' ]
124-
name: Psalm static analysis (${{ matrix.php}})
124+
php: [ '8.3' ]
125+
prefer: [ prefer-stable ]
125126
steps:
126-
- uses: actions/checkout@master
127+
- uses: actions/checkout@v4
127128

128129
- name: Setup PHP, with composer and extensions
129130
uses: shivammathur/setup-php@v2
130131
with:
131132
php-version: ${{ matrix.php}}
132-
extensions: ctype, iconv, imagick, json, redis, soap, xmlreader, zip
133133
coverage: none
134+
tools: cs2pr, phpcs
134135

135136
- name: Get composer cache directory
136137
id: composer-cache
137-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
138+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
138139

139140
- name: Cache dependencies
140-
uses: actions/cache@v2
141+
uses: actions/cache@v4
141142
with:
142143
path: ${{ steps.composer-cache.outputs.dir }}
143-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-version }}-
144-
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependency-version }}-
144+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
145+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-
146+
147+
- name: Install dependencies
148+
run: composer update --prefer-stable --prefer-dist --no-interaction
149+
150+
- name: Run PHPStan
151+
run: ./vendor/bin/phpstan
152+
153+
changelog:
154+
runs-on: ubuntu-latest
155+
name: Changelog should be updated
156+
steps:
157+
- name: Checkout
158+
uses: actions/checkout@v4
159+
with:
160+
fetch-depth: 2
145161

146-
- name: Install Dependencies
147-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
162+
- name: Git fetch
163+
run: git fetch
148164

149-
- name: Psalm
150-
run: ./vendor/bin/psalm
165+
- name: Check that changelog has been updated.
166+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ build
1616
var
1717
.phpcs-cache
1818
.php-cs-fixer.cache
19+
.phpunit.cache

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
77

8-
## [Unreleased]
8+
## [4.0.0] - 2025-01-13
9+
- Remove support for PHP 8.1 and 8.2 (BC)
10+
- Remove support for Symfony versions lower than 6.4 (BC)
11+
- Bump dependency requirements
912

1013
## [3.1.0] - 2023-08-03
1114

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010

1111
Symfony bundle for authorization via OpenID Connect.
1212

13+
## Note: Symfony Native OIDC Support
14+
15+
Since theis bundle was created Symfony has added [support for OpenID Connect](https://symfony.com/blog/new-in-symfony-6-3-openid-connect-token-handler)
16+
as documented in ["Using OpenID Connect (OIDC)"](https://symfony.com/doc/current/security/access_token.html#using-openid-connect-oidc)
17+
18+
As of Symfony 7.2 (jan. 2025) it seems this still a work in progress:
19+
* [OIDC discovery](https://github.com/symfony/symfony/pull/54932) is not yet implemented making config a bit cumbersome.
20+
* It's not obvious how to implement support for multiple providers, although it may be possible using [Multiple Authenticators](https://symfony.com/doc/current/security/entry_point.html#multiple-authenticators-with-separate-entry-points)
21+
22+
Until these issues are resolved this bundle cannot be fully replaced by the native features.
23+
24+
1325
## Installation
1426

1527
To install run

composer.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^8.1",
17+
"php": "^8.3",
1818
"ext-json": "*",
1919
"ext-openssl": "*",
20-
"doctrine/orm": "^2.8",
21-
"itk-dev/openid-connect": "^3.1",
22-
"symfony/cache": "^5.4|^6.0",
23-
"symfony/framework-bundle": "^5.4|^6.0",
24-
"symfony/security-bundle": "^5.4|^6.0",
25-
"symfony/uid": "^5.4|^6.0",
26-
"symfony/yaml": "^5.4|^6.0"
20+
"doctrine/orm": "^2.8|3.0",
21+
"itk-dev/openid-connect": "^4.0",
22+
"symfony/cache": "^6.4|^7.0",
23+
"symfony/framework-bundle": "^6.4.13|^7.0",
24+
"symfony/security-bundle": "^6.4.13|^7.0",
25+
"symfony/uid": "^6.4|^7.0",
26+
"symfony/yaml": "^6.4|^7.0"
2727
},
2828
"require-dev": {
2929
"ergebnis/composer-normalize": "^2.28",
3030
"escapestudios/symfony2-coding-standard": "^3.12",
3131
"friendsofphp/php-cs-fixer": "^3.11",
3232
"kubawerlos/php-cs-fixer-custom-fixers": "^3.11",
33-
"phpunit/phpunit": "^9.5",
34-
"psalm/plugin-symfony": "^5.0",
35-
"rector/rector": "^0.14.2",
36-
"vimeo/psalm": "^5.0"
33+
"phpstan/phpstan": "^2.1",
34+
"phpunit/phpunit": "^11.0",
35+
"rector/rector": "^2.0",
36+
"symfony/runtime": "^6.4.13|^7.0"
3737
},
3838
"autoload": {
3939
"psr-4": {
@@ -47,7 +47,8 @@
4747
},
4848
"config": {
4949
"allow-plugins": {
50-
"ergebnis/composer-normalize": true
50+
"ergebnis/composer-normalize": true,
51+
"symfony/runtime": true
5152
},
5253
"sort-packages": true
5354
},
@@ -58,6 +59,6 @@
5859
"coding-standards-check": [
5960
"./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle"
6061
],
61-
"test": "./vendor/bin/phpunit"
62+
"test": "XDEBUG_MODE=coverage ./vendor/bin/phpunit"
6263
}
6364
}

docker-compose.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# itk-version: 1.0.0
2-
3-
version: "3"
1+
# itk-version: 3.2.1
42

53
services:
64
phpfpm:
7-
image: itkdev/php8.1-fpm:latest
5+
image: itkdev/php8.3-fpm:latest
86
environment:
9-
- XDEBUG_MODE=${XDEBUG_MODE:-off}
10-
- XDEBUG_SESSION=${XDEBUG_SESSION:-0}
11-
- COMPOSER_VERSION=2
7+
- PHP_XDEBUG_MODE=${PHP_XDEBUG_MODE:-off}
8+
- PHP_MAX_EXECUTION_TIME=30
9+
- PHP_MEMORY_LIMIT=256M
10+
# Depending on the setup, you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
11+
- PHP_SENDMAIL_PATH=/usr/bin/msmtp --host=mail --port=1025 --read-recipients --read-envelope-from
1212
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
13+
- COMPOSER_VERSION=2
1314
- PHP_IDE_CONFIG=serverName=localhost
1415
volumes:
15-
- .:/app:delegated
16+
- .:/app

phpstan.neon

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src
5+
ignoreErrors:
6+
-
7+
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#'
8+
identifier: method.notFound
9+
path: src/DependencyInjection/Configuration.php
10+
-
11+
message: '#^Method ItkDev\\OpenIdConnectBundle\\Security\\OpenIdConfigurationProviderManager\:\:__construct\(\) has parameter \$config with no value type specified in iterable type array\.$#'
12+
identifier: missingType.iterableValue
13+
path: src/Security/OpenIdConfigurationProviderManager.php
14+
-
15+
message: '#^Method ItkDev\\OpenIdConnectBundle\\Security\\OpenIdConfigurationProviderManager\:\:getProviderKeys\(\) should return array\<string\> but returns list\<int\|string\>\.$#'
16+
identifier: return.type
17+
path: src/Security/OpenIdConfigurationProviderManager.php
18+
-
19+
message: '#^Method ItkDev\\OpenIdConnectBundle\\Command\\UserLoginCommand\:\:__construct\(\) has parameter \$userProvider with generic interface Symfony\\Component\\Security\\Core\\User\\UserProviderInterface but does not specify its types\: TUser$#'
20+
identifier: missingType.generics
21+
path: src/Command/UserLoginCommand.php

phpunit.xml.dist

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<coverage>
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
74
<report>
85
<clover outputFile="build/logs/clover.xml"/>
96
<html outputDirectory="build/coverage"/>
@@ -18,4 +15,9 @@
1815
<logging>
1916
<junit outputFile="build/report.junit.xml"/>
2017
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src/</directory>
21+
</include>
22+
</source>
2123
</phpunit>

0 commit comments

Comments
 (0)