Skip to content

Drop support for NC 28+29, requires PHP >= 8.1, update deps, add rector #950

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

Merged
merged 7 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
21f740715b4acea791cf14958bd1076230990e32
# Update to coding-standard 1.3.2
5a42da490862ec9f0a7eef5702fc4a669d5c53b1
# Introducing rector
4f58f1154a933711f823be65bb4d2bd4e92d0794
47 changes: 6 additions & 41 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,64 +41,29 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: [ "8.0", "8.1", "8.2", "8.3", "8.4" ]
php-versions: [ "8.1", "8.2", "8.3", "8.4" ]
databases: [ "mysql" ]
server-versions: [ "stable28", "stable29", "stable30", "stable31", "master" ]
server-versions: [ "stable30", "stable31", "master" ]
exclude:
- server-versions: "master"
php-versions: "8.0"
databases: "mysql"
- server-versions: "master"
php-versions: "8.2"
databases: "mysql"
- server-versions: "stable31"
php-versions: "8.2"
databases: "mysql"
- server-versions: "stable31"
php-versions: "8.1"
databases: "mysql"
- server-versions: "stable31"
php-versions: "8.0"
databases: "mysql"
- server-versions: "stable30"
php-versions: "8.2"
databases: "mysql"
- server-versions: "stable30"
php-versions: "8.1"
databases: "mysql"
- server-versions: "stable30"
php-versions: "8.0"
databases: "mysql"
- server-versions: "stable29"
php-versions: "8.2"
databases: "mysql"
- server-versions: "stable29"
php-versions: "8.1"
databases: "mysql"
- server-versions: "stable28"
php-versions: "8.1"
databases: "mysql"
- server-versions: "stable28"
php-versions: "8.4"
databases: "mysql"
- server-versions: "stable29"
php-versions: "8.4"
databases: "mysql"
- server-versions: "stable30"
php-versions: "8.4"
databases: "mysql"
include:
- server-versions: "stable28"
php-versions: "8.2"
- server-versions: "stable30"
php-versions: "8.3"
databases: "sqlite"
- server-versions: "stable28"
php-versions: "8.2"
- server-versions: "stable30"
php-versions: "8.3"
databases: "pgsql"

name: Integration php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

#container: ubuntu

services:
postgres:
image: postgres:14
Expand Down
81 changes: 81 additions & 0 deletions .patches/php-saml-600.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
SPDX-FileCopyrightText: 2024 Nextcloud GmbH
SPDX-License-Identifier: MIT
From 3628572e9916f747a450484c35c51a5164b00c54 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@arthur-schiwon.de>
Date: Fri, 8 Nov 2024 18:05:46 +0100
Subject: [PATCH] Include PHP 8.4 test coverage

