Skip to content

Commit bb8aeac

Browse files
tvdijencicnavi
andauthored
SSP 2.5 compatibility (#333)
* Bump dependencies * Bump GH actions * Typed constants * Ignore ClassMustBeFinal * Ignore MissingOverrideAttribute * Remove unused mocks * Update docs * Run conformance tests on fork for now --------- Co-authored-by: Marko Ivančić <mivanci@srce.hr>
1 parent ac4a475 commit bb8aeac

34 files changed

Lines changed: 355 additions & 286 deletions

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: [ubuntu-latest]
2020

2121
steps:
22-
- uses: actions/checkout@v5
22+
- uses: actions/checkout@v6
2323

2424
- name: Lint markdown files
2525
uses: nosborn/github-action-markdown-cli@v3

.github/workflows/sonar.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
continue-on-error: true
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v6
1212
- name: SonarQube Scan
1313
uses: SonarSource/sonarqube-scan-action@v2
1414
env:
@@ -17,4 +17,4 @@ jobs:
1717
with:
1818
args: >
1919
-Dsonar.projectKey=${{ github.event.repository.name }}
20-
-Dsonar.projectName=${{ github.event.repository.name }}
20+
-Dsonar.projectName=${{ github.event.repository.name }}

.github/workflows/test.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-versions: ["8.2", "8.3"]
16+
php-versions: ["8.3", "8.4", "8.5"]
1717

1818
steps:
1919
- name: Setup PHP, with composer and extensions
@@ -35,14 +35,14 @@ jobs:
3535
git config --global core.autocrlf false
3636
git config --global core.eol lf
3737
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3939

4040
- name: Get composer cache directory
4141
id: composer-cache
4242
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
4343

4444
- name: Cache composer dependencies
45-
uses: actions/cache@v4
45+
uses: actions/cache@v5
4646
with:
4747
path: $COMPOSER_CACHE
4848
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
@@ -55,7 +55,7 @@ jobs:
5555
run: composer install --no-progress --prefer-dist --optimize-autoloader
5656

5757
- name: Decide whether to run code coverage or not
58-
if: ${{ matrix.php-versions != '8.2' }}
58+
if: ${{ matrix.php-versions != '8.5' }}
5959
run: |
6060
echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV
6161
@@ -70,13 +70,13 @@ jobs:
7070
./vendor/bin/phpunit $NO_COVERAGE --no-configuration -c phpunit.integration.xml
7171
7272
- name: Merge coverage data
73-
if: ${{ matrix.php-versions == '8.2' }}
73+
if: ${{ matrix.php-versions == '8.5' }}
7474
run: |
7575
./vendor/bin/phpunit-merger log build/logs/partial_junit/ build/logs/junit.xml
7676
./vendor/bin/phpunit-merger coverage build/logs/partial_clover/ build/logs/clover.xml
7777
7878
- name: Save coverage data
79-
if: ${{ matrix.php-versions == '8.2' }}
79+
if: ${{ matrix.php-versions == '8.5' }}
8080
uses: actions/upload-artifact@v4
8181
with:
8282
name: build-data
@@ -89,22 +89,22 @@ jobs:
8989
- name: Setup PHP, with composer and extensions
9090
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
9191
with:
92-
php-version: "8.2"
92+
php-version: "8.3"
9393
extensions: mbstring, xml
9494
tools: composer:v2
9595
coverage: none
9696

9797
- name: Setup problem matchers for PHP
9898
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
9999

100-
- uses: actions/checkout@v4
100+
- uses: actions/checkout@v6
101101

102102
- name: Get composer cache directory
103103
id: composer-cache
104104
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
105105

106106
- name: Cache composer dependencies
107-
uses: actions/cache@v4
107+
uses: actions/cache@v5
108108
with:
109109
path: $COMPOSER_CACHE
110110
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
@@ -130,22 +130,22 @@ jobs:
130130
- name: Setup PHP, with composer and extensions
131131
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
132132
with:
133-
php-version: "8.2"
133+
php-version: "8.3"
134134
extensions: mbstring, xml
135135
tools: composer:v2
136136
coverage: none
137137

138138
- name: Setup problem matchers for PHP
139139
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
140140

141-
- uses: actions/checkout@v4
141+
- uses: actions/checkout@v6
142142

143143
- name: Get composer cache directory
144144
id: composer-cache
145145
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
146146

147147
- name: Cache composer dependencies
148-
uses: actions/cache@v4
148+
uses: actions/cache@v5
149149
with:
150150
path: $COMPOSER_CACHE
151151
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
@@ -163,21 +163,21 @@ jobs:
163163
- name: Setup PHP, with composer and extensions
164164
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
165165
with:
166-
php-version: "8.2"
166+
php-version: "8.5"
167167
tools: composer:v2
168168
extensions: mbstring, xml
169169

170170
- name: Setup problem matchers for PHP
171171
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
172172

173-
- uses: actions/checkout@v4
173+
- uses: actions/checkout@v6
174174

175175
- name: Get composer cache directory
176176
id: composer-cache
177177
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
178178

179179
- name: Cache composer dependencies
180-
uses: actions/cache@v4
180+
uses: actions/cache@v5
181181
with:
182182
path: $COMPOSER_CACHE
183183
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
@@ -211,12 +211,12 @@ jobs:
211211
strategy:
212212
fail-fast: false
213213
matrix:
214-
ssp-version: ["v2.3.7", "v2.4.4"]
214+
ssp-version: ["v2.5.0"]
215215
env:
216216
SUITE_BASE_URL: https://localhost.emobix.co.uk:8443
217217
VERSION: release-v5.1.35
218218
steps:
219-
- uses: actions/checkout@v4
219+
- uses: actions/checkout@v6
220220
with:
221221
path: main
222222
- name: Setup Python Dependencies

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.2",
20+
"php": "^8.3",
2121
"ext-curl": "*",
2222
"ext-json": "*",
2323
"ext-openssl": "*",
@@ -33,20 +33,18 @@
3333
"simplesamlphp/composer-module-installer": "^1.3",
3434
"simplesamlphp/openid": "~v0.1.1",
3535
"spomky-labs/base64url": "^2.0",
36-
"symfony/expression-language": "^6.3",
37-
"symfony/psr-http-message-bridge": "^7.1",
36+
"symfony/expression-language": "^7.4",
37+
"symfony/psr-http-message-bridge": "^7.4",
3838
"web-token/jwt-framework": "^3",
39-
"symfony/cache": "^6.4",
39+
"symfony/cache": "^7.4",
4040
"psr/simple-cache": "^3"
4141
},
4242
"require-dev": {
4343
"friendsofphp/php-cs-fixer": "^3",
44-
"phpunit/phpunit": "^10",
45-
"rector/rector": "^0.18.3",
46-
"simplesamlphp/simplesamlphp": "2.3.*",
47-
"simplesamlphp/simplesamlphp-test-framework": "^1.5",
48-
"squizlabs/php_codesniffer": "^3",
49-
"vimeo/psalm": "^5",
44+
"rector/rector": "^1.2.10",
45+
"simplesamlphp/simplesamlphp": "2.5.*",
46+
"simplesamlphp/simplesamlphp-test-framework": "^1.9.3",
47+
"vimeo/psalm": "^6.15.1",
5048
"testcontainers/testcontainers": "^0.2",
5149
"nimut/phpunit-merger": "^2.0"
5250
},
@@ -57,6 +55,7 @@
5755
"sort-packages": true,
5856
"allow-plugins": {
5957
"dealerdirect/phpcodesniffer-composer-installer": true,
58+
"php-http/discovery": true,
6059
"phpstan/extension-installer": true,
6160
"simplesamlphp/composer-module-installer": true,
6261
"simplesamlphp/composer-xmlprovider-installer": true

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG SSP_VERSION="v2.4.4"
2-
FROM cirrusid/simplesamlphp:${SSP_VERSION}
3-
#FROM cicnavi/simplesamlphp:${SSP_VERSION}
1+
ARG SSP_VERSION="v2.5.0"
2+
#FROM cirrusid/simplesamlphp:${SSP_VERSION}
3+
FROM cicnavi/simplesamlphp:${SSP_VERSION}
44

55
RUN apt-get update && apt-get --no-install-recommends install -y sqlite3
66
# Prepopulate the DB with items needed for testing

docs/1-oidc.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ OIDFed is implemented using the
3434

3535
Minor versions listed show which SimpleSAMLphp versions were used during
3636
module development. SimpleSAMLphp follows semantic versioning for its
37-
API since v2.0. For example, v5.\* of the OIDC module should work with
38-
any v2.\* of SimpleSAMLphp. PHP version requirements may differ.
39-
40-
| OIDC module | Tested SimpleSAMLphp | PHP | Note |
41-
|:------------|:---------------------|:------:|-------------|
42-
| v6.\* | v2.3.\*, v2.4.\* | \>=8.2 | Recommended |
43-
| v5.\* | v2.1.\* | \>=8.1 | |
44-
| v4.\* | v2.0.\* | \>=8.0 | |
45-
| v3.\* | v2.0.\* | \>=7.4 | |
46-
| v2.\* | v1.19.\* | \>=7.4 | |
37+
API since v2.0. PHP version requirements may differ.
38+
39+
| OIDC module | Tested SimpleSAMLphp | PHP |
40+
|:------------|:---------------------|:------:|
41+
| v6.4.\* | v2.5.\* | \>=8.3 |
42+
| v6.3.\* | v2.3.\*, v2.4.\* | \>=8.2 |
43+
| v5.\* | v2.1.\* | \>=8.1 |
44+
| v4.\* | v2.0.\* | \>=8.0 |
45+
| v3.\* | v2.0.\* | \>=7.4 |
46+
| v2.\* | v1.19.\* | \>=7.4 |
4747

4848
Upgrading? See the [upgrade guide](6-oidc-upgrade.md).
4949

docs/6-oidc-upgrade.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
This is an upgrade guide from versions 1 → 6. Review the changes and
44
apply those relevant to your deployment.
55

6+
## Version 6.3 to 6.4
7+
8+
This is a minor release in order to enable installation of the module with
9+
SimpleSAMLphp v2.5.*, which now requires at least PHP v8.3 and bumps a bunch
10+
of dependent Symfony packages to v7.4.
11+
612
## Version 5 to 6
713

814
New features:

psalm.xml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,33 @@
2323
</projectFiles>
2424

2525
<issueHandlers>
26-
<!-- Ignore UnresolvableInclude on CLI-scripts -->
27-
<UnresolvableInclude>
28-
<errorLevel type="suppress">
29-
<file name="tests/bootstrap.php" />
30-
</errorLevel>
31-
</UnresolvableInclude>
26+
<!-- Ignore InvalidClassConstantType -->
3227
<InvalidClassConstantType>
3328
<errorLevel type="suppress">
3429
<file name="src/Forms/Controls/CsrfProtection.php" />
3530
</errorLevel>
3631
</InvalidClassConstantType>
3732

33+
<!-- Ignore PossiblyFalseArgument -->
34+
<PossiblyFalseArgument>
35+
<errorLevel type="suppress">
36+
<file name="src/Server/Validators/BearerTokenValidator.php" />
37+
</errorLevel>
38+
</PossiblyFalseArgument>
39+
3840
<!-- Ignore errors related to unused classes, methods... -->
3941
<UnusedClass errorLevel="suppress" />
4042
<PossiblyUnusedMethod errorLevel="suppress" />
4143
<PossiblyUnusedReturnValue errorLevel="suppress" />
4244

4345
<!-- Ignore RiskyTruthyFalsyComparison -->
4446
<RiskyTruthyFalsyComparison errorLevel="suppress" />
47+
48+
<!-- Ignore ClassMustBeFinal -->
49+
<ClassMustBeFinal errorLevel="suppress" />
50+
51+
<!-- Ignore MissingOverrideAttribute -->
52+
<MissingOverrideAttribute errorLevel="suppress" />
4553
</issueHandlers>
4654
</psalm>
4755

src/Controllers/Federation/EntityStatementController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
class EntityStatementController
2929
{
30-
protected const KEY_OP_ENTITY_CONFIGURATION_STATEMENT = 'op_entity_configuration_statement';
31-
protected const KEY_RP_SUBORDINATE_ENTITY_STATEMENT = 'rp_subordinate_entity_statement';
30+
protected const string KEY_OP_ENTITY_CONFIGURATION_STATEMENT = 'op_entity_configuration_statement';
31+
protected const string KEY_RP_SUBORDINATE_ENTITY_STATEMENT = 'rp_subordinate_entity_statement';
3232

3333
/**
3434
* @throws \SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException

src/Entities/ClientEntity.php

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,31 @@ class ClientEntity implements ClientEntityInterface
2828
use EntityTrait;
2929
use ClientTrait;
3030

31-
public const KEY_ID = 'id';
32-
public const KEY_SECRET = 'secret';
33-
public const KEY_NAME = 'name';
34-
public const KEY_DESCRIPTION = 'description';
35-
public const KEY_AUTH_SOURCE = 'auth_source';
36-
public const KEY_REDIRECT_URI = 'redirect_uri';
37-
public const KEY_SCOPES = 'scopes';
38-
public const KEY_IS_ENABLED = 'is_enabled';
39-
public const KEY_IS_CONFIDENTIAL = 'is_confidential';
40-
public const KEY_OWNER = 'owner';
41-
public const KEY_POST_LOGOUT_REDIRECT_URI = 'post_logout_redirect_uri';
42-
public const KEY_BACKCHANNEL_LOGOUT_URI = 'backchannel_logout_uri';
43-
public const KEY_ENTITY_IDENTIFIER = 'entity_identifier';
44-
public const KEY_CLIENT_REGISTRATION_TYPES = 'client_registration_types';
45-
public const KEY_FEDERATION_JWKS = 'federation_jwks';
46-
public const KEY_JWKS = 'jwks';
47-
public const KEY_JWKS_URI = 'jwks_uri';
48-
public const KEY_SIGNED_JWKS_URI = 'signed_jwks_uri';
49-
public const KEY_REGISTRATION_TYPE = 'registration_type';
50-
public const KEY_UPDATED_AT = 'updated_at';
51-
public const KEY_CREATED_AT = 'created_at';
52-
public const KEY_EXPIRES_AT = 'expires_at';
53-
public const KEY_IS_FEDERATED = 'is_federated';
31+
32+
public const string KEY_ID = 'id';
33+
public const string KEY_SECRET = 'secret';
34+
public const string KEY_NAME = 'name';
35+
public const string KEY_DESCRIPTION = 'description';
36+
public const string KEY_AUTH_SOURCE = 'auth_source';
37+
public const string KEY_REDIRECT_URI = 'redirect_uri';
38+
public const string KEY_SCOPES = 'scopes';
39+
public const string KEY_IS_ENABLED = 'is_enabled';
40+
public const string KEY_IS_CONFIDENTIAL = 'is_confidential';
41+
public const string KEY_OWNER = 'owner';
42+
public const string KEY_POST_LOGOUT_REDIRECT_URI = 'post_logout_redirect_uri';
43+
public const string KEY_BACKCHANNEL_LOGOUT_URI = 'backchannel_logout_uri';
44+
public const string KEY_ENTITY_IDENTIFIER = 'entity_identifier';
45+
public const string KEY_CLIENT_REGISTRATION_TYPES = 'client_registration_types';
46+
public const string KEY_FEDERATION_JWKS = 'federation_jwks';
47+
public const string KEY_JWKS = 'jwks';
48+
public const string KEY_JWKS_URI = 'jwks_uri';
49+
public const string KEY_SIGNED_JWKS_URI = 'signed_jwks_uri';
50+
public const string KEY_REGISTRATION_TYPE = 'registration_type';
51+
public const string KEY_UPDATED_AT = 'updated_at';
52+
public const string KEY_CREATED_AT = 'created_at';
53+
public const string KEY_EXPIRES_AT = 'expires_at';
54+
public const string KEY_IS_FEDERATED = 'is_federated';
55+
5456

5557
private string $secret;
5658

0 commit comments

Comments
 (0)