- also fixes deprecations on implicit null

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
---
.github/workflows/php-package.yml | 6 +++---
src/Saml2/Auth.php | 2 +-
src/Saml2/Settings.php | 2 +-
src/Saml2/Utils.php | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/php-package.yml b/.github/workflows/php-package.yml
index 7840700a..6321b7ef 100644
--- a/.github/workflows/php-package.yml
+++ b/.github/workflows/php-package.yml
@@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
- php-versions: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
+ php-versions: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
steps:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
@@ -46,9 +46,9 @@ jobs:
php vendor/bin/phploc src/.
mkdir -p tests/build/dependences
php vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg src/.
-
+
- name: PHP Code Sniffer
run: php vendor/bin/phpcs --standard=tests/ZendModStandard src/Saml2 demo1 demo2 endpoints tests/src
-
+
- name: Run unit tests
run: vendor/bin/phpunit --verbose --debug
diff --git a/src/Saml2/Auth.php b/src/Saml2/Auth.php
index 35037031..a860b358 100644
--- a/src/Saml2/Auth.php
+++ b/src/Saml2/Auth.php
@@ -171,7 +171,7 @@ class Auth
* @throws Exception
* @throws Error
*/
- public function __construct(array $settings = null, bool $spValidationOnly = false)
+ public function __construct(?array $settings = null, bool $spValidationOnly = false)
{
$this->_settings = new Settings($settings, $spValidationOnly);
}
diff --git a/src/Saml2/Settings.php b/src/Saml2/Settings.php
index 0ca095a9..c750608e 100644
--- a/src/Saml2/Settings.php
+++ b/src/Saml2/Settings.php
@@ -120,7 +120,7 @@ class Settings
* @throws Error If any settings parameter is invalid
* @throws Exception If Settings is incorrectly supplied
*/
- public function __construct(array $settings = null,bool $spValidationOnly = false)
+ public function __construct(?array $settings = null,bool $spValidationOnly = false)
{
$this->_spValidationOnly = $spValidationOnly;
$this->_loadPaths();
diff --git a/src/Saml2/Utils.php b/src/Saml2/Utils.php
index eea057ff..5742a063 100644
--- a/src/Saml2/Utils.php
+++ b/src/Saml2/Utils.php
@@ -954,7 +954,7 @@ public static function getExpireTime($cacheDuration = null, $validUntil = null)
*
* @return DOMNodeList The queried nodes
*/
- public static function query(DOMDocument $dom, $query, DOMElement $context = null)
+ public static function query(DOMDocument $dom, $query, ?DOMElement $context = null)
{
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('samlp', Constants::NS_SAMLP);
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ appstore: clean
--exclude=.github \
--exclude=.gitignore \
--exclude=.git-blame-ignore-revs \
--exclude=.patches \
--exclude=.php-cs-fixer.dist.php \
--exclude=.scrutinizer.yml \
--exclude=.travis.yml \
Expand All @@ -45,10 +46,12 @@ appstore: clean
--exclude=/Makefile \
--exclude=/psalm.xml \
--exclude=/README.md \
--exclude=/rector.php \
--exclude=/screenshots \
--exclude=/tests \
--exclude=/translationfiles \
--exclude=/vendor/cweagens \
--exclude=/vendor/cweagans \
--exclude=/vendor-bin \
$(project_dir)/ $(sign_dir)/$(app_name)
tar -czf $(build_dir)/$(app_name).tar.gz \
-C $(sign_dir) $(app_name)
Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following providers are supported and tested at the moment:
* Any other provider that authenticates using the environment variable

While theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.]]></description>
<version>6.6.0</version>
<version>7.0.0</version>
<licence>agpl</licence>
<author>Lukas Reschke</author>
<namespace>User_SAML</namespace>
Expand All @@ -37,7 +37,7 @@ While theoretically any other authentication provider implementing either one of
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
<dependencies>
<nextcloud min-version="28" max-version="32" />
<nextcloud min-version="30" max-version="32" />
</dependencies>
<repair-steps>
<post-migration>
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"optimize-autoloader": true,
"classmap-authoritative": true,
"platform": {
"php": "8.0.2"
"php": "8.1.32"
},
"allow-plugins": {
"cweagans/composer-patches": true,
Expand All @@ -14,7 +14,7 @@
"extra": {
"patches": {
"onelogin/php-saml": {
"PHP 8.4 compatibility": "https://patch-diff.githubusercontent.com/raw/SAML-Toolkits/php-saml/pull/600.patch"
"PHP 8.4 compatibility": ".patches/php-saml-600.patch"
}
},
"bamarni-bin": {
Expand All @@ -35,15 +35,17 @@
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
"lint": "find . -name \\*.php -not -path '*/vendor/*' -print0 | xargs -0 -n1 php -l",
"rector:check": "rector --dry-run",
"rector:fix": "rector",
"test:unit": "phpunit -c tests/unit/phpunit.xml"
},
"require-dev": {
"phpunit/phpunit": "^9",
"phpunit/phpunit": "^9.6",
"bamarni/composer-bin-plugin": "^1.8"
},
"require": {
"onelogin/php-saml": "^4.2",
"firebase/php-jwt": "^6.10",
"firebase/php-jwt": "^6.11",
"cweagans/composer-patches": "^1.7"
}
}
Loading
Loading