diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4ddd3dba57..c28aa94f82 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -18,9 +18,9 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.5', '8.6'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@release-2.x secrets: inherit with: php-version: ${{ matrix.php-version }} @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@release-2.x secrets: inherit with: enable_eslinter: true @@ -46,7 +46,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5', '8.6'] steps: - name: Setup PHP, with composer and extensions @@ -123,7 +123,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5', '8.6'] steps: - name: Setup PHP, with composer and extensions @@ -261,7 +261,7 @@ jobs: # https://github.com/shivammathur/setup-php uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.5' extensions: mbstring, soap, xml tools: composer:v2 coverage: none diff --git a/.gitignore b/.gitignore index 7264898ed0..a0f01b031b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,16 @@ metadata/* !/public/assets/.gitkeep /public/assets/* .phplint.cache/ +!/public/assets/admin/ +!/public/assets/core/ +!/public/assets/cron/ +!/public/assets/debugsp/ +!/public/assets/exampleauth/ +!/public/assets/admin/** +!/public/assets/core/** +!/public/assets/cron/** +!/public/assets/debugsp/** +!/public/assets/exampleauth/** .phpunit.cache/ .phpunit.result.cache phpunit.xml.bak diff --git a/bin/console b/bin/console index 74816335eb..e7224a24b7 100755 --- a/bin/console +++ b/bin/console @@ -5,16 +5,13 @@ declare(strict_types=1); use SimpleSAML\Console\Application; use SimpleSAML\Kernel; -use Symfony\Component\Console\Input\ArgvInput; umask(000); set_time_limit(0); require __DIR__.'/../vendor/autoload.php'; -$input = new ArgvInput(); -$module = $input->getParameterOption(['--module', '-m'], 'core'); -$kernel = new Kernel($module); +$kernel = new Kernel(); $application = new Application($kernel); -$application->run($input); +$application->run(); diff --git a/composer.json b/composer.json index ac13910409..c18409e825 100644 --- a/composer.json +++ b/composer.json @@ -46,10 +46,9 @@ "files": ["tests/_autoload_modules.php"] }, "require": { - "php": "^8.3", + "php": "^8.5", "ext-date": "*", "ext-dom": "*", - "ext-fileinfo": "*", "ext-filter": "*", "ext-hash": "*", "ext-json": "*", @@ -62,6 +61,7 @@ "ext-SPL": "*", "ext-zlib": "*", + "beste/clock": "~3.0", "composer-runtime-api": "^2.2", "gettext/gettext": "~5.7", "gettext/php-scanner": "^2.0", @@ -70,13 +70,12 @@ "psr/event-dispatcher": "~1.0", "psr/log": "~3.0", "robrichards/xmlseclibs": "^3.1.5", - "simplesamlphp/assert": "~2.0", - "simplesamlphp/composer-module-installer": "~1.7", - "simplesamlphp/saml2": "~6.1", - "simplesamlphp/saml2-legacy": "~4.20", - "simplesamlphp/simplesamlphp-assets-base": "~2.5.0", - "simplesamlphp/xml-common": "~2.7", - "simplesamlphp/xml-security": "~2.3", + "simplesamlphp/assert": "~3.0", + "simplesamlphp/composer-module-installer": "~2.0", + "simplesamlphp/saml2": "7.0.x-dev", + "simplesamlphp/simplesamlphp-assets-base": "~3.0.0", + "simplesamlphp/xml-common": "~3.0", + "simplesamlphp/xml-security": "~3.1", "symfony/cache": "~7.4", "symfony/config": "~7.4", "symfony/console": "~7.4", @@ -108,7 +107,7 @@ "mikey179/vfsstream": "~1.6", "predis/predis": "~3.3", - "simplesamlphp/simplesamlphp-test-framework": "~1.11.6 || dev-master" + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "suggest": { "predis/predis": "Needed if a Redis server is used to store session information", @@ -143,6 +142,7 @@ } }, "scripts": { + "assets:publish": "./bin/console assets:publish", "translations:unused": "./bin/translations translations:unused", "translations:update:translatable": "./bin/translations translations:update:translatable", "clear-symfony-cache": [ @@ -154,7 +154,14 @@ ], "post-install-cmd": [ "echo 'Post-install tasks completed!'" + ], + "pre-commit": [ + "vendor/bin/phpcbf -pn", + "vendor/bin/phpcs -p", + "vendor/bin/phpstan analyze -c phpstan.neon --memory-limit=1024M", + "vendor/bin/phpstan analyze -c phpstan-dev.neon --memory-limit=1024M", + "vendor/bin/phpunit" ] }, - "version": "v2.5.3.1" + "version": "v3.0.0" } diff --git a/composer.lock b/composer.lock index db40dae628..61b20729f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,68 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96e4e6cda80e262961daf642e19dc726", + "content-hash": "c0da9184d3625f8934cdfe60f7d8db97", "packages": [ + { + "name": "beste/clock", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/beste/clock.git", + "reference": "9818902960afc11d258c6d8a369e4a34aa6f9817" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beste/clock/zipball/9818902960afc11d258c6d8a369e4a34aa6f9817", + "reference": "9818902960afc11d258c6d8a369e4a34aa6f9817", + "shasum": "" + }, + "require": { + "php": "^8.0", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.1", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6.20" + }, + "type": "library", + "autoload": { + "files": [ + "src/Clock.php" + ], + "psr-4": { + "Beste\\Clock\\": "src/Clock" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jérôme Gamez", + "email": "jerome@gamez.name" + } + ], + "description": "A collection of Clock implementations", + "keywords": [ + "clock", + "clock-interface", + "psr-20", + "psr20" + ], + "support": { + "issues": "https://github.com/beste/clock/issues", + "source": "https://github.com/beste/clock/tree/3.1.0" + }, + "time": "2026-08-22T21:09:57+00:00" + }, { "name": "gettext/gettext", "version": "v5.7.3", @@ -288,125 +348,6 @@ ], "time": "2026-06-18T22:49:04+00:00" }, - { - "name": "guzzlehttp/psr7", - "version": "2.13.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "adee536f95101929f262b8c59e8a61472f347d58" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/adee536f95101929f262b8c59e8a61472f347d58", - "reference": "adee536f95101929f262b8c59e8a61472f347d58", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0", - "symfony/deprecation-contracts": "^2.5 || ^3.0", - "symfony/polyfill-php80": "^1.25" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "1.1.0", - "jshttp/mime-db": "1.54.0.1", - "phpunit/phpunit": "^8.5.52 || ^9.6.34" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.13.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2026-10-17T23:49:46+00:00" - }, { "name": "nikic/php-parser", "version": "v5.9.0", @@ -824,6 +765,58 @@ }, "time": "2019-01-08T18:20:26+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, { "name": "psr/http-factory", "version": "1.1.0", @@ -982,50 +975,6 @@ }, "time": "2024-09-11T13:17:53+00:00" }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, { "name": "robrichards/xmlseclibs", "version": "3.1.5", @@ -1070,16 +1019,16 @@ }, { "name": "simplesamlphp/assert", - "version": "v2.0.2", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/simplesamlphp/assert.git", - "reference": "9e08dc5525a2259d75e6f6d0ae6754a7b4c13470" + "reference": "33dcdeac629fa84a049f63738c30ecebdcb53061" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/assert/zipball/9e08dc5525a2259d75e6f6d0ae6754a7b4c13470", - "reference": "9e08dc5525a2259d75e6f6d0ae6754a7b4c13470", + "url": "https://api.github.com/repos/simplesamlphp/assert/zipball/33dcdeac629fa84a049f63738c30ecebdcb53061", + "reference": "33dcdeac629fa84a049f63738c30ecebdcb53061", "shasum": "" }, "require": { @@ -1087,18 +1036,19 @@ "ext-filter": "*", "ext-pcre": "*", "ext-spl": "*", - "guzzlehttp/psr7": "~2.8", - "php": "^8.3", + "ext-uri": "*", + "php": "^8.5", "webmozart/assert": "~2.1" }, "require-dev": { "ext-intl": "*", - "simplesamlphp/simplesamlphp-test-framework": "~1.11" + "phpunit/phpunit": "^13.3", + "simplesamlphp/simplesamlphp-test-framework": "~2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "v1.10.x-dev" + "dev-master": "v3.0.x-dev" } }, "autoload": { @@ -1123,39 +1073,39 @@ "description": "A wrapper around webmozart/assert to make it useful beyond checking method arguments", "support": { "issues": "https://github.com/simplesamlphp/assert/issues", - "source": "https://github.com/simplesamlphp/assert/tree/v2.0.2" + "source": "https://github.com/simplesamlphp/assert/tree/v3.0.5" }, - "time": "2026-03-06T18:04:32+00:00" + "time": "2026-08-21T23:30:40+00:00" }, { "name": "simplesamlphp/composer-module-installer", - "version": "v1.7.1", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/composer-module-installer.git", - "reference": "348f02344e851655587474e389fe4234c9399404" + "reference": "99a53ef8971494ec79e64dd9892b12cf763e5162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/composer-module-installer/zipball/348f02344e851655587474e389fe4234c9399404", - "reference": "348f02344e851655587474e389fe4234c9399404", + "url": "https://api.github.com/repos/simplesamlphp/composer-module-installer/zipball/99a53ef8971494ec79e64dd9892b12cf763e5162", + "reference": "99a53ef8971494ec79e64dd9892b12cf763e5162", "shasum": "" }, "require": { "composer-plugin-api": "~2.9", "ext-mbstring": "*", - "php": "^8.3", - "simplesamlphp/assert": "~2.0" + "php": "^8.5", + "simplesamlphp/assert": "~3.0" }, "require-dev": { "composer/composer": "~2.9", - "simplesamlphp/simplesamlphp-test-framework": "~1.11" + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "type": "composer-plugin", "extra": { "class": "SimpleSAML\\Composer\\ModuleInstallerPlugin", "branch-alias": { - "dev-master": "1.8.0.x-dev" + "dev-master": "2.0.0.x-dev" } }, "autoload": { @@ -1170,9 +1120,9 @@ "description": "A Composer plugin that allows installing SimpleSAMLphp modules through Composer.", "support": { "issues": "https://github.com/simplesamlphp/composer-module-installer/issues", - "source": "https://github.com/simplesamlphp/composer-module-installer/tree/v1.7.1" + "source": "https://github.com/simplesamlphp/composer-module-installer/tree/v2.0.0" }, - "time": "2026-06-10T19:18:29+00:00" + "time": "2026-07-02T21:42:41+00:00" }, { "name": "simplesamlphp/composer-xmlprovider-installer", @@ -1221,50 +1171,50 @@ }, { "name": "simplesamlphp/saml2", - "version": "v6.2.4", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/simplesamlphp/saml2.git", - "reference": "9a21edb96de1f3ece3b40ccbe3b7de761917a06f" + "reference": "be1b708ae19141cb6e1e911658150cc868ff1221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/9a21edb96de1f3ece3b40ccbe3b7de761917a06f", - "reference": "9a21edb96de1f3ece3b40ccbe3b7de761917a06f", + "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/be1b708ae19141cb6e1e911658150cc868ff1221", + "reference": "be1b708ae19141cb6e1e911658150cc868ff1221", "shasum": "" }, "require": { "ext-date": "*", "ext-dom": "*", - "ext-filter": "*", "ext-openssl": "*", "ext-pcre": "*", "ext-zlib": "*", "nyholm/psr7": "~1.8", - "php": "^8.3", + "php": "^8.5", "psr/clock": "~1.0", "psr/http-message": "~2.0", "psr/log": "~3.0", - "simplesamlphp/assert": "~2.0", - "simplesamlphp/xml-common": "~2.8", - "simplesamlphp/xml-security": "~2.3", - "simplesamlphp/xml-soap": "~2.3" + "simplesamlphp/assert": "~3.0", + "simplesamlphp/xml-common": "~3.0", + "simplesamlphp/xml-security": "~3.1", + "simplesamlphp/xml-soap": "^3.0" }, "require-dev": { "beste/clock": "~3.0", "ext-intl": "*", - "icanhazstring/composer-unused": "^0.9.6", "mockery/mockery": "~1.6", - "simplesamlphp/simplesamlphp": "^2.5", - "simplesamlphp/simplesamlphp-test-framework": "~1.11" + "phpunit/phpunit": "^13.3", + "simplesamlphp/simplesamlphp": "dev-simplesamlphp-3.0", + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "suggest": { "ext-soap": "*" }, + "default-branch": true, "type": "simplesamlphp-xmlprovider", "extra": { "branch-alias": { - "dev-master": "v6.1.x-dev" + "dev-master": "v7.0.x-dev" } }, "autoload": { @@ -1293,85 +1243,27 @@ "description": "SAML2 PHP library from SimpleSAMLphp", "support": { "issues": "https://github.com/simplesamlphp/saml2/issues", - "source": "https://github.com/simplesamlphp/saml2/tree/v6.2.4" - }, - "time": "2026-08-09T18:33:13+00:00" - }, - { - "name": "simplesamlphp/saml2-legacy", - "version": "v4.20.3", - "source": { - "type": "git", - "url": "https://github.com/simplesamlphp/saml2-legacy.git", - "reference": "b43d5d10ea1180f478ddcd677ff13bb324cfa866" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2-legacy/zipball/b43d5d10ea1180f478ddcd677ff13bb324cfa866", - "reference": "b43d5d10ea1180f478ddcd677ff13bb324cfa866", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-openssl": "*", - "ext-zlib": "*", - "php": "^8.3", - "psr/log": "^2.0 || ^3.0", - "robrichards/xmlseclibs": "^3.1.5", - "simplesamlphp/xml-common": "^2.7", - "webmozart/assert": "^2.0" - }, - "conflict": { - "robrichards/xmlseclibs": "3.1.2" - }, - "require-dev": { - "mockery/mockery": "~1.6", - "simplesamlphp/simplesamlphp-test-framework": "~1.11" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "v4.20.x-dev" - } - }, - "autoload": { - "psr-4": { - "SAML2\\": "src/SAML2" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-or-later" - ], - "authors": [ - { - "name": "Andreas Åkre Solberg", - "email": "andreas.solberg@uninett.no" - } - ], - "description": "SAML2 PHP library from SimpleSAMLphp", - "support": { - "source": "https://github.com/simplesamlphp/saml2-legacy/tree/v4.20.3" + "source": "https://github.com/simplesamlphp/saml2/tree/master" }, - "time": "2026-05-25T16:06:14+00:00" + "time": "2026-11-05T20:27:43+00:00" }, { "name": "simplesamlphp/simplesamlphp-assets-base", - "version": "v2.5.15", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/simplesamlphp-assets-base.git", - "reference": "6c65cfe90415e2922a9a2ace2bbb72761525fa35" + "reference": "064606a7e6bdae76d6adb7e351a2020adbe28bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-assets-base/zipball/6c65cfe90415e2922a9a2ace2bbb72761525fa35", - "reference": "6c65cfe90415e2922a9a2ace2bbb72761525fa35", + "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-assets-base/zipball/064606a7e6bdae76d6adb7e351a2020adbe28bed", + "reference": "064606a7e6bdae76d6adb7e351a2020adbe28bed", "shasum": "" }, "require": { - "php": "^8.3", - "simplesamlphp/composer-module-installer": "~1.7" + "php": "^8.5", + "simplesamlphp/composer-module-installer": "~2.0" }, "type": "simplesamlphp-module", "notification-url": "https://packagist.org/downloads/", @@ -1387,22 +1279,22 @@ "description": "Assets for the SimpleSAMLphp main repository", "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-assets-base/issues", - "source": "https://github.com/simplesamlphp/simplesamlphp-assets-base/tree/v2.5.15" + "source": "https://github.com/simplesamlphp/simplesamlphp-assets-base/tree/v3.0.0" }, - "time": "2026-05-31T03:32:51+00:00" + "time": "2026-07-13T20:23:56+00:00" }, { "name": "simplesamlphp/xml-common", - "version": "v2.8.2", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/simplesamlphp/xml-common.git", - "reference": "c9b66277ac7fb89187fcb500c144bb01d5d18676" + "reference": "c50b33dfc4384c772e921c6072bded9b67081c03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/xml-common/zipball/c9b66277ac7fb89187fcb500c144bb01d5d18676", - "reference": "c9b66277ac7fb89187fcb500c144bb01d5d18676", + "url": "https://api.github.com/repos/simplesamlphp/xml-common/zipball/c50b33dfc4384c772e921c6072bded9b67081c03", + "reference": "c50b33dfc4384c772e921c6072bded9b67081c03", "shasum": "" }, "require": { @@ -1413,19 +1305,19 @@ "ext-libxml": "*", "ext-pcre": "*", "ext-spl": "*", - "guzzlehttp/psr7": "~2.8", - "php": "^8.3", + "ext-uri": "*", + "php": "^8.5", "psr/clock": "~1.0", - "simplesamlphp/assert": "~2.0", + "simplesamlphp/assert": "~3.0", "simplesamlphp/composer-xmlprovider-installer": "~1.3" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.11.5" + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "type": "simplesamlphp-xmlprovider", "extra": { "branch-alias": { - "dev-master": "v2.7.x-dev" + "dev-master": "v3.0.x-dev" } }, "autoload": { @@ -1461,37 +1353,47 @@ "issues": "https://github.com/simplesamlphp/xml-common/issues", "source": "https://github.com/simplesamlphp/xml-common" }, - "time": "2026-07-30T21:44:47+00:00" + "time": "2026-08-17T20:51:59+00:00" }, { "name": "simplesamlphp/xml-security", - "version": "v2.3.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/xml-security.git", - "reference": "ded07df15a53ee87a179e8bff79870ffea31e716" + "reference": "1ccb48dfb58f560d3e443016257b271c4f5124a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/xml-security/zipball/ded07df15a53ee87a179e8bff79870ffea31e716", - "reference": "ded07df15a53ee87a179e8bff79870ffea31e716", + "url": "https://api.github.com/repos/simplesamlphp/xml-security/zipball/1ccb48dfb58f560d3e443016257b271c4f5124a6", + "reference": "1ccb48dfb58f560d3e443016257b271c4f5124a6", "shasum": "" }, "require": { "ext-dom": "*", + "ext-filter": "*", "ext-hash": "*", "ext-mbstring": "*", "ext-openssl": "*", "ext-pcre": "*", "ext-spl": "*", - "php": "^8.3", - "simplesamlphp/assert": "~2.0", - "simplesamlphp/xml-common": "~2.7" + "php": "^8.5", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "simplesamlphp/assert": "~3.0", + "simplesamlphp/xml-common": "~3.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.11" + "phpunit/phpunit": "^13.3", + "psr/http-message": "^1.0|^2.0", + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "type": "simplesamlphp-xmlprovider", + "extra": { + "branch-alias": { + "dev-master": "v3.0.x-dev" + } + }, "autoload": { "psr-4": { "SimpleSAML\\XMLSecurity\\": "src/" @@ -1523,38 +1425,38 @@ ], "support": { "issues": "https://github.com/simplesamlphp/xml-security/issues", - "source": "https://github.com/simplesamlphp/xml-security/tree/v2.3.1" + "source": "https://github.com/simplesamlphp/xml-security/tree/v3.1.0" }, - "time": "2026-03-13T16:57:53+00:00" + "time": "2026-10-06T18:41:13+00:00" }, { "name": "simplesamlphp/xml-soap", - "version": "v2.3.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/xml-soap.git", - "reference": "014a0846d3b3a1a29f8d39c5bf75a827de216501" + "reference": "f16e5fb18beef8f9719c64a4252a9a1d4777d708" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/xml-soap/zipball/014a0846d3b3a1a29f8d39c5bf75a827de216501", - "reference": "014a0846d3b3a1a29f8d39c5bf75a827de216501", + "url": "https://api.github.com/repos/simplesamlphp/xml-soap/zipball/f16e5fb18beef8f9719c64a4252a9a1d4777d708", + "reference": "f16e5fb18beef8f9719c64a4252a9a1d4777d708", "shasum": "" }, "require": { "ext-dom": "*", "ext-pcre": "*", - "php": "^8.3", - "simplesamlphp/assert": "~2.0", - "simplesamlphp/xml-common": "~2.7" + "php": "^8.5", + "simplesamlphp/assert": "~3.0", + "simplesamlphp/xml-common": "~3.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.11" + "simplesamlphp/simplesamlphp-test-framework": "~2.0" }, "type": "simplesamlphp-xmlprovider", "extra": { "branch-alias": { - "dev-master": "v2.0.x-dev" + "dev-master": "v3.0.x-dev" } }, "autoload": { @@ -1576,22 +1478,22 @@ "description": "SimpleSAMLphp library for XML SOAP", "support": { "issues": "https://github.com/simplesamlphp/xml-soap/issues", - "source": "https://github.com/simplesamlphp/xml-soap/tree/v2.3.0" + "source": "https://github.com/simplesamlphp/xml-soap/tree/v3.0.0" }, - "time": "2026-02-17T20:22:50+00:00" + "time": "2026-07-13T19:20:45+00:00" }, { "name": "symfony/cache", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "314a079754e9eef4c6ffe2a3b12b0ea7c6c7381a" + "reference": "bbaa2ca4a93a94532285bdd5a0caf225d34ff578" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/314a079754e9eef4c6ffe2a3b12b0ea7c6c7381a", - "reference": "314a079754e9eef4c6ffe2a3b12b0ea7c6c7381a", + "url": "https://api.github.com/repos/symfony/cache/zipball/bbaa2ca4a93a94532285bdd5a0caf225d34ff578", + "reference": "bbaa2ca4a93a94532285bdd5a0caf225d34ff578", "shasum": "" }, "require": { @@ -1661,7 +1563,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.4.21" + "source": "https://github.com/symfony/cache/tree/v7.4.23" }, "funding": [ { @@ -1681,20 +1583,20 @@ "type": "tidelift" } ], - "time": "2026-10-12T13:05:23+00:00" + "time": "2026-11-01T22:26:51+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.7.1", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "9789738bc19af1106dc54d6afba9a0b467516cf2" + "reference": "af26a91232085b7edd4e04be62f75e7c25159ece" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/9789738bc19af1106dc54d6afba9a0b467516cf2", - "reference": "9789738bc19af1106dc54d6afba9a0b467516cf2", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/af26a91232085b7edd4e04be62f75e7c25159ece", + "reference": "af26a91232085b7edd4e04be62f75e7c25159ece", "shasum": "" }, "require": { @@ -1708,7 +1610,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -1741,7 +1643,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/cache-contracts/tree/v3.8.1" }, "funding": [ { @@ -1761,20 +1663,20 @@ "type": "tidelift" } ], - "time": "2026-06-05T06:23:12+00:00" + "time": "2026-09-26T07:05:14+00:00" }, { "name": "symfony/config", - "version": "v7.4.17", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "696e12da8eea497a1a3808d714b43ff67a7df43e" + "reference": "8ef666abf731e85e59cf478929dda6c7cb2fa9c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/696e12da8eea497a1a3808d714b43ff67a7df43e", - "reference": "696e12da8eea497a1a3808d714b43ff67a7df43e", + "url": "https://api.github.com/repos/symfony/config/zipball/8ef666abf731e85e59cf478929dda6c7cb2fa9c4", + "reference": "8ef666abf731e85e59cf478929dda6c7cb2fa9c4", "shasum": "" }, "require": { @@ -1820,7 +1722,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v7.4.17" + "source": "https://github.com/symfony/config/tree/v7.4.23" }, "funding": [ { @@ -1840,20 +1742,20 @@ "type": "tidelift" } ], - "time": "2026-08-20T09:55:18+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "symfony/console", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "21f1bc2296f7ff6043241a8dcbc09559b3732820" + "reference": "81957c2440c05c962fe8291f318de6e85f8db330" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/21f1bc2296f7ff6043241a8dcbc09559b3732820", - "reference": "21f1bc2296f7ff6043241a8dcbc09559b3732820", + "url": "https://api.github.com/repos/symfony/console/zipball/81957c2440c05c962fe8291f318de6e85f8db330", + "reference": "81957c2440c05c962fe8291f318de6e85f8db330", "shasum": "" }, "require": { @@ -1918,7 +1820,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.21" + "source": "https://github.com/symfony/console/tree/v7.4.23" }, "funding": [ { @@ -1938,20 +1840,20 @@ "type": "tidelift" } ], - "time": "2026-10-12T18:45:38+00:00" + "time": "2026-11-03T21:47:07+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "059334a6ef0eedfcabfec52fd0a71576d610a70c" + "reference": "4df0d83a8253d95b222c2f136b9dca3a1a9451a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/059334a6ef0eedfcabfec52fd0a71576d610a70c", - "reference": "059334a6ef0eedfcabfec52fd0a71576d610a70c", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4df0d83a8253d95b222c2f136b9dca3a1a9451a7", + "reference": "4df0d83a8253d95b222c2f136b9dca3a1a9451a7", "shasum": "" }, "require": { @@ -2002,7 +1904,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v7.4.21" + "source": "https://github.com/symfony/dependency-injection/tree/v7.4.23" }, "funding": [ { @@ -2022,20 +1924,20 @@ "type": "tidelift" } ], - "time": "2026-10-13T12:53:30+00:00" + "time": "2026-11-01T17:38:00+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.7.1", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" + "reference": "feb1edf4e546af3b85c5caebe8359a20db230ca3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", - "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/feb1edf4e546af3b85c5caebe8359a20db230ca3", + "reference": "feb1edf4e546af3b85c5caebe8359a20db230ca3", "shasum": "" }, "require": { @@ -2048,7 +1950,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -2073,7 +1975,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.8.1" }, "funding": [ { @@ -2093,37 +1995,36 @@ "type": "tidelift" } ], - "time": "2026-06-05T06:23:12+00:00" + "time": "2026-09-16T14:15:10+00:00" }, { "name": "symfony/error-handler", - "version": "v7.4.20", + "version": "v8.1.10", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0" + "reference": "84c6d73f990ae22dbd45625c056d7ff99ca6810d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", - "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/84c6d73f990ae22dbd45625c056d7ff99ca6810d", + "reference": "84c6d73f990ae22dbd45625c056d7ff99ca6810d", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", "psr/log": "^1|^2|^3", "symfony/polyfill-php85": "^1.32", - "symfony/var-dumper": "^6.4|^7.0|^8.0" + "symfony/var-dumper": "^7.4|^8.0" }, "conflict": { - "symfony/deprecation-contracts": "<2.5", - "symfony/http-kernel": "<6.4" + "symfony/deprecation-contracts": "<2.5" }, "require-dev": { - "symfony/console": "^6.4|^7.0|^8.0", + "symfony/console": "^7.4|^8.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", "symfony/webpack-encore-bundle": "^1.0|^2.0" }, "bin": [ @@ -2155,7 +2056,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.20" + "source": "https://github.com/symfony/error-handler/tree/v8.1.10" }, "funding": [ { @@ -2175,7 +2076,7 @@ "type": "tidelift" } ], - "time": "2026-09-22T18:56:40+00:00" + "time": "2026-10-25T14:40:25+00:00" }, { "name": "symfony/event-dispatcher", @@ -2264,16 +2165,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.7.1", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" + "reference": "658e29751424da3ef4758c60f769e59d1b2981eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", - "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/658e29751424da3ef4758c60f769e59d1b2981eb", + "reference": "658e29751424da3ef4758c60f769e59d1b2981eb", "shasum": "" }, "require": { @@ -2287,7 +2188,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -2320,7 +2221,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.8.1" }, "funding": [ { @@ -2340,7 +2241,7 @@ "type": "tidelift" } ], - "time": "2026-06-05T06:23:12+00:00" + "time": "2026-09-16T14:15:10+00:00" }, { "name": "symfony/expression-language", @@ -2412,16 +2313,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "fd0e3462be6d32a0d130e8423e4940a7688162d8" + "reference": "53d609da66578dad5a39fe290e8f924ec8f05e93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd0e3462be6d32a0d130e8423e4940a7688162d8", - "reference": "fd0e3462be6d32a0d130e8423e4940a7688162d8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/53d609da66578dad5a39fe290e8f924ec8f05e93", + "reference": "53d609da66578dad5a39fe290e8f924ec8f05e93", "shasum": "" }, "require": { @@ -2458,7 +2359,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.4.21" + "source": "https://github.com/symfony/filesystem/tree/v7.4.23" }, "funding": [ { @@ -2478,20 +2379,20 @@ "type": "tidelift" } ], - "time": "2026-10-06T20:05:19+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "symfony/finder", - "version": "v7.4.20", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e" + "reference": "c723f990aefe8c1053b18374faf4231eba84f518" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", - "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", + "url": "https://api.github.com/repos/symfony/finder/zipball/c723f990aefe8c1053b18374faf4231eba84f518", + "reference": "c723f990aefe8c1053b18374faf4231eba84f518", "shasum": "" }, "require": { @@ -2526,7 +2427,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.20" + "source": "https://github.com/symfony/finder/tree/v7.4.23" }, "funding": [ { @@ -2546,20 +2447,20 @@ "type": "tidelift" } ], - "time": "2026-09-26T06:31:10+00:00" + "time": "2026-11-02T10:56:49+00:00" }, { "name": "symfony/framework-bundle", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "62b38e9cb02c944e01030898b3d2b4f31722e47f" + "reference": "6a749f2c37cb9def53793633ec72958aaad4b359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/62b38e9cb02c944e01030898b3d2b4f31722e47f", - "reference": "62b38e9cb02c944e01030898b3d2b4f31722e47f", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/6a749f2c37cb9def53793633ec72958aaad4b359", + "reference": "6a749f2c37cb9def53793633ec72958aaad4b359", "shasum": "" }, "require": { @@ -2574,7 +2475,7 @@ "symfony/event-dispatcher": "^6.4|^7.0|^8.0", "symfony/filesystem": "^7.1|^8.0", "symfony/finder": "^6.4|^7.0|^8.0", - "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-foundation": "^7.4.23|^8.1.11", "symfony/http-kernel": "^7.4|^8.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php85": "^1.32", @@ -2683,7 +2584,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v7.4.21" + "source": "https://github.com/symfony/framework-bundle/tree/v7.4.23" }, "funding": [ { @@ -2703,20 +2604,20 @@ "type": "tidelift" } ], - "time": "2026-10-12T12:34:30+00:00" + "time": "2026-11-04T07:46:24+00:00" }, { "name": "symfony/http-client", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "121bf3a973bfd852db85ec32d0d64e9fbed4449b" + "reference": "ed012bfca0f7b45d97016efcdf9b0639c52a1722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/121bf3a973bfd852db85ec32d0d64e9fbed4449b", - "reference": "121bf3a973bfd852db85ec32d0d64e9fbed4449b", + "url": "https://api.github.com/repos/symfony/http-client/zipball/ed012bfca0f7b45d97016efcdf9b0639c52a1722", + "reference": "ed012bfca0f7b45d97016efcdf9b0639c52a1722", "shasum": "" }, "require": { @@ -2784,7 +2685,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.4.21" + "source": "https://github.com/symfony/http-client/tree/v7.4.23" }, "funding": [ { @@ -2804,20 +2705,20 @@ "type": "tidelift" } ], - "time": "2026-10-13T15:31:38+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.7.3", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "35be0019e2c2c9fba80f9dc033290a5240f7b44f" + "reference": "f9f94260f787446c6fd430b2ae1969fe41ae1ba8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/35be0019e2c2c9fba80f9dc033290a5240f7b44f", - "reference": "35be0019e2c2c9fba80f9dc033290a5240f7b44f", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/f9f94260f787446c6fd430b2ae1969fe41ae1ba8", + "reference": "f9f94260f787446c6fd430b2ae1969fe41ae1ba8", "shasum": "" }, "require": { @@ -2830,7 +2731,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -2866,7 +2767,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.7.3" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.8.1" }, "funding": [ { @@ -2886,20 +2787,20 @@ "type": "tidelift" } ], - "time": "2026-08-04T08:41:16+00:00" + "time": "2026-10-04T15:04:25+00:00" }, { "name": "symfony/http-foundation", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "58c89144c7a36dd89c3d01917e9fa3a72d8aaf31" + "reference": "7fb73cffa06e2bcc2cb523fcccb1e8174106b206" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/58c89144c7a36dd89c3d01917e9fa3a72d8aaf31", - "reference": "58c89144c7a36dd89c3d01917e9fa3a72d8aaf31", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7fb73cffa06e2bcc2cb523fcccb1e8174106b206", + "reference": "7fb73cffa06e2bcc2cb523fcccb1e8174106b206", "shasum": "" }, "require": { @@ -2948,7 +2849,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.21" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.23" }, "funding": [ { @@ -2968,20 +2869,20 @@ "type": "tidelift" } ], - "time": "2026-10-08T16:56:12+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "4779fce7dedacb8801b2b61c703ef99159502331" + "reference": "94c57f4c5c45a311d244a0aeadb72b14ee41d25d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4779fce7dedacb8801b2b61c703ef99159502331", - "reference": "4779fce7dedacb8801b2b61c703ef99159502331", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/94c57f4c5c45a311d244a0aeadb72b14ee41d25d", + "reference": "94c57f4c5c45a311d244a0aeadb72b14ee41d25d", "shasum": "" }, "require": { @@ -3067,7 +2968,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.21" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.23" }, "funding": [ { @@ -3087,20 +2988,20 @@ "type": "tidelift" } ], - "time": "2026-10-14T06:44:08+00:00" + "time": "2026-11-04T11:26:18+00:00" }, { "name": "symfony/intl", - "version": "v7.4.17", + "version": "v7.4.22", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "ebd1e30a84e79c4cb4ad0eacf88d5e3fef47ad1d" + "reference": "cbd18d56041c88d76b86fd22c2a88af974aba20f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/ebd1e30a84e79c4cb4ad0eacf88d5e3fef47ad1d", - "reference": "ebd1e30a84e79c4cb4ad0eacf88d5e3fef47ad1d", + "url": "https://api.github.com/repos/symfony/intl/zipball/cbd18d56041c88d76b86fd22c2a88af974aba20f", + "reference": "cbd18d56041c88d76b86fd22c2a88af974aba20f", "shasum": "" }, "require": { @@ -3157,7 +3058,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v7.4.17" + "source": "https://github.com/symfony/intl/tree/v7.4.22" }, "funding": [ { @@ -3177,7 +3078,7 @@ "type": "tidelift" } ], - "time": "2026-08-21T17:40:08+00:00" + "time": "2026-10-27T13:52:57+00:00" }, { "name": "symfony/password-hasher", @@ -3340,16 +3241,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.43.0", + "version": "v1.43.3", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "5cac8f4db97208823aa353f59a01faad2da52c75" + "reference": "5a8f33c87aeecffce24e721b5064fab05f4becf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5cac8f4db97208823aa353f59a01faad2da52c75", - "reference": "5cac8f4db97208823aa353f59a01faad2da52c75", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5a8f33c87aeecffce24e721b5064fab05f4becf8", + "reference": "5a8f33c87aeecffce24e721b5064fab05f4becf8", "shasum": "" }, "require": { @@ -3398,7 +3299,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.3" }, "funding": [ { @@ -3418,20 +3319,20 @@ "type": "tidelift" } ], - "time": "2026-09-25T15:46:47+00:00" + "time": "2026-10-15T09:18:53+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.43.0", + "version": "v1.43.3", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "d13cf82f40af144e5e5a867dc54ec3c7b4544b2e" + "reference": "aad9cd259a9a4d2810e7ba778ed093bbd76a5ab9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/d13cf82f40af144e5e5a867dc54ec3c7b4544b2e", - "reference": "d13cf82f40af144e5e5a867dc54ec3c7b4544b2e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/aad9cd259a9a4d2810e7ba778ed093bbd76a5ab9", + "reference": "aad9cd259a9a4d2810e7ba778ed093bbd76a5ab9", "shasum": "" }, "require": { @@ -3486,7 +3387,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.43.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.43.3" }, "funding": [ { @@ -3506,7 +3407,7 @@ "type": "tidelift" } ], - "time": "2026-09-25T15:46:47+00:00" + "time": "2026-10-27T15:55:21+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -3595,16 +3496,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.43.0", + "version": "v1.43.3", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72" + "reference": "122889ed24dc000165bcbfd77ec412f15cbdfc6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", - "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/122889ed24dc000165bcbfd77ec412f15cbdfc6a", + "reference": "122889ed24dc000165bcbfd77ec412f15cbdfc6a", "shasum": "" }, "require": { @@ -3656,7 +3557,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.3" }, "funding": [ { @@ -3676,91 +3577,7 @@ "type": "tidelift" } ], - "time": "2026-09-24T15:19:04+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.43.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", - "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.43.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-09-25T15:50:05+00:00" + "time": "2026-10-28T09:35:49+00:00" }, { "name": "symfony/polyfill-php83", @@ -3924,16 +3741,16 @@ }, { "name": "symfony/routing", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "7a344cf871532d081875bfdd18f3dff8dca36c5b" + "reference": "0000ade604b7bc798cb1e75edf6f17df48185f73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/7a344cf871532d081875bfdd18f3dff8dca36c5b", - "reference": "7a344cf871532d081875bfdd18f3dff8dca36c5b", + "url": "https://api.github.com/repos/symfony/routing/zipball/0000ade604b7bc798cb1e75edf6f17df48185f73", + "reference": "0000ade604b7bc798cb1e75edf6f17df48185f73", "shasum": "" }, "require": { @@ -3985,7 +3802,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.21" + "source": "https://github.com/symfony/routing/tree/v7.4.23" }, "funding": [ { @@ -4005,20 +3822,20 @@ "type": "tidelift" } ], - "time": "2026-10-11T18:40:59+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.7.3", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" + "reference": "052852a96fd5e5ebdb617dba22031e41a3300fb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", - "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/052852a96fd5e5ebdb617dba22031e41a3300fb5", + "reference": "052852a96fd5e5ebdb617dba22031e41a3300fb5", "shasum": "" }, "require": { @@ -4036,7 +3853,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -4072,7 +3889,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" + "source": "https://github.com/symfony/service-contracts/tree/v3.8.1" }, "funding": [ { @@ -4092,39 +3909,38 @@ "type": "tidelift" } ], - "time": "2026-07-27T15:39:01+00:00" + "time": "2026-10-20T17:38:25+00:00" }, { "name": "symfony/string", - "version": "v7.4.21", + "version": "v8.1.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "9bc35d074ad16a58c21cd52b18c5cacc4f4c3981" + "reference": "6c6110979c0150393bbb336170e286d51ab4d76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/9bc35d074ad16a58c21cd52b18c5cacc4f4c3981", - "reference": "9bc35d074ad16a58c21cd52b18c5cacc4f4c3981", + "url": "https://api.github.com/repos/symfony/string/zipball/6c6110979c0150393bbb336170e286d51ab4d76c", + "reference": "6c6110979c0150393bbb336170e286d51ab4d76c", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.33", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/emoji": "^7.1|^8.0", - "symfony/http-client": "^6.4|^7.0|^8.0", - "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0|^8.0" + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -4163,7 +3979,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.4.21" + "source": "https://github.com/symfony/string/tree/v8.1.10" }, "funding": [ { @@ -4183,20 +3999,20 @@ "type": "tidelift" } ], - "time": "2026-10-03T15:15:30+00:00" + "time": "2026-10-23T17:06:53+00:00" }, { "name": "symfony/translation", - "version": "v7.4.17", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b" + "reference": "00dc42a2c904e95433825c7b58fe24c08550d1c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/2ee1e4a3b32a528a642babe041ff7c440b213b4b", - "reference": "2ee1e4a3b32a528a642babe041ff7c440b213b4b", + "url": "https://api.github.com/repos/symfony/translation/zipball/00dc42a2c904e95433825c7b58fe24c08550d1c8", + "reference": "00dc42a2c904e95433825c7b58fe24c08550d1c8", "shasum": "" }, "require": { @@ -4263,7 +4079,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.4.17" + "source": "https://github.com/symfony/translation/tree/v7.4.23" }, "funding": [ { @@ -4283,20 +4099,20 @@ "type": "tidelift" } ], - "time": "2026-08-21T17:40:08+00:00" + "time": "2026-11-01T22:26:51+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.7.1", + "version": "v3.8.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621" + "reference": "0a3ae917402632fcba2aeddae9c98332f3d7dd05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/ccb206b98faccc511ebae8e5fad50f2dc0b30621", - "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/0a3ae917402632fcba2aeddae9c98332f3d7dd05", + "reference": "0a3ae917402632fcba2aeddae9c98332f3d7dd05", "shasum": "" }, "require": { @@ -4309,7 +4125,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.7-dev" + "dev-main": "3.8-dev" } }, "autoload": { @@ -4345,7 +4161,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/translation-contracts/tree/v3.8.1" }, "funding": [ { @@ -4365,20 +4181,20 @@ "type": "tidelift" } ], - "time": "2026-06-05T06:23:12+00:00" + "time": "2026-10-03T08:17:19+00:00" }, { "name": "symfony/twig-bridge", - "version": "v7.4.19", + "version": "v7.4.22", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "10d369dd3845bb650a9450e643d6d9027e8a86af" + "reference": "c959c7d2396e72e64c899fc9d0abba50733ea042" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/10d369dd3845bb650a9450e643d6d9027e8a86af", - "reference": "10d369dd3845bb650a9450e643d6d9027e8a86af", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/c959c7d2396e72e64c899fc9d0abba50733ea042", + "reference": "c959c7d2396e72e64c899fc9d0abba50733ea042", "shasum": "" }, "require": { @@ -4460,7 +4276,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v7.4.19" + "source": "https://github.com/symfony/twig-bridge/tree/v7.4.22" }, "funding": [ { @@ -4480,35 +4296,35 @@ "type": "tidelift" } ], - "time": "2026-09-14T12:19:06+00:00" + "time": "2026-10-15T16:00:28+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.4.21", + "version": "v8.1.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "55d06b02f49eca9bff61828548988e6f8763e8a6" + "reference": "3412a5af7d34a19515a77890fc804fe8e50d1a4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/55d06b02f49eca9bff61828548988e6f8763e8a6", - "reference": "55d06b02f49eca9bff61828548988e6f8763e8a6", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3412a5af7d34a19515a77890fc804fe8e50d1a4f", + "reference": "3412a5af7d34a19515a77890fc804fe8e50d1a4f", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4.1", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { - "symfony/console": "<6.4" + "symfony/console": "<7.4", + "symfony/error-handler": "<7.4" }, "require-dev": { - "symfony/console": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/process": "^6.4|^7.0|^8.0", - "symfony/uid": "^6.4|^7.0|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", "twig/twig": "^3.12|^4.0" }, "bin": [ @@ -4547,7 +4363,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.4.21" + "source": "https://github.com/symfony/var-dumper/tree/v8.1.10" }, "funding": [ { @@ -4567,20 +4383,20 @@ "type": "tidelift" } ], - "time": "2026-10-13T05:48:33+00:00" + "time": "2026-10-26T21:55:04+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.4.18", + "version": "v7.4.22", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "d6a87acbe48cbc707b9aba7f1a6c2215aab02603" + "reference": "6c967db30708068f6eaedb6ed37973bd86de2241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/d6a87acbe48cbc707b9aba7f1a6c2215aab02603", - "reference": "d6a87acbe48cbc707b9aba7f1a6c2215aab02603", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/6c967db30708068f6eaedb6ed37973bd86de2241", + "reference": "6c967db30708068f6eaedb6ed37973bd86de2241", "shasum": "" }, "require": { @@ -4628,7 +4444,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.4.18" + "source": "https://github.com/symfony/var-exporter/tree/v7.4.22" }, "funding": [ { @@ -4648,20 +4464,20 @@ "type": "tidelift" } ], - "time": "2026-08-23T10:03:40+00:00" + "time": "2026-10-22T14:50:44+00:00" }, { "name": "symfony/yaml", - "version": "v7.4.21", + "version": "v7.4.23", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "044907929c7999814378be22da34722c7a86bad4" + "reference": "1e601207ffe627a2e621faa9d661f1d32dcf1cec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/044907929c7999814378be22da34722c7a86bad4", - "reference": "044907929c7999814378be22da34722c7a86bad4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1e601207ffe627a2e621faa9d661f1d32dcf1cec", + "reference": "1e601207ffe627a2e621faa9d661f1d32dcf1cec", "shasum": "" }, "require": { @@ -4704,7 +4520,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.4.21" + "source": "https://github.com/symfony/yaml/tree/v7.4.23" }, "funding": [ { @@ -4724,7 +4540,7 @@ "type": "tidelift" } ], - "time": "2026-10-12T12:34:30+00:00" + "time": "2026-11-04T08:27:22+00:00" }, { "name": "twig/intl-extra", @@ -5296,16 +5112,16 @@ }, { "name": "icanhazstring/composer-unused", - "version": "0.9.7", + "version": "0.9.8", "source": { "type": "git", "url": "https://github.com/composer-unused/composer-unused.git", - "reference": "e1b1f4b4130b65c5bf036dbf435c0b9fe3f8c020" + "reference": "7374b91d32e2885a9458cd2c2c39fdc55a7c52d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer-unused/composer-unused/zipball/e1b1f4b4130b65c5bf036dbf435c0b9fe3f8c020", - "reference": "e1b1f4b4130b65c5bf036dbf435c0b9fe3f8c020", + "url": "https://api.github.com/repos/composer-unused/composer-unused/zipball/7374b91d32e2885a9458cd2c2c39fdc55a7c52d9", + "reference": "7374b91d32e2885a9458cd2c2c39fdc55a7c52d9", "shasum": "" }, "require": { @@ -5393,7 +5209,7 @@ "type": "other" } ], - "time": "2026-10-23T07:11:01+00:00" + "time": "2026-10-31T13:13:19+00:00" }, { "name": "mikey179/vfsstream", @@ -5753,16 +5569,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.8", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ec4293f7caf9936acce286b589ccb84faf1aa88d" + "reference": "af8e840551031d254cfdb3a18a62c3470a309c10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec4293f7caf9936acce286b589ccb84faf1aa88d", - "reference": "ec4293f7caf9936acce286b589ccb84faf1aa88d", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/af8e840551031d254cfdb3a18a62c3470a309c10", + "reference": "af8e840551031d254cfdb3a18a62c3470a309c10", "shasum": "" }, "require": { @@ -5794,17 +5610,17 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.8" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.4.1" }, - "time": "2026-10-26T20:24:50+00:00" + "time": "2026-10-30T19:36:28+00:00" }, { "name": "phpstan/phpstan", - "version": "2.3.2", + "version": "2.3.5", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/18bc23a0682f08591529377d271b5c4dfe9ed1dd", - "reference": "18bc23a0682f08591529377d271b5c4dfe9ed1dd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/645a1bd6bead15fc1b8474137467961d0fa30a79", + "reference": "645a1bd6bead15fc1b8474137467961d0fa30a79", "shasum": "" }, "require": { @@ -5860,7 +5676,7 @@ "type": "github" } ], - "time": "2026-10-24T11:36:00+00:00" + "time": "2026-11-03T12:14:22+00:00" }, { "name": "phpstan/phpstan-mockery", @@ -5971,33 +5787,34 @@ }, { "name": "phpunit/php-code-coverage", - "version": "12.5.8", + "version": "14.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd" + "reference": "4063552c678ce3beb4b7f131a5b7354a19ff3e2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7440368d94738d54f2c1de24dbd3871793bbb0dd", - "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4063552c678ce3beb4b7f131a5b7354a19ff3e2a", + "reference": "4063552c678ce3beb4b7f131a5b7354a19ff3e2a", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^5.9.0", - "php": ">=8.3", - "phpunit/php-text-template": "^5.0.1", - "sebastian/complexity": "^5.0", - "sebastian/environment": "^8.1.2", - "sebastian/lines-of-code": "^4.0.1", - "sebastian/version": "^6.0", - "theseer/tokenizer": "^2.0.1" + "php": ">=8.4", + "phpunit/php-text-template": "^6.0.1", + "sebastian/complexity": "^6.0", + "sebastian/environment": "^9.3.3", + "sebastian/git-state": "^1.1.0", + "sebastian/lines-of-code": "^5.0.2", + "sebastian/version": "^7.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.37" + "phpunit/phpunit": "^13.4.5" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -6006,7 +5823,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5.x-dev" + "dev-main": "14.5.x-dev" } }, "autoload": { @@ -6035,7 +5852,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.8" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.5.1" }, "funding": [ { @@ -6055,32 +5872,32 @@ "type": "tidelift" } ], - "time": "2026-10-03T14:03:50+00:00" + "time": "2026-11-02T11:47:37+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "6.0.2", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5" + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a248d1640ab059b075f53a2ef0f9856e864e06b5", - "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/9bb4e6c58b62c1e043be995c66abec7c97307aae", + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.33" + "phpunit/phpunit": "^13.3.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -6108,7 +5925,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.2" }, "funding": [ { @@ -6128,28 +5945,28 @@ "type": "tidelift" } ], - "time": "2026-08-25T14:40:53+00:00" + "time": "2026-08-25T14:47:43+00:00" }, { "name": "phpunit/php-invoker", - "version": "6.0.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "suggest": { "ext-pcntl": "*" @@ -6157,7 +5974,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -6184,40 +6001,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-invoker", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:58+00:00" + "time": "2026-02-06T04:34:47+00:00" }, { "name": "phpunit/php-text-template", - "version": "5.0.1", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5" + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/babab73b7ef9fae406f2eb3ee11323a61caa63d5", - "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/97107691cb2b6c743b5e0c44be19e983cb337a02", + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.37" + "phpunit/phpunit": "^13.3.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6244,7 +6073,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.1" }, "funding": [ { @@ -6264,32 +6093,32 @@ "type": "tidelift" } ], - "time": "2026-10-03T04:51:29+00:00" + "time": "2026-10-03T04:54:24+00:00" }, { "name": "phpunit/php-timer", - "version": "8.0.0", + "version": "9.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -6316,28 +6145,40 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" + "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-timer", + "type": "tidelift" } ], - "time": "2025-02-07T04:59:38+00:00" + "time": "2026-02-06T04:37:53+00:00" }, { "name": "phpunit/phpunit", - "version": "12.5.40", + "version": "13.4.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "76bd3198f16aeb375a4d5f3626471445aed0966e" + "reference": "4821376960d0e1e5a7b7b700955ebcab33ecd71b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/76bd3198f16aeb375a4d5f3626471445aed0966e", - "reference": "76bd3198f16aeb375a4d5f3626471445aed0966e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4821376960d0e1e5a7b7b700955ebcab33ecd71b", + "reference": "4821376960d0e1e5a7b7b700955ebcab33ecd71b", "shasum": "" }, "require": { @@ -6350,22 +6191,24 @@ "myclabs/deep-copy": "^1.14.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=8.3", - "phpunit/php-code-coverage": "^12.5.8", - "phpunit/php-file-iterator": "^6.0.2", - "phpunit/php-invoker": "^6.0.0", - "phpunit/php-text-template": "^5.0.1", - "phpunit/php-timer": "^8.0.0", - "sebastian/cli-parser": "^4.2.1", - "sebastian/comparator": "^7.1.8", - "sebastian/diff": "^7.0.1", - "sebastian/environment": "^8.1.2", - "sebastian/exporter": "^7.0.3", - "sebastian/global-state": "^8.0.3", - "sebastian/object-enumerator": "^7.0.0", - "sebastian/recursion-context": "^7.0.1", - "sebastian/type": "^6.0.4", - "sebastian/version": "^6.0.1", + "php": ">=8.4.1", + "phpunit/php-code-coverage": "^14.5.0", + "phpunit/php-file-iterator": "^7.0.2", + "phpunit/php-invoker": "^7.0.0", + "phpunit/php-text-template": "^6.0.1", + "phpunit/php-timer": "^9.0.0", + "sebastian/cli-parser": "^5.0.1", + "sebastian/comparator": "^8.4", + "sebastian/diff": "^9.0.1", + "sebastian/environment": "^9.3.3", + "sebastian/exporter": "^8.2.1", + "sebastian/file-filter": "^1.0", + "sebastian/git-state": "^1.1", + "sebastian/global-state": "^9.0.1", + "sebastian/object-enumerator": "^8.1.0", + "sebastian/recursion-context": "^8.0.1", + "sebastian/type": "^7.0.2", + "sebastian/version": "^7.0.1", "staabm/side-effects-detector": "^1.0.5" }, "bin": [ @@ -6374,7 +6217,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5-dev" + "dev-main": "13.4-dev" } }, "autoload": { @@ -6406,7 +6249,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.40" + "source": "https://github.com/sebastianbergmann/phpunit/tree/13.4.6" }, "funding": [ { @@ -6414,20 +6257,20 @@ "type": "other" } ], - "time": "2026-10-16T05:55:07+00:00" + "time": "2026-11-02T07:12:28+00:00" }, { "name": "predis/predis", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "4d91f3b08a60c3bacc2afbd8dc41724559b7626a" + "reference": "2496e6d91ba4e137b47a6b802dc7e088ebf31df4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/4d91f3b08a60c3bacc2afbd8dc41724559b7626a", - "reference": "4d91f3b08a60c3bacc2afbd8dc41724559b7626a", + "url": "https://api.github.com/repos/predis/predis/zipball/2496e6d91ba4e137b47a6b802dc7e088ebf31df4", + "reference": "2496e6d91ba4e137b47a6b802dc7e088ebf31df4", "shasum": "" }, "require": { @@ -6469,7 +6312,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v3.7.0" + "source": "https://github.com/predis/predis/tree/v3.7.1" }, "funding": [ { @@ -6477,32 +6320,32 @@ "type": "github" } ], - "time": "2026-10-08T16:46:04+00:00" + "time": "2026-11-03T17:55:20+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.1", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.2-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6526,7 +6369,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" }, "funding": [ { @@ -6546,31 +6389,31 @@ "type": "tidelift" } ], - "time": "2026-05-17T05:29:34+00:00" + "time": "2026-08-01T04:27:14+00:00" }, { "name": "sebastian/comparator", - "version": "7.1.8", + "version": "8.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "7c65c1e79836812819705b473a90c12399542485" + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7c65c1e79836812819705b473a90c12399542485", - "reference": "7c65c1e79836812819705b473a90c12399542485", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/diff": "^7.0", - "sebastian/exporter": "^7.0.3" + "php": ">=8.4", + "sebastian/diff": "^9.0", + "sebastian/exporter": "^8.2" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3" }, "suggest": { "ext-bcmath": "For comparing BcMath\\Number objects" @@ -6578,7 +6421,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "7.1-dev" + "dev-main": "8.4-dev" } }, "autoload": { @@ -6618,7 +6461,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" }, "funding": [ { @@ -6638,33 +6481,33 @@ "type": "tidelift" } ], - "time": "2026-05-21T04:45:25+00:00" + "time": "2026-08-07T07:23:13+00:00" }, { "name": "sebastian/complexity", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" + "reference": "c5651c795c98093480df79350cb050813fc7a2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", + "reference": "c5651c795c98093480df79350cb050813fc7a2f3", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6688,41 +6531,53 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/complexity", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:25+00:00" + "time": "2026-02-06T04:41:32+00:00" }, { "name": "sebastian/diff", - "version": "7.0.1", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6" + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", - "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a2df6626c1baf31d5a88674882a3072f151b5a26", + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.33", + "phpunit/phpunit": "^13.3.1", "symfony/process": "^7.4.17" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -6755,7 +6610,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/diff/tree/9.0.1" }, "funding": [ { @@ -6775,27 +6630,27 @@ "type": "tidelift" } ], - "time": "2026-08-25T15:35:54+00:00" + "time": "2026-08-25T15:38:55+00:00" }, { "name": "sebastian/environment", - "version": "8.1.2", + "version": "9.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439" + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/9d32c685773823b1983e256ae4ecd48a10d6e439", - "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d4dd10267a11055066a2a78ae04583d8ddd4f595", + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.26" + "phpunit/phpunit": "^13.3.6" }, "suggest": { "ext-posix": "*" @@ -6803,7 +6658,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "8.1-dev" + "dev-main": "9.3-dev" } }, "autoload": { @@ -6831,7 +6686,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/8.1.2" + "source": "https://github.com/sebastianbergmann/environment/tree/9.3.3" }, "funding": [ { @@ -6851,34 +6706,34 @@ "type": "tidelift" } ], - "time": "2026-05-25T13:40:20+00:00" + "time": "2026-10-01T12:37:56+00:00" }, { "name": "sebastian/exporter", - "version": "7.0.3", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23" + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", - "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/recursion-context": "^7.0.1" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.2-dev" } }, "autoload": { @@ -6921,7 +6776,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" }, "funding": [ { @@ -6941,35 +6796,173 @@ "type": "tidelift" } ], - "time": "2026-05-20T04:37:17+00:00" + "time": "2026-08-07T07:22:06+00:00" + }, + { + "name": "sebastian/file-filter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/file-filter.git", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for filtering files", + "homepage": "https://github.com/sebastianbergmann/file-filter", + "support": { + "issues": "https://github.com/sebastianbergmann/file-filter/issues", + "security": "https://github.com/sebastianbergmann/file-filter/security/policy", + "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/file-filter", + "type": "tidelift" + } + ], + "time": "2026-04-22T07:20:04+00:00" + }, + { + "name": "sebastian/git-state", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/git-state.git", + "reference": "31a565f463686f0eefa85f899549256bf5805985" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/31a565f463686f0eefa85f899549256bf5805985", + "reference": "31a565f463686f0eefa85f899549256bf5805985", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for describing the state of a Git checkout", + "homepage": "https://github.com/sebastianbergmann/git-state", + "support": { + "issues": "https://github.com/sebastianbergmann/git-state/issues", + "security": "https://github.com/sebastianbergmann/git-state/security/policy", + "source": "https://github.com/sebastianbergmann/git-state/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/git-state", + "type": "tidelift" + } + ], + "time": "2026-10-21T05:59:52+00:00" }, { "name": "sebastian/global-state", - "version": "8.0.3", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9" + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b164d3274d6537ab462591c5755f76a8f5b1aae9", - "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0.1" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^12.5.28" + "phpunit/phpunit": "^13.1.13" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -6995,7 +6988,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.3" + "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" }, "funding": [ { @@ -7015,33 +7008,33 @@ "type": "tidelift" } ], - "time": "2026-06-01T15:10:33+00:00" + "time": "2026-06-01T15:11:33+00:00" }, { "name": "sebastian/lines-of-code", - "version": "4.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e" + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d543b8ef219dcd8da262cbb958639a96bedba10e", - "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", "shasum": "" }, "require": { - "nikic/php-parser": "^5.7.0", - "php": ">=8.3" + "nikic/php-parser": "^5.8.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -7065,7 +7058,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" }, "funding": [ { @@ -7085,34 +7078,33 @@ "type": "tidelift" } ], - "time": "2026-05-19T16:22:07+00:00" + "time": "2026-07-09T08:42:34+00:00" }, { "name": "sebastian/object-enumerator", - "version": "7.0.0", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -7135,40 +7127,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-enumerator", + "type": "tidelift" } ], - "time": "2025-02-07T04:57:48+00:00" + "time": "2026-08-13T07:05:05+00:00" }, { "name": "sebastian/object-reflector", - "version": "5.0.0", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a" + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -7191,40 +7195,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-reflector", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:17+00:00" + "time": "2026-08-13T06:34:36+00:00" }, { "name": "sebastian/recursion-context", - "version": "7.0.1", + "version": "8.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -7255,7 +7271,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" }, "funding": [ { @@ -7275,32 +7291,32 @@ "type": "tidelift" } ], - "time": "2025-08-13T04:44:59+00:00" + "time": "2026-08-03T05:58:12+00:00" }, { "name": "sebastian/type", - "version": "6.0.4", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "82ff822c2edc46724be9f7411d3163021f602773" + "reference": "bd1df467864cb95140414059a535b2d906173fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/82ff822c2edc46724be9f7411d3163021f602773", - "reference": "82ff822c2edc46724be9f7411d3163021f602773", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", + "reference": "bd1df467864cb95140414059a535b2d906173fcf", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -7324,7 +7340,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/6.0.4" + "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" }, "funding": [ { @@ -7344,29 +7360,29 @@ "type": "tidelift" } ], - "time": "2026-05-20T06:45:45+00:00" + "time": "2026-08-10T08:00:57+00:00" }, { "name": "sebastian/version", - "version": "6.0.1", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "9e935a16187e14f39b0e79910dabd614972cdb26" + "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/9e935a16187e14f39b0e79910dabd614972cdb26", - "reference": "9e935a16187e14f39b0e79910dabd614972cdb26", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1", + "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -7390,7 +7406,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/version/tree/7.0.1" }, "funding": [ { @@ -7410,26 +7426,26 @@ "type": "tidelift" } ], - "time": "2026-10-04T05:50:08+00:00" + "time": "2026-10-04T05:51:14+00:00" }, { "name": "simplesamlphp/simplesamlphp-test-framework", - "version": "v1.11.6", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/simplesamlphp/simplesamlphp-test-framework.git", - "reference": "9765f07a19b32a7d6079a2ad5b446766a11e26e7" + "reference": "775fb00249e0a0aeffd60cc7484194628d399c3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-test-framework/zipball/9765f07a19b32a7d6079a2ad5b446766a11e26e7", - "reference": "9765f07a19b32a7d6079a2ad5b446766a11e26e7", + "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-test-framework/zipball/775fb00249e0a0aeffd60cc7484194628d399c3e", + "reference": "775fb00249e0a0aeffd60cc7484194628d399c3e", "shasum": "" }, "require": { "ext-curl": "*", "icanhazstring/composer-unused": "^0.9", - "php": "^8.3", + "php": "^8.5", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1", "phpstan/phpstan-mockery": "^2.0", @@ -7468,20 +7484,20 @@ "issues": "https://github.com/simplesamlphp/simplesamlphp-test-framework/issues", "source": "https://github.com/simplesamlphp/simplesamlphp-test-framework" }, - "time": "2026-05-29T15:08:52+00:00" + "time": "2026-07-02T20:50:58+00:00" }, { "name": "slevomat/coding-standard", - "version": "8.31.2", + "version": "8.31.3", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "d4fcefff8bec24814e1c165dfb4c3bdfa91faf5c" + "reference": "b5c34b28811ee2ed323c52c7dabe2f2802dd2f8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/d4fcefff8bec24814e1c165dfb4c3bdfa91faf5c", - "reference": "d4fcefff8bec24814e1c165dfb4c3bdfa91faf5c", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/b5c34b28811ee2ed323c52c7dabe2f2802dd2f8a", + "reference": "b5c34b28811ee2ed323c52c7dabe2f2802dd2f8a", "shasum": "" }, "require": { @@ -7521,7 +7537,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.31.2" + "source": "https://github.com/slevomat/coding-standard/tree/8.31.3" }, "funding": [ { @@ -7533,7 +7549,7 @@ "type": "tidelift" } ], - "time": "2026-10-25T09:45:11+00:00" + "time": "2026-10-28T16:34:46+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -7673,16 +7689,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v8.1.9", + "version": "v8.1.10", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "8a18197104d682fc3fa59718524ccca0d090f8ad" + "reference": "989d3fba892a7229c0529c33650e50eba51b6565" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/8a18197104d682fc3fa59718524ccca0d090f8ad", - "reference": "8a18197104d682fc3fa59718524ccca0d090f8ad", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/989d3fba892a7229c0529c33650e50eba51b6565", + "reference": "989d3fba892a7229c0529c33650e50eba51b6565", "shasum": "" }, "require": { @@ -7734,7 +7750,7 @@ "testing" ], "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v8.1.9" + "source": "https://github.com/symfony/phpunit-bridge/tree/v8.1.10" }, "funding": [ { @@ -7754,109 +7770,29 @@ "type": "tidelift" } ], - "time": "2026-09-30T22:00:36+00:00" - }, - { - "name": "symfony/polyfill-php84", - "version": "v1.43.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/22c6548499cbe5c5bb072fc0c42312dff062a015", - "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php84\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.43.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-09-23T22:01:09+00:00" + "time": "2026-10-18T14:56:39+00:00" }, { "name": "symfony/property-access", - "version": "v7.4.16", + "version": "v8.1.11", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "c3dce76a6697c6428f7d80d5cd1cf0aa5d9679f3" + "reference": "d080c2afa37114d46e4f950ed8593667f01f7cab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/c3dce76a6697c6428f7d80d5cd1cf0aa5d9679f3", - "reference": "c3dce76a6697c6428f7d80d5cd1cf0aa5d9679f3", + "url": "https://api.github.com/repos/symfony/property-access/zipball/d080c2afa37114d46e4f950ed8593667f01f7cab", + "reference": "d080c2afa37114d46e4f950ed8593667f01f7cab", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/property-info": "^6.4.32|~7.3.10|^7.4.4|^8.0.4" + "php": ">=8.4.1", + "symfony/property-info": "^7.4.4|^8.0.4" }, "require-dev": { - "symfony/cache": "^6.4|^7.0|^8.0", - "symfony/var-exporter": "^6.4.1|^7.0.1|^8.0" + "symfony/cache": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -7895,7 +7831,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v7.4.16" + "source": "https://github.com/symfony/property-access/tree/v8.1.11" }, "funding": [ { @@ -7915,41 +7851,37 @@ "type": "tidelift" } ], - "time": "2026-07-30T12:37:26+00:00" + "time": "2026-11-01T19:30:44+00:00" }, { "name": "symfony/property-info", - "version": "v7.4.20", + "version": "v8.1.11", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "d24c4c810b1285c5d8d77c6fd7b25e714479bd48" + "reference": "b5afa379a5b54f15a594c1d45ceaa19969d38a16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/d24c4c810b1285c5d8d77c6fd7b25e714479bd48", - "reference": "d24c4c810b1285c5d8d77c6fd7b25e714479bd48", + "url": "https://api.github.com/repos/symfony/property-info/zipball/b5afa379a5b54f15a594c1d45ceaa19969d38a16", + "reference": "b5afa379a5b54f15a594c1d45ceaa19969d38a16", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0|^8.0", + "php": ">=8.4.1", + "symfony/string": "^7.4|^8.0", "symfony/type-info": "^7.4.7|^8.0.7" }, "conflict": { "phpdocumentor/reflection-docblock": "<5.2|>=7", - "phpdocumentor/type-resolver": "<1.5.1", - "symfony/cache": "<6.4", - "symfony/dependency-injection": "<6.4", - "symfony/serializer": "<6.4" + "phpdocumentor/type-resolver": "<1.5.1" }, "require-dev": { "phpdocumentor/reflection-docblock": "^5.2|^6.0", "phpstan/phpdoc-parser": "^1.0|^2.0", - "symfony/cache": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^6.4|^7.0|^8.0", - "symfony/serializer": "^6.4|^7.0|^8.0" + "symfony/cache": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -7985,7 +7917,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v7.4.20" + "source": "https://github.com/symfony/property-info/tree/v8.1.11" }, "funding": [ { @@ -8005,63 +7937,58 @@ "type": "tidelift" } ], - "time": "2026-09-28T09:47:41+00:00" + "time": "2026-11-02T10:58:30+00:00" }, { "name": "symfony/serializer", - "version": "v7.4.21", + "version": "v8.1.11", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "2966bc53636dde874e63f8727da3aa306f479f4d" + "reference": "05624c94507c3acf065b6486bb626f0d741af459" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/2966bc53636dde874e63f8727da3aa306f479f4d", - "reference": "2966bc53636dde874e63f8727da3aa306f479f4d", + "url": "https://api.github.com/repos/symfony/serializer/zipball/05624c94507c3acf065b6486bb626f0d741af459", + "reference": "05624c94507c3acf065b6486bb626f0d741af459", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php84": "^1.30" + "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpdocumentor/reflection-docblock": "<5.2|>=7", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<6.4", - "symfony/property-access": "<6.4.31|>=7.0,<7.4.2|>=8.0,<8.0.2", - "symfony/property-info": "<6.4.43", - "symfony/type-info": "<7.2.5", - "symfony/uid": "<6.4", - "symfony/validator": "<6.4", - "symfony/yaml": "<6.4" + "symfony/property-access": "<8.1", + "symfony/property-info": "<7.4.15", + "symfony/type-info": "<7.4" }, "require-dev": { "phpdocumentor/reflection-docblock": "^5.2|^6.0", "phpstan/phpdoc-parser": "^1.0|^2.0", "seld/jsonlint": "^1.10", - "symfony/cache": "^6.4|^7.0|^8.0", - "symfony/config": "^6.4|^7.0|^8.0", - "symfony/console": "^6.4|^7.0|^8.0", - "symfony/dependency-injection": "^7.2|^8.0", - "symfony/error-handler": "^6.4|^7.0|^8.0", - "symfony/filesystem": "^6.4|^7.0|^8.0", - "symfony/form": "^6.4|^7.0|^8.0", - "symfony/http-foundation": "^6.4|^7.0|^8.0", - "symfony/http-kernel": "^6.4|^7.0|^8.0", - "symfony/messenger": "^6.4|^7.0|^8.0", - "symfony/mime": "^6.4|^7.0|^8.0", - "symfony/property-access": "^6.4.31|^7.4.2|^8.0.2", - "symfony/property-info": "^6.4.43|^7.4.15|^8.0.15", + "symfony/cache": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/filesystem": "^7.4|^8.0", + "symfony/form": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/property-access": "^8.1", + "symfony/property-info": "^7.4.15|~8.0.15|^8.1.2", "symfony/translation-contracts": "^2.5|^3", - "symfony/type-info": "^7.2.5|^8.0", - "symfony/uid": "^6.4|^7.0|^8.0", - "symfony/validator": "^6.4|^7.0|^8.0", - "symfony/var-dumper": "^6.4|^7.0|^8.0", - "symfony/var-exporter": "^6.4|^7.0|^8.0", - "symfony/yaml": "^6.4|^7.0|^8.0" + "symfony/type-info": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -8089,7 +8016,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v7.4.21" + "source": "https://github.com/symfony/serializer/tree/v8.1.11" }, "funding": [ { @@ -8109,26 +8036,25 @@ "type": "tidelift" } ], - "time": "2026-10-12T18:56:36+00:00" + "time": "2026-11-04T08:39:20+00:00" }, { "name": "symfony/type-info", - "version": "v7.4.20", + "version": "v8.1.11", "source": { "type": "git", "url": "https://github.com/symfony/type-info.git", - "reference": "bbaaf3366400f5c85f66800b955c77b46e8abad2" + "reference": "9fd1414061c4bbf953bcfc183b133cbfa0a73c73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/type-info/zipball/bbaaf3366400f5c85f66800b955c77b46e8abad2", - "reference": "bbaaf3366400f5c85f66800b955c77b46e8abad2", + "url": "https://api.github.com/repos/symfony/type-info/zipball/9fd1414061c4bbf953bcfc183b133cbfa0a73c73", + "reference": "9fd1414061c4bbf953bcfc183b133cbfa0a73c73", "shasum": "" }, "require": { - "php": ">=8.2", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.4.1", + "psr/container": "^1.1|^2.0" }, "conflict": { "phpstan/phpdoc-parser": "<1.30" @@ -8172,7 +8098,7 @@ "type" ], "support": { - "source": "https://github.com/symfony/type-info/tree/v7.4.20" + "source": "https://github.com/symfony/type-info/tree/v8.1.11" }, "funding": [ { @@ -8192,57 +8118,7 @@ "type": "tidelift" } ], - "time": "2026-09-28T12:19:37+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^8.1" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/2.0.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2025-12-08T11:19:18+00:00" + "time": "2026-11-02T10:58:30+00:00" }, { "name": "webmozart/glob", @@ -8297,15 +8173,14 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "simplesamlphp/simplesamlphp-test-framework": 20 + "simplesamlphp/saml2": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.3", + "php": "^8.5", "ext-date": "*", "ext-dom": "*", - "ext-fileinfo": "*", "ext-filter": "*", "ext-hash": "*", "ext-json": "*", diff --git a/config/config.php.dist b/config/config.php.dist index 3fb78ff2d1..67666d7a87 100644 --- a/config/config.php.dist +++ b/config/config.php.dist @@ -255,10 +255,10 @@ $config = [ * If you have some SP's on HTTP and IdP is normally on HTTPS, this option * enables secure POSTing to HTTP endpoint without warning from browser. * - * For this to work, module.php/core/postredirect.php must be accessible + * For this to work, /module/core/postredirect must be accessible * also via HTTP on IdP, e.g. if your IdP is on * https://idp.example.org/ssp/, then - * http://idp.example.org/ssp/module.php/core/postredirect.php must be accessible. + * http://idp.example.org/ssp/module/core/postredirect must be accessible. */ 'enable.http_post' => false, @@ -606,6 +606,15 @@ $config = [ */ 'session.datastore.timeout' => (4 * 60 * 60), // 4 hours + /* + * The datastore within a session can contain an arbitrary number of login and logout requests, as well as + * error reports. Historically, this is unlimited, which can result in very large sessions if a user agent makes + * repeated and frequent requests. + * Setting a limit here ensures older objects are discarded as new ones are added. A value of 25 is recommended as + * this should not cause any real inconvenience, but limits the maximum size of a session. + */ + 'session.datastore.limit' => 0, // no limit + /* * Sets the duration, in seconds, auth state should be stored. */ diff --git a/docs/simplesamlphp-artifact-idp.md b/docs/simplesamlphp-artifact-idp.md index e327134131..8a13efb9b7 100644 --- a/docs/simplesamlphp-artifact-idp.md +++ b/docs/simplesamlphp-artifact-idp.md @@ -70,12 +70,12 @@ In general, that should look something like: 'AssertionConsumerService' => [ [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-acs.php/default-sp', 'index' => 0, ], [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-acs.php/default-sp', 'index' => 2, ], ], diff --git a/docs/simplesamlphp-changelog.md b/docs/simplesamlphp-changelog.md index ed4c3c1f79..40afcfb7fb 100644 --- a/docs/simplesamlphp-changelog.md +++ b/docs/simplesamlphp-changelog.md @@ -5,6 +5,12 @@ This document lists the changes between versions of SimpleSAMLphp. See the [upgrade notes](https://simplesamlphp.org/docs/stable/simplesamlphp-upgrade-notes.html) for specific information about upgrading. +## Version 2.6.0 + +Release TBD + +* Support for session.datastore.limit configuration setting (#2670) + ## Version 2.5.4 Released TBD diff --git a/docs/simplesamlphp-developer-information.md b/docs/simplesamlphp-developer-information.md index e924cbc76a..3fe15f960d 100644 --- a/docs/simplesamlphp-developer-information.md +++ b/docs/simplesamlphp-developer-information.md @@ -1,7 +1,7 @@ # SimpleSAMLphp developer information - @@ -66,18 +66,31 @@ The dependencies are updated using github actions in simplesamlphp-assets-base. Select a recent branch such as release-2.2 and dig into the .github directory for details. +### Primary Module Assets + +If a primary module (a module included in the main repository) contains public +assets inside its `public/assets/` directory, these assets must be explicitly +allowed in the repository's root `.gitignore` file. Because `/public/assets/*` +is ignored by default, you must add `!/public/assets//` and +`!/public/assets//**` to the `.gitignore` file to ensure the deployed +assets for that module can be tracked by Git. + ## Following a simple login The `SimpleSAML\Auth\Simple` class takes the authentication_source name and can be used to find a login URL with `getLoginURL()`. The getLoginURL method takes the return URL as it's only parameter. The -URL returned from `getLoginURL()` will be a request to module.php and -include the return URL information. - -The module.php code `Module::process`. The `process` method uses -Symfony to dispatch the request. This may result in a call to -modules/core/src/Controller/Login.php in `Login::loginuserpass()`. The -code flows through `handleLogin()` which may call +URL returned from `getLoginURL()` points at a routed module endpoint, +typically under `/module/saml/...`, and includes the return URL +information. + +SimpleSAMLphp now handles supported web requests through the front +controller in `public/index.php`. The global kernel loads the routes, +services, and controllers from all enabled modules and uses Symfony to +dispatch the request. A simple login request may therefore resolve to +`modules/saml/src/Controller/ServiceProvider.php` and then into the +configured authentication source. The code flows through +`handleLogin()` which may call `UserPassBase::handleLogin(authstateid, username, password)`. The `handleLogin` method looks up the `$as = Auth\Source` and passes the login credentials to the `$as->login( username, password )` method. @@ -87,6 +100,9 @@ modules/sqlauth/src/Auth/Source/SQL.php and the `SQL::login` method. This `login` method either returns the user attributes on success or throws an exception on login failure. +Similarly, `getLogoutURL()` now returns a routed logout endpoint under +`/module/core/...`. + ## Documentation The core of the simplesamlphp.org website is taken from diff --git a/docs/simplesamlphp-ecp-idp.md b/docs/simplesamlphp-ecp-idp.md index dd0ffa2948..d1786fae56 100644 --- a/docs/simplesamlphp-ecp-idp.md +++ b/docs/simplesamlphp-ecp-idp.md @@ -37,11 +37,11 @@ The `saml20-idp-remote` metadata for simpleSAMLphp SPs should contain something 'SingleSignOnService' => [ 0 => [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService', ], 1 => [ 'index' => 0, - 'Location' => 'https://didp.example.org/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'https://didp.example.org/simplesaml/module/saml/idp/singleSignOnService', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP', ], ], diff --git a/docs/simplesamlphp-errorhandling.md b/docs/simplesamlphp-errorhandling.md index 3a5e59539b..585eebcb5f 100644 --- a/docs/simplesamlphp-errorhandling.md +++ b/docs/simplesamlphp-errorhandling.md @@ -196,18 +196,149 @@ An exception which isn't a subclass of `\SimpleSAML\Error\Exception` will be con This happens regardless of whether the exception is delivered directly or through the error handler. This is done to be consistent in what the application receives - now it will always receive the same exception, regardless of whether it is delivered directly or through a redirect. -## Custom error show function +## Custom error rendering -Optional custom error show function, called from \SimpleSAML\Error\Error::show, is defined with 'errors.show_function' in config.php. +SimpleSAMLphp 3.0 uses Symfony's event system for error rendering. To customize how errors are displayed, you can register a custom event subscriber that listens for the `kernel.exception` event. -Example code for this function, which implements the same functionality as \SimpleSAML\Error\Error::show, looks something like: +### Creating a custom error subscriber + +Create a class that implements `\Symfony\Component\EventDispatcher\EventSubscriberInterface`. Your subscriber should have a priority higher than 200 to ensure it runs before the default SimpleSAMLphp error handler. + +Example: + +```php + 200 to run before SimpleSAMLphp's default handler + KernelEvents::EXCEPTION => ['onKernelException', 250], + ]; + } + + public function onKernelException(ExceptionEvent $event): void + { + $exception = $event->getThrowable(); + + // Your custom error rendering logic + $response = new Response( + '

Custom Error

' . + htmlspecialchars($exception->getMessage()) . + '

', + 500, + ); + + $event->setResponse($response); + } +} +``` + +### Rendering the error page with a Twig template + +SimpleSAMLphp's `\SimpleSAML\XHTML\Template` class extends +Symfony's `Response`, so a template can be returned directly from the event. + +First, add a Twig template to your module, for example +`modules/mymodule/templates/error.twig`: + +```twig + + + + + Custom error page + + +

Custom Error

+

{{ errorMessage|escape('html') }}

+ + +``` + +Then build and return that template from the subscriber. The template name uses +the `:.twig` convention, variables are passed through the public +`$data` array, and the status code is set with the usual `Response` method: ```php -public static function show(\SimpleSAML\Configuration $config, array $data) +data = array_merge($t->data, $data); - $t->send(); - exit; + public static function getSubscribedEvents(): array + { + return [ + // Priority > 200 to run before SimpleSAMLphp's default handler + KernelEvents::EXCEPTION => ['onKernelException', 250], + ]; + } + + public function onKernelException(ExceptionEvent $event): void + { + $exception = $event->getThrowable(); + + // Template extends Symfony's Response, so it can be returned straight + // from the event. + $template = new Template(Configuration::getInstance(), 'mymodule:error.twig'); + + // Variables are passed to Twig through the public $data array. + $template->data['errorMessage'] = $exception->getMessage(); + + // Reuse the exception's HTTP status code when it has one (e.g. a 404 + // NotFoundHttpException), otherwise fall back to 500. + $template->setStatusCode( + $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : 500, + ); + + $event->setResponse($template); + } } ``` + +The subscriber is registered as in the inline example below. + +### Registering the subscriber + +Register your subscriber as a service in your module's `routing/services/` directory (e.g., `routing/services/mymodule.yml`): + +```yaml +services: + SimpleSAML\Module\mymodule\EventSubscriber\CustomErrorSubscriber: + tags: ['kernel.event_subscriber'] +``` + +### Verifying the subscriber is registered + +After registering the service and clearing the cache, you can confirm +that your subscriber is actually wired up — and check its priority +relative to SimpleSAMLphp's built-in handler (priority 200) — with: + +```sh +php bin/console debug:event-dispatcher kernel.exception +``` + +This lists every listener registered for the `kernel.exception` event in +the order they run. Your subscriber should appear with the priority you +configured; a priority higher than 200 confirms it runs before (and can +therefore override) SimpleSAMLphp's default error handler. If it does +not appear at all, the service definition was not loaded — check that it +lives under your module's `routing/services/` directory, that the module +is enabled, and that the cache has been cleared. diff --git a/docs/simplesamlphp-googleapps.md b/docs/simplesamlphp-googleapps.md index db7adfc947..d3e25f055e 100644 --- a/docs/simplesamlphp-googleapps.md +++ b/docs/simplesamlphp-googleapps.md @@ -187,7 +187,7 @@ You will find in the metadata the XML tag `` which contains the right URL to input in the field, it will look something like this: -`https://dev2.andreas.feide.no/simplesaml/module.php/saml/idp/singleSignOnService` +`https://dev2.andreas.feide.no/simplesaml/module/saml/idp/singleSignOnService` The Sign-out page or change password URL can be static pages on your server. (Google does not support SAML Single Log Out.) diff --git a/docs/simplesamlphp-hok-idp.md b/docs/simplesamlphp-hok-idp.md index 527924d42b..8842ed9bab 100644 --- a/docs/simplesamlphp-hok-idp.md +++ b/docs/simplesamlphp-hok-idp.md @@ -47,7 +47,7 @@ The `saml20-idp-remote` metadata for SimpleSAMLphp SPs should contain something [ 'hoksso:ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', - 'Location' => 'https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService', 'attributes' => [ [ 'namespaceURI' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', @@ -59,7 +59,7 @@ The `saml20-idp-remote` metadata for SimpleSAMLphp SPs should contain something ], [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService', ], ], ``` @@ -74,12 +74,12 @@ In general, this should look like the following code: 'AssertionConsumerService' => [ [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-acs.php/default-sp', 'index' => 0, ], [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-acs.php/default-sp', 'index' => 4, ], ], diff --git a/docs/simplesamlphp-idp-more.md b/docs/simplesamlphp-idp-more.md index 4dadf4ca4f..e550ce6834 100644 --- a/docs/simplesamlphp-idp-more.md +++ b/docs/simplesamlphp-idp-more.md @@ -35,11 +35,11 @@ If you do not want to start the SSO flow at the SP, you may use the IdP-first se Here is an example of such a URL: -`https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService?spentityid=urn:mace:feide.no:someservice` +`https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService?spentityid=urn:mace:feide.no:someservice` You can also add a `RelayState` parameter to the IdP-first URL: -`https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService?spentityid=urn:mace:feide.no:someservice&RelayState=https://sp.example.org/somepage` +`https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService?spentityid=urn:mace:feide.no:someservice&RelayState=https://sp.example.org/somepage` The `RelayState` parameter is often used to carry the URL the SP should redirect to after authentication. It is also possible to specify the Assertion Consumer URL with the `ConsumerURL` parameter. diff --git a/docs/simplesamlphp-idp.md b/docs/simplesamlphp-idp.md index b5af78fca3..934c32ecbf 100644 --- a/docs/simplesamlphp-idp.md +++ b/docs/simplesamlphp-idp.md @@ -183,16 +183,16 @@ This is a minimal example of a `metadata/saml20-sp-remote.php` metadata file for ```php [ [ - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-acs.php/default-sp', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', ], ], 'SingleLogoutService' => [ [ - 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp', + 'Location' => 'https://sp.example.org/simplesaml/module/saml/sp/saml2-logout.php/default-sp', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', ], ], @@ -200,13 +200,13 @@ $metadata['https://sp.example.org/simplesaml/module.php/saml/sp/metadata.php/def ``` Note that the URI in the entityID and the URLs to the AssertionConsumerService and SingleLogoutService endpoints change between different service providers. -If you have the metadata of the remote SP as an XML file, you can use the built-in XML to SimpleSAMLphp metadata converter, which by default is available as `/module.php/admin/federation/metadata-converter` in your SimpleSAMLphp installation. +If you have the metadata of the remote SP as an XML file, you can use the built-in XML to SimpleSAMLphp metadata converter, which by default is available as `/module/admin/federation/metadata-converter` in your SimpleSAMLphp installation. For more information about available options in the sp-remote metadata files, see the [SP remote reference](simplesamlphp-reference-sp-remote). ## Adding this IdP to other SPs -The method for adding this IdP to a SP varies between different types of SPs. In general, most SPs need some metadata from the IdP. This should be available from `/saml2/idp/metadata.php`. +The method for adding this IdP to a SP varies between different types of SPs. In general, most SPs need some metadata from the IdP. This should be available from `/module/saml/idp/metadata`. ## Testing the IdP @@ -232,14 +232,14 @@ If you do not want to start the SSO flow at the SP, you may use the IdP-first se Here is an example of such a URL: -`https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService?spentityid=sp.example.org` +`https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService?spentityid=sp.example.org` If the SP is a SimpleSAMLphp SP, you must also specify a `RelayState` parameter for the SP. This must be set to a URL the user should be redirected to after authentication. The `RelayState` parameter can be specified in the [SP configuration](./saml:sp), or it can be sent from the IdP. To send the RelayState parameter from a SimpleSAMLphp IdP, specify it in the query string to SSOService.php: -`https://idp.example.org/simplesaml/module.php/saml/idp/singleSignOnService?spentityid=sp.example.org&RelayState=https://sp.example.org/welcome.php` +`https://idp.example.org/simplesaml/module/saml/idp/singleSignOnService?spentityid=sp.example.org&RelayState=https://sp.example.org/welcome.php` To set it in the SP configuration, add it to `authsources.php`: diff --git a/docs/simplesamlphp-install.md b/docs/simplesamlphp-install.md index 48fbc1f0ae..ab808608d5 100644 --- a/docs/simplesamlphp-install.md +++ b/docs/simplesamlphp-install.md @@ -14,7 +14,7 @@ repository](simplesamlphp-install-repo). ## Prerequisites * A web server capable of executing PHP scripts. -* PHP version >= 8.3.0. +* PHP version >= 8.5.0. * Support for the following PHP extensions: * Always required: `date`, `dom`, `fileinfo`, `filter`, `hash`, `json`, `libxml`, `mbstring`, `openssl`, `pcre`, `session`, `simplexml`, `sodium`, `SPL` and `zlib` @@ -95,6 +95,31 @@ Most likely the metadata format is backwards compatible. If not, you should rece startup indicating how and what you need to update. You should look through the metadata in the `metadata-templates` directory after the upgrade to see whether recommended defaults have been changed. +### Publishing module assets + +If you use modules that ship browser assets in +`modules//public/assets/`, publish them after installing or +upgrading SimpleSAMLphp: + +```sh +composer assets:publish +``` + +This command copies module assets into `public/assets//`, +where they can be served directly by the web server. + +Run it whenever: + +* you install or upgrade SimpleSAMLphp +* you add, remove, or update a module that provides browser assets +* you change files under `modules//public/assets/` + +If you prefer not to use Composer scripts, the equivalent command is: + +```sh +php bin/console assets:publish +``` + ## Configuration ### Location of configuration files @@ -119,6 +144,10 @@ The only subdirectory of `SimpleSAMLphp` that needs to be accessible from the we exposing SimpleSAMLphp depending on the way web sites are structured on your Apache web server. The following is just one possible configuration. +SimpleSAMLphp handles supported dynamic requests through +`public/index.php`. Static files, such as published module assets under +`public/assets/`, should be served directly by the web server. + Find the Apache configuration file for the virtual hosts where you want to run SimpleSAMLphp. The configuration may look like this: @@ -133,6 +162,7 @@ look like this: Require all granted + AllowOverride All ``` @@ -160,6 +190,10 @@ your configuration to a different location, you can use this environment variabl for configuration files. This works only for the `config` directory. If you need your metadata to be in a different directory too, use the `metadatadir` configuration option to specify the location. +If you do not want to rely on `.htaccess`, configure equivalent +rewrite rules directly in the virtual host so that non-file requests +below `/simplesaml` are sent to `index.php`. + This is just the basic configuration to get things working. For a checklist further completing your documentation, please see [Maintenance and configuration: Apache](simplesamlphp-maintenance). @@ -190,21 +224,29 @@ server { location ^~ /simplesaml { alias /var/simplesamlphp/public; + try_files $uri $uri/ /simplesaml/index.php$is_args$args; + } - location ~^(?/simplesaml)(?.+?\.php)(?/.*)?$ { - include fastcgi_params; - fastcgi_pass $fastcgi_pass; - fastcgi_param SCRIPT_FILENAME $document_root$phpfile; - - # Must be prepended with the baseurlpath - fastcgi_param SCRIPT_NAME /simplesaml$phpfile; - - fastcgi_param PATH_INFO $pathinfo if_not_empty; - } + location = /simplesaml/index.php { + include fastcgi_params; + fastcgi_pass $fastcgi_pass; + fastcgi_param SCRIPT_FILENAME /var/simplesamlphp/public/index.php; + fastcgi_param SCRIPT_NAME /simplesaml/index.php; + fastcgi_param PATH_INFO ""; } } ``` +This configuration serves static files directly from `public/` and +routes other requests through `public/index.php`. If you expose +SimpleSAMLphp under a different base path, update both the `alias` and +`SCRIPT_NAME` values accordingly. + +Legacy deployments sometimes mapped requests to individual PHP scripts +such as `module.php` or `public/saml2/idp/*.php`. Those entrypoints are +no longer supported; use front-controller routing through `index.php` +instead. + ## SimpleSAMLphp configuration: config.php There are a few steps that you should complete in the main configuration file, `config.php`, right away: diff --git a/docs/simplesamlphp-modules.md b/docs/simplesamlphp-modules.md index 0a1c4ef745..7d681f7e60 100644 --- a/docs/simplesamlphp-modules.md +++ b/docs/simplesamlphp-modules.md @@ -21,6 +21,10 @@ specific times. More than one thing can be stored in a single module. There is also support for storing supporting files, such as templates and dictionaries, in modules. +Enabled module routes, services, and controllers are loaded by the +global SimpleSAMLphp kernel and are reached through the front +controller in `public/index.php`. + The different functionalities which can be created as modules will be described in more detail in the following sections; what follows is a short introduction to what you can do with them: @@ -102,18 +106,19 @@ themes `modules/example/themes/blue/core/loginuserpass.twig`. public -: All files stored in this directory will be available by - accessing the URL - `https://.../simplesamlphp/module.php//`. - For example, if a script named `login.php` is stored in - `modules/example/public/`, it can be accessed by the URL - `https://.../simplesamlphp/module.php/example/login.php`. - -: To retrieve this URL, the - `SimpleSAML\Module::getModuleURL($resource)`-function can be used. - This function takes in a resource on the form `/`. - This function will then return a URL to the given file in the - `public`-directory of `module`. +: This directory is reserved for browser assets only. Static files + stored below `modules//public/assets/` are published to + `public/assets//...` and are then available at URLs on the + form `https://.../simplesamlphp/assets//`. + +: After adding or changing files in `modules//public/assets/`, + run `composer assets:publish` (or `php bin/console assets:publish`) + so the published copies in `public/assets//` are updated. + +: Dynamic PHP scripts in `modules//public/` are no longer + supported. Dynamic module behavior must be implemented with + controllers and routes, which are exposed under + `https://.../simplesamlphp/module//...`. ## Authentication sources diff --git a/docs/simplesamlphp-reference-idp-hosted.md b/docs/simplesamlphp-reference-idp-hosted.md index b17e1d2e10..b6d5ca0a79 100644 --- a/docs/simplesamlphp-reference-idp-hosted.md +++ b/docs/simplesamlphp-reference-idp-hosted.md @@ -306,12 +306,12 @@ The following SAML 2.0 options are available: `SingleSignOnService` : Override the default URL for the SingleSignOnService for this IdP. This is an absolute URL. The default value is - `/module.php/saml/idp/singleSignOnService` + `/module/saml/idp/singleSignOnService` : Note that this only changes the values in the generated metadata and in the messages sent to others. You must also - configure your webserver to deliver this URL to the correct PHP - page. + configure your webserver to route this URL through the + front controller in `public/index.php`. `SingleSignOnServiceBinding` : List of SingleSignOnService bindings that the IdP will claim support for. @@ -327,12 +327,12 @@ The following SAML 2.0 options are available: `SingleLogoutService` : Override the default URL for the SingleLogoutService for this IdP. This is an absolute URL. The default value is - `/module.php/saml/idp/singleLogout` + `/module/saml/idp/singleLogout` : Note that this only changes the values in the generated metadata and in the messages sent to others. You must also - configure your webserver to deliver this URL to the correct PHP - page. + configure your webserver to route this URL through the + front controller in `public/index.php`. `SingleLogoutServiceBinding` : List of SingleLogoutService bindings the IdP will claim support for. diff --git a/docs/simplesamlphp-sp-api.md b/docs/simplesamlphp-sp-api.md index dcb31860bd..b1f50e1b7f 100644 --- a/docs/simplesamlphp-sp-api.md +++ b/docs/simplesamlphp-sp-api.md @@ -285,7 +285,7 @@ The URL returned by this function is static, and will not change. You can easily create your own links without using this function. The URL should be: -`.../simplesaml/module.php/core/login/?ReturnTo=` +`.../simplesaml/module/saml/sp/login/?ReturnTo=` ### getLogoutURL @@ -315,4 +315,4 @@ The URL returned by this function is static, and will not change. You can easily create your own links without using this function. The URL should be: -`.../simplesaml/module.php/core/logout/?ReturnTo=` +`.../simplesaml/module/core/logout/?ReturnTo=` diff --git a/docs/simplesamlphp-sp.md b/docs/simplesamlphp-sp.md index 1e9f0a1958..bb4ad2748b 100644 --- a/docs/simplesamlphp-sp.md +++ b/docs/simplesamlphp-sp.md @@ -92,13 +92,13 @@ metadata file: $metadata['https://example.org/saml-idp'] = [ 'SingleSignOnService' => [ [ - 'Location' => 'https://example.org/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'https://example.org/simplesaml/module/saml/idp/singleSignOnService', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', ], ], 'SingleLogoutService' => [ [ - 'Location' => 'https://example.org/simplesaml/module.php/saml/idp/singleLogout', + 'Location' => 'https://example.org/simplesaml/module/saml/idp/singleLogout', 'ResponseLocation' => 'https://sp.example.org/LogoutResponse', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', ], @@ -115,7 +115,7 @@ files, see the [IdP remote reference](simplesamlphp-reference-idp-remote). If you have the metadata of the remote IdP as an XML file, you can use the built-in XML to SimpleSAMLphp metadata converter, which by default is -available at `/module.php/admin/federation/metadata-converter` in +available at `/module/admin/federation/metadata-converter` in your SimpleSAMLphp installation. Note that the idp-remote file lists all IdPs you trust. diff --git a/docs/simplesamlphp-testing-install.md b/docs/simplesamlphp-testing-install.md index afa893b848..aaacc8c6dd 100644 --- a/docs/simplesamlphp-testing-install.md +++ b/docs/simplesamlphp-testing-install.md @@ -4,7 +4,7 @@ ## Testing a SimpleSAMLphp installation -The admin interface available as `/module.php/admin/` on your site +The admin interface available as `/module/admin` on your site allows for testing logins to the authentication sources available on your installation. @@ -33,7 +33,7 @@ method allows for login without password so should be disabled in any non testing environment. The ProfileAuth functionality can be accessed through the path -`/module.php/admin/test` page using for example a `profileauth` +`/module/admin/test` page using for example a `profileauth` authentication source with the following `config.php` fragment. The module must be enabled (and admin to get to it easily) and a small diff --git a/docs/simplesamlphp-theming.md b/docs/simplesamlphp-theming.md index da7c888ebe..1887f6d2d8 100644 --- a/docs/simplesamlphp-theming.md +++ b/docs/simplesamlphp-theming.md @@ -104,7 +104,7 @@ In the `modules/mymodule/themes/fancytheme/default/_header.twig` file, type in s ## Adding resource files -You can put resource files within the `public/assets` folder of your module, to make your module completely independent with included css, icons etc. +You can put resource files within the `public/assets` folder of your module, to make your module completely independent with included css, icons etc. These assets are published to `public/assets//...` and served directly by the web server. ```bash modules @@ -194,8 +194,8 @@ If you need to make more extensive customizations to the base template, you shou cp templates/base.twig modules/mymodule/themes/fancytheme/default/ ``` -Any references to `$this->data['baseurlpath']` in old-style templates can be replaced with `{{baseurlpath}}` in Twig templates. Likewise, references to `\SimpleSAML\Module::getModuleURL()` can be replaced with `{{baseurlpath}}module.php/mymodule/...` or the `asset()` function like shown above. -If you want to use the `asset()` function, you need to move the asserts from `public/` to `public/assets/`. +Any references to `$this->data['baseurlpath']` in old-style templates can be replaced with `{{baseurlpath}}` in Twig templates. Likewise, references to `\SimpleSAML\Module::getModuleURL()` should be replaced with routed URLs under `{{ baseurlpath }}module/...` or with the `asset()` function like shown above. +If you want to use the `asset()` function, you need to move the assets from `public/` to `public/assets/`. Within templates each module is defined as a separate namespace matching the module name. This allows one template to reference templates from other modules using Twig's `@namespace_name/template_path` notation. For instance, a template in `mymodule` can include the widget template from the `yourmodule` module using the notation `@yourmodule/widget.twig`. A special namespace, `__parent__`, exists to allow theme developers to more easily extend a module's stock template. diff --git a/docs/simplesamlphp-upgrade-notes-3.0.md b/docs/simplesamlphp-upgrade-notes-3.0.md new file mode 100644 index 0000000000..d2340285a3 --- /dev/null +++ b/docs/simplesamlphp-upgrade-notes-3.0.md @@ -0,0 +1,172 @@ +# Upgrade notes for SimpleSAMLphp 3.0 + +SimpleSAMLphp 3.0 introduces a routing architecture based on a single +global Symfony kernel and a front controller in `public/index.php`. +The following changes are relevant for installers, operators, and +module developers. + +## Software requirements + +- The minimum PHP version required is now PHP 8.5. + +## Web entrypoints and routing + +SimpleSAMLphp now handles supported web requests through +`public/index.php`. + +- Dynamic module endpoints are exposed under `/module//...`. +- Module browser assets are published under `/assets//...`. +- The legacy `public/module.php` PHP entry script is no longer present; + all requests are handled by `public/index.php`. (Legacy + `module.php/...` *URLs* are still handled during the transition period — see + [Legacy `module.php` URL compatibility](#legacy-modulephp-url-compatibility) below.) +- The legacy `public/saml2/idp/*.php` scripts are no longer supported. + +If your deployment previously linked directly to `module.php` or other +public PHP scripts, update those URLs to the routed equivalents. + +Examples: + +- Admin interface: + - old: `/simplesaml/module.php/admin/` + - new: `/simplesaml/module/admin` +- Metadata converter: + - old: `/simplesaml/module.php/admin/federation/metadata-converter` + - new: `/simplesaml/module/admin/federation/metadata-converter` +- IdP SSO endpoint: + - old: `/simplesaml/module.php/saml/idp/singleSignOnService` + - new: `/simplesaml/module/saml/idp/singleSignOnService` +- SP metadata endpoint: + - old: `/simplesaml/module.php/saml/sp/metadata.php/default-sp` + - new: `/simplesaml/module/saml/sp/metadata/default-sp` +- Module asset: + - old: `/simplesaml/module.php/mymodule/assets/app.css` + - new: `/simplesaml/assets/mymodule/app.css` + +### Legacy `module.php` URL compatibility + +Changing the route of every endpoint also changes the URLs that appear +in SAML metadata — for example an IdP's SingleSignOnService, an SP's +AssertionConsumerService and SingleLogoutService, and the metadata +endpoints published by protocol modules such as `saml`, `oidc`, `casserver` +and `adfs`. Because authentication protocols typically work by exchanging +metadata between entities, a peer that still holds your pre-3.0 metadata +would otherwise send requests and responses to URLs that no longer exist, +breaking authentication until every peer refreshes its metadata. + +To keep existing federations working across the upgrade, v3.0 serves +every module route under both the new `/module//...` path and +the legacy `/module.php//...` path. The legacy paths are served +**natively by the same controllers** — they are not HTTP redirects. + +This compatibility layer is always on in v3.0 and requires no +configuration. However, **It is deprecated and scheduled for removal in a +future release.** Treat v3.0 as the transition window: republish your metadata +(and ask your federation peers to refresh theirs) with the new +`/module/...` URLs. Once all peers consume the updated metadata, the +legacy URLs are no longer needed, and a later release will remove them. +Also, make sure to update any hardcoded URLs in your own external applications, +templates, and modules, that call SimpleSAMLphp endpoints. + +## Custom error rendering + +The `errors.show_function` configuration option has been removed. +Custom error rendering is now handled through Symfony's event system. + +To customize error pages, create a `kernel.exception` event subscriber +in your module and register it with a priority higher than 200 (which +is the priority used by SimpleSAMLphp's built-in error handler). + +See [Error Handling](./simplesamlphp-errorhandling.md) for details and +a complete example. + +## Installer and operator impact + +Your web server must route non-file requests in `public/` to +`index.php`. + +- Apache deployments should use the provided `public/.htaccess` file or + equivalent rewrite rules in the virtual-host configuration. +- Nginx and other web servers must be configured with equivalent + front-controller routing. + +Static files under `public/assets/` continue to be served directly by +the web server. Dynamic requests should no longer be mapped to +individual PHP scripts inside `public/`. + +After upgrading, clear the cache so that any stale routing or +controller metadata is rebuilt: + +```sh +composer clear-symfony-cache +``` + +## Developer and module-author impact + +SimpleSAMLphp now runs a single global kernel that loads the services, +routes, and controllers for all enabled modules. + +- Dynamic module behavior must be implemented with routes and + controllers. +- `modules//public/` is no longer a place for PHP entry + scripts. +- Browser assets should live under `modules//public/assets/` + and be published to `public/assets//`. +- Callers, templates, and external integrations should stop generating + `module.php/...` URLs. + +For module URLs, use the URL helpers provided by SimpleSAMLphp instead +of hardcoding legacy paths. Use `\SimpleSAML\Module::getModuleURL()`, +which builds a `/module/...` URL under the configured `baseurlpath`. The +`$resource` argument is the module-relative path (without a leading +slash), and optional query parameters can be passed as the second +argument: + +```php +use SimpleSAML\Module; + +// before (legacy): .../simplesaml/module.php/saml/sp/metadata.php/default-sp +// after: .../simplesaml/module/saml/sp/metadata/default-sp +$url = Module::getModuleURL('saml/sp/metadata/default-sp'); + +// with query parameters +$url = Module::getModuleURL('core/logout', ['ReturnTo' => $returnTo]); +``` + +For assets, use the published asset URLs instead of the legacy +`module.php//...` paths. Use +`\SimpleSAML\Module::getModuleAssetUrl()`, which builds an +`/assets//...` URL under the configured `baseurlpath`: + +```php +use SimpleSAML\Module; + +// before (legacy): .../simplesaml/module.php/mymodule/assets/css/style.css +// after: .../simplesaml/assets/mymodule/css/style.css +$url = Module::getModuleAssetUrl('mymodule', 'css/style.css'); +``` + +In Twig templates, the same helpers are exposed as the `moduleURL()` and +`asset()` functions, so templates do not need to hardcode paths either: + +```twig + +Metadata +``` + +## General upgrade advice + +When upgrading an existing deployment: + +1. Update web server configuration so requests under the configured + `baseurlpath` reach `public/index.php`. +2. Replace documented or hardcoded `module.php/...` URLs with + `/module/...` URLs. +3. Replace legacy module asset URLs with `/assets//...`. +4. Review any custom modules for direct PHP entry scripts in + `modules//public/` and move that behavior into routed + controllers. +5. Remove `error.show_function` option from `config/config.php` if present. + If you used custom error function, move the implementation to event + subscribers instead. +6. Clear the Symfony cache after deployment. diff --git a/docs/simplesamlphp-upgrade-notes.md b/docs/simplesamlphp-upgrade-notes.md index 676f06b352..8d121642fc 100644 --- a/docs/simplesamlphp-upgrade-notes.md +++ b/docs/simplesamlphp-upgrade-notes.md @@ -3,6 +3,7 @@ See the following pages for important information for users upgrading from older versions of SimpleSAMLphp: +* [Upgrade notes for version 3.0](simplesamlphp-upgrade-notes-3.0) * [Upgrade notes for version 2.5](simplesamlphp-upgrade-notes-2.5) * [Upgrade notes for version 2.4](simplesamlphp-upgrade-notes-2.4) * [Upgrade notes for version 2.3](simplesamlphp-upgrade-notes-2.3) diff --git a/extra/simplesamlphp.spec b/extra/simplesamlphp.spec index 1878206a64..b04d33a3bf 100644 --- a/extra/simplesamlphp.spec +++ b/extra/simplesamlphp.spec @@ -1,6 +1,6 @@ %define name simplesamlphp %define summary SAML IDP/SP written in PHP -%define version 2.5.3 +%define version 3.0.0 %define release 1 %define license LGPL 2.1 %define group Networking/WWW diff --git a/modules/admin/src/Controller/Config.php b/modules/admin/src/Controller/Config.php index 09b26c031b..1ea2145cf4 100644 --- a/modules/admin/src/Controller/Config.php +++ b/modules/admin/src/Controller/Config.php @@ -210,11 +210,11 @@ protected function getPrerequisiteChecks(): array 'descr' => [ Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'), [ - '%minimum%' => '8.3', + '%minimum%' => '8.5', '%current%' => explode('-', phpversion())[0], ], ], - 'enabled' => version_compare(phpversion(), '8.3', '>='), + 'enabled' => version_compare(phpversion(), '8.5', '>='), ], ]; $store = $this->config->getOptionalString('store.type', null); diff --git a/modules/admin/src/Controller/Federation.php b/modules/admin/src/Controller/Federation.php index 68dfaa0530..f9fbf1291a 100644 --- a/modules/admin/src/Controller/Federation.php +++ b/modules/admin/src/Controller/Federation.php @@ -5,7 +5,6 @@ namespace SimpleSAML\Module\admin\Controller; use Exception; -use SAML2\Constants as C; use SimpleSAML\Assert\Assert; use SimpleSAML\Auth; use SimpleSAML\Configuration; @@ -21,6 +20,7 @@ use SimpleSAML\Module\adfs\IdP\MetadataBuilder as ADFS_MetadataBuilder; use SimpleSAML\Module\admin\Event\FederationPageEvent; use SimpleSAML\Module\saml\IdP\SAML2 as SAML2_IdP; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; use SimpleSAML\XHTML\Template; use Symfony\Component\HttpFoundation\Request; diff --git a/modules/core/routing/routes/routes.yml b/modules/core/routing/routes/routes.yml index 8ce7680a0a..4376115f9e 100644 --- a/modules/core/routing/routes/routes.yml +++ b/modules/core/routing/routes/routes.yml @@ -18,7 +18,7 @@ core-legacy-login: path: /login/{as} defaults: { _controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', - path: /module.php/saml/sp/login/, permanent: true + path: /module/saml/sp/login/, permanent: true } methods: [GET] diff --git a/modules/core/src/Auth/Process/TargetedID.php b/modules/core/src/Auth/Process/TargetedID.php index 1bfb81c96d..19059f6915 100644 --- a/modules/core/src/Auth/Process/TargetedID.php +++ b/modules/core/src/Auth/Process/TargetedID.php @@ -5,11 +5,11 @@ namespace SimpleSAML\Module\core\Auth\Process; use Exception; -use SAML2\Constants; use SAML2\XML\saml\NameID; use SimpleSAML\Assert\Assert; use SimpleSAML\Auth; use SimpleSAML\Logger; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -140,7 +140,7 @@ public function process(array &$state): void // Convert the targeted ID to a SAML 2.0 name identifier element $nameId = new NameID(); $nameId->setValue($uid); - $nameId->setFormat(Constants::NAMEID_PERSISTENT); + $nameId->setFormat(C::NAMEID_PERSISTENT); if (isset($state['Source']['entityid'])) { $nameId->setNameQualifier($state['Source']['entityid']); diff --git a/modules/core/src/Auth/UserPassBase.php b/modules/core/src/Auth/UserPassBase.php index f96bb22e65..e34f6f7c5a 100644 --- a/modules/core/src/Auth/UserPassBase.php +++ b/modules/core/src/Auth/UserPassBase.php @@ -4,13 +4,13 @@ namespace SimpleSAML\Module\core\Auth; -use SAML2\Constants; use SimpleSAML\Assert\Assert; use SimpleSAML\Auth; use SimpleSAML\Configuration; use SimpleSAML\Error; use SimpleSAML\Logger; use SimpleSAML\Module; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -219,7 +219,7 @@ public function authenticate(array &$state): void // doesn't define how the credentials are transferred, but Office 365 // uses the Authorization header, so we will just use that in lieu of // other use cases. - if (isset($state['saml:Binding']) && $state['saml:Binding'] === Constants::BINDING_PAOS) { + if (isset($state['saml:Binding']) && $state['saml:Binding'] === C::BINDING_PAOS) { if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { Logger::error("ECP AuthnRequest did not contain Basic Authentication header"); // TODO Return a SOAP fault instead of using the current binding? diff --git a/modules/core/src/Controller/Logout.php b/modules/core/src/Controller/Logout.php index aef2fa3645..ee26e6fc38 100644 --- a/modules/core/src/Controller/Logout.php +++ b/modules/core/src/Controller/Logout.php @@ -6,7 +6,6 @@ use Exception as BuiltinException; use SAML2\Binding; -use SAML2\Constants; use SimpleSAML\Auth; use SimpleSAML\Configuration; use SimpleSAML\Error; @@ -15,6 +14,7 @@ use SimpleSAML\Logger; use SimpleSAML\Metadata\MetaDataStorageHandler; use SimpleSAML\Module\saml\Message; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Stats; use SimpleSAML\Utils; use SimpleSAML\XHTML\Template; @@ -233,7 +233,7 @@ public function logoutIframePost(Request $request): RunnableResponse 'idpEntityID' => $idpMetadata->getString('entityid'), ]); - $bindings = [Constants::BINDING_HTTP_POST]; + $bindings = [C::BINDING_HTTP_POST]; $dst = $spMetadata->getDefaultEndpoint('SingleLogoutService', $bindings); $binding = Binding::getBinding($dst['Binding']); diff --git a/modules/saml/routing/routes/routes.yml b/modules/saml/routing/routes/routes.yml index 3336a3dabf..ed057211b2 100644 --- a/modules/saml/routing/routes/routes.yml +++ b/modules/saml/routing/routes/routes.yml @@ -76,7 +76,7 @@ saml-legacy-sp-metadata: path: /sp/metadata.php/{sourceId} defaults: { _controller: 'SimpleSAML\Module\saml\Controller\ServiceProvider::metadata', - path: /saml/sp/metadata, permanent: true + path: /module/saml/sp/metadata, permanent: true } methods: [GET] diff --git a/modules/saml/src/Auth/Process/NameIDAttribute.php b/modules/saml/src/Auth/Process/NameIDAttribute.php index 735313beea..ee6f824245 100644 --- a/modules/saml/src/Auth/Process/NameIDAttribute.php +++ b/modules/saml/src/Auth/Process/NameIDAttribute.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Auth\Process; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Assert\Assert; use SimpleSAML\Auth\ProcessingFilter; use SimpleSAML\Error; @@ -120,7 +120,7 @@ public function process(array &$state): void Assert::notNull($rep->getValue()); if ($rep->getFormat() === null) { - $rep->setFormat(Constants::NAMEID_UNSPECIFIED); + $rep->setFormat(C::NAMEID_UNSPECIFIED); } if ($rep->getSPNameQualifier() === null) { diff --git a/modules/saml/src/Auth/Process/PersistentNameID.php b/modules/saml/src/Auth/Process/PersistentNameID.php index e6f6158d78..99cf9278cc 100644 --- a/modules/saml/src/Auth/Process/PersistentNameID.php +++ b/modules/saml/src/Auth/Process/PersistentNameID.php @@ -4,10 +4,10 @@ namespace SimpleSAML\Module\saml\Auth\Process; -use SAML2\Constants; use SimpleSAML\Error; use SimpleSAML\Logger; use SimpleSAML\Module\saml\BaseNameIDGenerator; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -38,7 +38,7 @@ public function __construct(array $config, $reserved) { parent::__construct($config, $reserved); - $this->format = Constants::NAMEID_PERSISTENT; + $this->format = C::NAMEID_PERSISTENT; if (!isset($config['identifyingAttribute'])) { throw new Error\Exception("PersistentNameID: Missing required option 'identifyingAttribute'."); diff --git a/modules/saml/src/Auth/Process/PersistentNameID2TargetedID.php b/modules/saml/src/Auth/Process/PersistentNameID2TargetedID.php index ad1fe9f27f..5de6e4d30f 100644 --- a/modules/saml/src/Auth/Process/PersistentNameID2TargetedID.php +++ b/modules/saml/src/Auth/Process/PersistentNameID2TargetedID.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Auth\Process; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Auth\ProcessingFilter; use SimpleSAML\Logger; @@ -62,14 +62,14 @@ public function __construct(array $config, $reserved) */ public function process(array &$state): void { - if (!isset($state['saml:NameID'][Constants::NAMEID_PERSISTENT])) { + if (!isset($state['saml:NameID'][C::NAMEID_PERSISTENT])) { Logger::warning( 'Unable to generate eduPersonTargetedID because no persistent NameID was available.', ); return; } /** @var \SAML2\XML\saml\NameID $nameID */ - $nameID = $state['saml:NameID'][Constants::NAMEID_PERSISTENT]; + $nameID = $state['saml:NameID'][C::NAMEID_PERSISTENT]; $state['Attributes'][$this->attribute] = [(!$this->nameId) ? $nameID->getValue() : $nameID]; } diff --git a/modules/saml/src/Auth/Process/SQLPersistentNameID.php b/modules/saml/src/Auth/Process/SQLPersistentNameID.php index 497bd5bdce..7d6feb5559 100644 --- a/modules/saml/src/Auth/Process/SQLPersistentNameID.php +++ b/modules/saml/src/Auth/Process/SQLPersistentNameID.php @@ -4,12 +4,12 @@ namespace SimpleSAML\Module\saml\Auth\Process; -use SAML2\Constants as C; use SimpleSAML\Error; use SimpleSAML\Logger; use SimpleSAML\Module\saml\BaseNameIDGenerator; use SimpleSAML\Module\saml\Error as SAMLError; use SimpleSAML\Module\saml\IdP\SQLNameID; +use SimpleSAML\SAML2\Constants as C; /** * Authentication processing filter to generate a persistent NameID. diff --git a/modules/saml/src/Auth/Process/TransientNameID.php b/modules/saml/src/Auth/Process/TransientNameID.php index 4b28ca897e..029759a503 100644 --- a/modules/saml/src/Auth/Process/TransientNameID.php +++ b/modules/saml/src/Auth/Process/TransientNameID.php @@ -4,8 +4,8 @@ namespace SimpleSAML\Module\saml\Auth\Process; -use SAML2\Constants; use SimpleSAML\Module\saml\BaseNameIDGenerator; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -26,7 +26,7 @@ public function __construct(array $config, $reserved) { parent::__construct($config, $reserved); - $this->format = Constants::NAMEID_TRANSIENT; + $this->format = C::NAMEID_TRANSIENT; } diff --git a/modules/saml/src/Controller/Proxy.php b/modules/saml/src/Controller/Proxy.php index 73ff5c5903..a483467b10 100644 --- a/modules/saml/src/Controller/Proxy.php +++ b/modules/saml/src/Controller/Proxy.php @@ -5,7 +5,7 @@ namespace SimpleSAML\Module\saml\Controller; use Exception; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Auth; use SimpleSAML\Configuration; use SimpleSAML\Error; @@ -94,7 +94,7 @@ public function invalidSession(Request $request): Response $this->authState::throwException( $state, new NoAvailableIDP( - Constants::STATUS_RESPONDER, + C::STATUS_RESPONDER, 'User refused to reauthenticate with any of the IdPs requested.', ), ); diff --git a/modules/saml/src/Controller/ServiceProvider.php b/modules/saml/src/Controller/ServiceProvider.php index a565061d8c..8a5c1a13c8 100644 --- a/modules/saml/src/Controller/ServiceProvider.php +++ b/modules/saml/src/Controller/ServiceProvider.php @@ -7,7 +7,6 @@ use Exception; use SAML2\Assertion; use SAML2\Binding; -use SAML2\Constants; use SAML2\Exception\Protocol\UnsupportedBindingException; use SAML2\HTTPArtifact; use SAML2\HTTPPost; @@ -26,6 +25,7 @@ use SimpleSAML\Metadata; use SimpleSAML\Module; use SimpleSAML\Module\saml\Auth\Source\SP; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Session; use SimpleSAML\Store\StoreFactory; use SimpleSAML\Utils; @@ -671,8 +671,8 @@ public function singleLogoutService(string $sourceId): RunnableResponse $dst = $idpMetadata->getEndpointPrioritizedByBinding( 'SingleLogoutService', [ - Constants::BINDING_HTTP_REDIRECT, - Constants::BINDING_HTTP_POST, + C::BINDING_HTTP_REDIRECT, + C::BINDING_HTTP_POST, ], ); diff --git a/modules/saml/src/Error/NoAuthnContext.php b/modules/saml/src/Error/NoAuthnContext.php index 7b1a5fee04..aa33a397ff 100644 --- a/modules/saml/src/Error/NoAuthnContext.php +++ b/modules/saml/src/Error/NoAuthnContext.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Error; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use Throwable; /** @@ -18,13 +18,13 @@ class NoAuthnContext extends \SimpleSAML\Module\saml\Error * NoAuthnContext error constructor. * * @param string $responsible A string telling who is responsible for this error. Can be one of the following: - * - \SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. - * - \SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. + * - \SimpleSAML\SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. + * - \SimpleSAML\SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. * @param string|null $message A short message explaining why this error happened. * @param \Throwable|null $cause An exception that caused this error. */ public function __construct(string $responsible, ?string $message = null, ?Throwable $cause = null) { - parent::__construct($responsible, Constants::STATUS_NO_AUTHN_CONTEXT, $message, $cause); + parent::__construct($responsible, C::STATUS_NO_AUTHN_CONTEXT, $message, $cause); } } diff --git a/modules/saml/src/Error/NoAvailableIDP.php b/modules/saml/src/Error/NoAvailableIDP.php index e515cb1f70..b0103d9207 100644 --- a/modules/saml/src/Error/NoAvailableIDP.php +++ b/modules/saml/src/Error/NoAvailableIDP.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Error; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use Throwable; /** @@ -18,13 +18,13 @@ class NoAvailableIDP extends \SimpleSAML\Module\saml\Error * NoAvailableIDP error constructor. * * @param string $responsible A string telling who is responsible for this error. Can be one of the following: - * - \SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. - * - \SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. + * - \SimpleSAML\SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. + * - \SimpleSAML\SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. * @param string|null $message A short message explaining why this error happened. * @param \Throwable|null $cause An exception that caused this error. */ public function __construct(string $responsible, ?string $message = null, ?Throwable $cause = null) { - parent::__construct($responsible, Constants::STATUS_NO_AVAILABLE_IDP, $message, $cause); + parent::__construct($responsible, C::STATUS_NO_AVAILABLE_IDP, $message, $cause); } } diff --git a/modules/saml/src/Error/NoPassive.php b/modules/saml/src/Error/NoPassive.php index bba588f1b6..3ce8cd5e49 100644 --- a/modules/saml/src/Error/NoPassive.php +++ b/modules/saml/src/Error/NoPassive.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Error; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use Throwable; /** @@ -18,13 +18,13 @@ class NoPassive extends \SimpleSAML\Module\saml\Error * NoPassive error constructor. * * @param string $responsible A string telling who is responsible for this error. Can be one of the following: - * - \SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. - * - \SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. + * - \SimpleSAML\SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. + * - \SimpleSAML\SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. * @param string|null $message A short message explaining why this error happened. * @param \Throwable|null $cause An exception that caused this error. */ public function __construct(string $responsible, ?string $message = null, ?Throwable $cause = null) { - parent::__construct($responsible, Constants::STATUS_NO_PASSIVE, $message, $cause); + parent::__construct($responsible, C::STATUS_NO_PASSIVE, $message, $cause); } } diff --git a/modules/saml/src/Error/NoSupportedIDP.php b/modules/saml/src/Error/NoSupportedIDP.php index 41cd41ae92..3cbb75a425 100644 --- a/modules/saml/src/Error/NoSupportedIDP.php +++ b/modules/saml/src/Error/NoSupportedIDP.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Error; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use Throwable; /** @@ -18,13 +18,13 @@ class NoSupportedIDP extends \SimpleSAML\Module\saml\Error * NoSupportedIDP error constructor. * * @param string $responsible A string telling who is responsible for this error. Can be one of the following: - * - \SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. - * - \SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. + * - \SimpleSAML\SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. + * - \SimpleSAML\SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. * @param string|null $message A short message explaining why this error happened. * @param \Throwable|null $cause An exception that caused this error. */ public function __construct(string $responsible, ?string $message = null, ?Throwable $cause = null) { - parent::__construct($responsible, Constants::STATUS_NO_SUPPORTED_IDP, $message, $cause); + parent::__construct($responsible, C::STATUS_NO_SUPPORTED_IDP, $message, $cause); } } diff --git a/modules/saml/src/Error/ProxyCountExceeded.php b/modules/saml/src/Error/ProxyCountExceeded.php index 984df91f9d..6aabbe73b3 100644 --- a/modules/saml/src/Error/ProxyCountExceeded.php +++ b/modules/saml/src/Error/ProxyCountExceeded.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Module\saml\Error; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use Throwable; /** @@ -18,13 +18,13 @@ class ProxyCountExceeded extends \SimpleSAML\Module\saml\Error * ProxyCountExceeded error constructor. * * @param string $responsible A string telling who is responsible for this error. Can be one of the following: - * - \SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. - * - \SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. + * - \SimpleSAML\SAML2\Constants::STATUS_RESPONDER: in case the error is caused by this SAML responder. + * - \SimpleSAML\SAML2\Constants::STATUS_REQUESTER: in case the error is caused by the SAML requester. * @param string|null $message A short message explaining why this error happened. * @param \Throwable|null $cause An exception that caused this error. */ public function __construct(string $responsible, ?string $message = null, ?Throwable $cause = null) { - parent::__construct($responsible, Constants::STATUS_PROXY_COUNT_EXCEEDED, $message, $cause); + parent::__construct($responsible, C::STATUS_PROXY_COUNT_EXCEEDED, $message, $cause); } } diff --git a/modules/saml/src/IdP/SAML2.php b/modules/saml/src/IdP/SAML2.php index dbab0a355e..2ce81b2f29 100644 --- a/modules/saml/src/IdP/SAML2.php +++ b/modules/saml/src/IdP/SAML2.php @@ -10,7 +10,6 @@ use SAML2\Assertion; use SAML2\AuthnRequest; use SAML2\Binding; -use SAML2\Constants; use SAML2\EncryptedAssertion; use SAML2\Exception\Protocol\UnsupportedBindingException; use SAML2\HTTPRedirect; @@ -34,6 +33,7 @@ use SimpleSAML\Metadata\MetaDataStorageHandler; use SimpleSAML\Module; use SimpleSAML\Module\saml\Message; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Stats; use SimpleSAML\Utils; use SimpleSAML\XML\DOMDocumentFactory; @@ -308,15 +308,15 @@ public static function receiveAuthnRequest(IdP $idp): void $idpMetadata = $idp->getConfig(); $httpUtils = new Utils\HTTP(); - $supportedBindings = [Constants::BINDING_HTTP_POST]; + $supportedBindings = [C::BINDING_HTTP_POST]; if ($idpMetadata->getOptionalBoolean('saml20.sendartifact', false)) { - $supportedBindings[] = Constants::BINDING_HTTP_ARTIFACT; + $supportedBindings[] = C::BINDING_HTTP_ARTIFACT; } if ($idpMetadata->getOptionalBoolean('saml20.hok.assertion', false)) { - $supportedBindings[] = Constants::BINDING_HOK_SSO; + $supportedBindings[] = C::BINDING_HOK_SSO; } if ($idpMetadata->getOptionalBoolean('saml20.ecp', false)) { - $supportedBindings[] = Constants::BINDING_PAOS; + $supportedBindings[] = C::BINDING_PAOS; } $authnRequestSigned = false; @@ -556,8 +556,8 @@ public static function sendLogoutRequest(IdP $idp, array $association, ?string $ $dst = $spMetadata->getEndpointPrioritizedByBinding( 'SingleLogoutService', [ - Constants::BINDING_HTTP_REDIRECT, - Constants::BINDING_HTTP_POST, + C::BINDING_HTTP_REDIRECT, + C::BINDING_HTTP_POST, ], ); $binding = Binding::getBinding($dst['Binding']); @@ -593,8 +593,8 @@ public static function sendLogoutResponse(IdP $idp, array $state): void if (isset($state['core:Failed']) && $state['core:Failed']) { $partial = true; $lr->setStatus([ - 'Code' => Constants::STATUS_SUCCESS, - 'SubCode' => Constants::STATUS_PARTIAL_LOGOUT, + 'Code' => C::STATUS_SUCCESS, + 'SubCode' => C::STATUS_PARTIAL_LOGOUT, ]); Logger::info('Sending logout response for partial logout to SP ' . var_export($spEntityId, true)); } else { @@ -612,8 +612,8 @@ public static function sendLogoutResponse(IdP $idp, array $state): void $dst = $spMetadata->getEndpointPrioritizedByBinding( 'SingleLogoutService', [ - Constants::BINDING_HTTP_REDIRECT, - Constants::BINDING_HTTP_POST, + C::BINDING_HTTP_REDIRECT, + C::BINDING_HTTP_POST, ], ); $binding = Binding::getBinding($dst['Binding']); @@ -719,14 +719,14 @@ public static function getLogoutURL(IdP $idp, array $association, ?string $relay $spMetadata = $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote'); $bindings = [ - Constants::BINDING_HTTP_REDIRECT, - Constants::BINDING_HTTP_POST, + C::BINDING_HTTP_REDIRECT, + C::BINDING_HTTP_POST, ]; /** @var array $dst */ $dst = $spMetadata->getEndpointPrioritizedByBinding('SingleLogoutService', $bindings); - if ($dst['Binding'] === Constants::BINDING_HTTP_POST) { + if ($dst['Binding'] === C::BINDING_HTTP_POST) { $params = ['association' => $association['id'], 'idp' => $idp->getId()]; if ($relayState !== null) { $params['RelayState'] = $relayState; @@ -825,7 +825,7 @@ public static function getHostedMetadata(string $entityid, ?MetaDataStorageHandl 'entityid' => $entityid, 'SingleSignOnService' => $sso, 'SingleLogoutService' => $slo, - 'NameIDFormat' => $config->getOptionalArrayizeString('NameIDFormat', [Constants::NAMEID_TRANSIENT]), + 'NameIDFormat' => $config->getOptionalArrayizeString('NameIDFormat', [C::NAMEID_TRANSIENT]), ]; // metadata signing @@ -894,7 +894,7 @@ public static function getHostedMetadata(string $entityid, ?MetaDataStorageHandl if ($config->getOptionalBoolean('saml20.sendartifact', false)) { $metadata['ArtifactResolutionService'][] = [ 'index' => 0, - 'Binding' => Constants::BINDING_SOAP, + 'Binding' => C::BINDING_SOAP, 'Location' => Module::getModuleURL('saml/idp/artifactResolutionService'), ]; } @@ -904,8 +904,8 @@ public static function getHostedMetadata(string $entityid, ?MetaDataStorageHandl array_unshift( $metadata['SingleSignOnService'], [ - 'hoksso:ProtocolBinding' => Constants::BINDING_HTTP_REDIRECT, - 'Binding' => Constants::BINDING_HOK_SSO, + 'hoksso:ProtocolBinding' => C::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HOK_SSO, 'Location' => Module::getModuleURL('saml/idp/singleSignOnService'), ], ); @@ -915,7 +915,7 @@ public static function getHostedMetadata(string $entityid, ?MetaDataStorageHandl if ($config->getOptionalBoolean('saml20.ecp', false)) { $metadata['SingleSignOnService'][] = [ 'index' => 0, - 'Binding' => Constants::BINDING_SOAP, + 'Binding' => C::BINDING_SOAP, 'Location' => Module::getModuleURL('saml/idp/singleSignOnService'), ]; } @@ -1110,7 +1110,7 @@ private static function getAttributeNameFormat( } // default - return Constants::NAMEFORMAT_URI; + return C::NAMEFORMAT_URI; } @@ -1150,7 +1150,7 @@ private static function buildAssertion( $issuer = new Issuer(); $issuer->setValue($state['IdPMetadata']['entityid']); - $issuer->setFormat(Constants::NAMEID_ENTITY); + $issuer->setFormat(C::NAMEID_ENTITY); $a->setIssuer($issuer); $audience = array_merge([$spMetadata->getString('entityid')], $spMetadata->getOptionalArray('audience', [])); @@ -1171,9 +1171,9 @@ private static function buildAssertion( // AuthnContext has been set by the upper IdP in front of the proxy, pass it back to the SP behind the proxy $a->setAuthnContextClassRef($state['saml:sp:AuthnContext']); } elseif ($httpUtils->isHTTPS()) { - $a->setAuthnContextClassRef(Constants::AC_PASSWORD_PROTECTED_TRANSPORT); + $a->setAuthnContextClassRef(C::AC_PASSWORD_PROTECTED_TRANSPORT); } else { - $a->setAuthnContextClassRef(Constants::AC_PASSWORD); + $a->setAuthnContextClassRef(C::AC_PASSWORD); } $sessionStart = $now; @@ -1197,7 +1197,7 @@ private static function buildAssertion( // ProtcolBinding of SP's overwrites IdP hosted metadata configuration $hokAssertion = null; - if ($state['saml:Binding'] === Constants::BINDING_HOK_SSO) { + if ($state['saml:Binding'] === C::BINDING_HOK_SSO) { $hokAssertion = true; } if ($hokAssertion === null) { @@ -1206,7 +1206,7 @@ private static function buildAssertion( if ($hokAssertion) { // Holder-of-Key - $sc->setMethod(Constants::CM_HOK); + $sc->setMethod(C::CM_HOK); if ($httpUtils->isHTTPS()) { if (isset($_SERVER['SSL_CLIENT_CERT']) && !empty($_SERVER['SSL_CLIENT_CERT'])) { @@ -1243,7 +1243,7 @@ private static function buildAssertion( } } else { // Bearer - $sc->setMethod(Constants::CM_BEARER); + $sc->setMethod(C::CM_BEARER); } $sc->setSubjectConfirmationData($scd); $a->setSubjectConfirmation([$sc]); @@ -1292,7 +1292,7 @@ private static function generateNameId( $nameIdFormat = current($spMetadata->getOptionalArrayizeString('NameIDFormat', [])); if ($nameIdFormat === false) { $nameIdFormat = current( - $idpMetadata->getOptionalArrayizeString('NameIDFormat', [Constants::NAMEID_TRANSIENT]), + $idpMetadata->getOptionalArrayizeString('NameIDFormat', [C::NAMEID_TRANSIENT]), ); } } @@ -1303,12 +1303,12 @@ private static function generateNameId( } // We have nothing else to work with, so default to transient - if ($nameIdFormat !== Constants::NAMEID_TRANSIENT) { + if ($nameIdFormat !== C::NAMEID_TRANSIENT) { Logger::notice(sprintf( 'Requested NameID of format %s, but can only provide transient', var_export($nameIdFormat, true), )); - $nameIdFormat = Constants::NAMEID_TRANSIENT; + $nameIdFormat = C::NAMEID_TRANSIENT; } $randomUtils = new Utils\Random(); @@ -1468,7 +1468,7 @@ private static function buildResponse( $r = new Response(); $issuer = new Issuer(); $issuer->setValue($idpMetadata->getString('entityid')); - $issuer->setFormat(Constants::NAMEID_ENTITY); + $issuer->setFormat(C::NAMEID_ENTITY); $r->setIssuer($issuer); $r->setDestination($consumerURL); diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000000..3aec5e27e5 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/_include.php b/public/_include.php index 0b2dba0128..d4b8782c8a 100644 --- a/public/_include.php +++ b/public/_include.php @@ -8,7 +8,7 @@ // initialize the autoloader require_once(dirname(__FILE__, 2) . '/src/_autoload.php'); -use SAML2\Compat\ContainerSingleton; +use SimpleSAML\SAML2\Compat\ContainerSingleton; use SimpleSAML\Compat\SspContainer; use SimpleSAML\Configuration; use SimpleSAML\Error; diff --git a/public/admin/index.php b/public/admin/index.php deleted file mode 100644 index f84b8167a2..0000000000 --- a/public/admin/index.php +++ /dev/null @@ -1,22 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); -$redirect = Module::getModuleURL('admin/'); -$response = new HTTP\RunnableResponse([$httpUtils, 'redirectTrustedURL'], [$redirect]); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} - -$response->send(); diff --git a/public/assets/admin/css/admin.css b/public/assets/admin/css/admin.css new file mode 100644 index 0000000000..d3765b9e2d --- /dev/null +++ b/public/assets/admin/css/admin.css @@ -0,0 +1,65 @@ +.enablebox table { + border: 1px solid #eee; + margin-left: 1em; +} + +.enablebox.mini table { + float: right; +} + +.enablebox tr td { + padding: 0.5px 1em 1px 0.5em; + margin: 0; +} + +.enablebox { + font-size: 85%; +} + +.enablebox tr.enabled td { + background: #eee; +} + +.enablebox tr.disabled td { + background: #ccc; +} + +fieldset.fancyfieldset { + padding-left: 1.5em; +} + +fieldset.fancyfieldset legend { + padding: 3px 2em 3px 0; + width: 100%; +} + +dt { + font-weight: bold; +} + +.entity-name, +.entity-deprecated, +.entity-expired { + font-weight: bold; +} + +.entity-expired { + color: #500; +} + +ul.modulelist { + column-count: 3; +} + +div.code-box-content { + padding: 0; +} + +.wrapping-menu { + white-space: normal; +} + +.wrapping-menu .pure-menu-list { + display: flex; + flex-wrap: wrap; +} diff --git a/public/assets/admin/js/metadata-converter.js b/public/assets/admin/js/metadata-converter.js new file mode 100644 index 0000000000..a3f7944201 --- /dev/null +++ b/public/assets/admin/js/metadata-converter.js @@ -0,0 +1,5 @@ +document.getElementById('file-input').addEventListener('change', function () { + var showFile = document.getElementById('show-file'); + var replacement = document.createTextNode(this.files.item(0).name); + showFile.replaceChild(replacement, showFile.childNodes[0]); +}); diff --git a/public/assets/core/js/loginuserpass.js b/public/assets/core/js/loginuserpass.js new file mode 100644 index 0000000000..7a258b27dd --- /dev/null +++ b/public/assets/core/js/loginuserpass.js @@ -0,0 +1,17 @@ +ready(function () { + window.onpageshow = function () { + var button = document.getElementById("submit_button"); + var replacement = document.createTextNode(button.getAttribute("data-default")); + button.replaceChild(replacement, button.childNodes[0]); + button.disabled = false; + }; + + var form = document.getElementById("f"); + form.onsubmit = function () { + var button = document.getElementById("submit_button"); + var replacement = document.createTextNode(button.getAttribute("data-processing")); + button.replaceChild(replacement, button.childNodes[0]); + button.disabled = true; + }; +}); + diff --git a/public/assets/cron/css/cron.css b/public/assets/cron/css/cron.css new file mode 100644 index 0000000000..d388c00fea --- /dev/null +++ b/public/assets/cron/css/cron.css @@ -0,0 +1,4 @@ +code#cronlist { + font-size: 0.7vw; + white-space: nowrap; +} diff --git a/public/assets/debugsp/css/splogintest.css b/public/assets/debugsp/css/splogintest.css new file mode 100644 index 0000000000..651a05f61e --- /dev/null +++ b/public/assets/debugsp/css/splogintest.css @@ -0,0 +1 @@ +/* blank file */ diff --git a/public/assets/exampleauth/css/default.css b/public/assets/exampleauth/css/default.css new file mode 100644 index 0000000000..58bce21a0b --- /dev/null +++ b/public/assets/exampleauth/css/default.css @@ -0,0 +1,23 @@ +h2 { + margin-bottom: 0; +} + +h2:hover { + margin-bottom: 0; +} + +a { + text-decoration: unset; +} + +a:hover { + color: unset; +} + +table.profile { + font-size: smaller; +} + +.profile td.key { + padding-right: 10px; +} diff --git a/public/index.php b/public/index.php index 5234b5e748..ed28d1e036 100644 --- a/public/index.php +++ b/public/index.php @@ -6,16 +6,9 @@ require_once('_include.php'); -$config = Configuration::getInstance(); -$httpUtils = new Utils\HTTP(); +$kernel = new Kernel(); +$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); +$response = $kernel->handle($request); -$headers = $config->getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); -$redirect = $config->getOptionalString('frontpage.redirect', Module::getModuleURL('core/welcome')); -$response = new HTTP\RunnableResponse([$httpUtils, 'redirectTrustedURL'], [$redirect]); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} $response->send(); +$kernel->terminate($request, $response); diff --git a/public/module.php b/public/module.php deleted file mode 100644 index 18ca9e8681..0000000000 --- a/public/module.php +++ /dev/null @@ -1,24 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = Module::process(); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/public/saml2/idp/ArtifactResolutionService.php b/public/saml2/idp/ArtifactResolutionService.php deleted file mode 100644 index e8a5bfd404..0000000000 --- a/public/saml2/idp/ArtifactResolutionService.php +++ /dev/null @@ -1,30 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = $controller->ArtifactResolutionService($request); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/public/saml2/idp/SSOService.php b/public/saml2/idp/SSOService.php deleted file mode 100644 index 52407bfac0..0000000000 --- a/public/saml2/idp/SSOService.php +++ /dev/null @@ -1,30 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = $controller->singleSignOnService($request); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/public/saml2/idp/SingleLogoutService.php b/public/saml2/idp/SingleLogoutService.php deleted file mode 100644 index ea8b1416d2..0000000000 --- a/public/saml2/idp/SingleLogoutService.php +++ /dev/null @@ -1,30 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = $controller->singleLogout($request); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/public/saml2/idp/initSLO.php b/public/saml2/idp/initSLO.php deleted file mode 100644 index 2037150800..0000000000 --- a/public/saml2/idp/initSLO.php +++ /dev/null @@ -1,30 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = $controller->initSingleLogout($request); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/public/saml2/idp/metadata.php b/public/saml2/idp/metadata.php deleted file mode 100644 index 650c71aeb6..0000000000 --- a/public/saml2/idp/metadata.php +++ /dev/null @@ -1,30 +0,0 @@ -getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); - -$response = $controller->metadata($request); -foreach ($headers as $header => $value) { - // Some pages may have specific requirements that we must follow. Don't touch them. - if (!$response->headers->has($header)) { - $response->headers->set($header, $value); - } -} -$response->send(); diff --git a/routing/routes/routes.yml b/routing/routes/routes.yml index ed6b53e704..b38c7d0b31 100644 --- a/routing/routes/routes.yml +++ b/routing/routes/routes.yml @@ -1,28 +1,63 @@ --- -remove_trailing_slash: - path: /{module}/{url} - defaults: { - _controller: SimpleSAML\Module::removeTrailingSlash - } - requirements: - url: ".*/$" +frontpage: + path: / + defaults: + _controller: 'SimpleSAML\Controller\FrontpageController::redirect' methods: [GET] -add_trailing_slash: - path: /{url} - defaults: { - _controller: SimpleSAML\Module::addTrailingSlash - } - requirements: - url: "[a-zA-Z0-9_-]+[^/]$" +frontpage-index: + path: /index.php + defaults: + _controller: 'SimpleSAML\Controller\FrontpageController::redirect' methods: [GET] admin-shortcut: path: /admin - defaults: { - _controller: 'SimpleSAML\Module\admin\Controller\Config::main', - path: /admin, - permanent: true - } + controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController + defaults: + route: admin-main methods: [GET] + +obsolete-route-redirect-admin-index: + path: /admin/index.php + controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController + defaults: + route: admin-main + methods: [GET] + +obsolete-route-gone-saml2-idp-ArtifactResolutionService: + path: /saml2/idp/ArtifactResolutionService.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The /saml2/idp entry points are no longer supported. Use the routed /module/saml endpoints instead.' + +obsolete-route-gone-saml2-idp-initSLO: + path: /saml2/idp/initSLO.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The /saml2/idp entry points are no longer supported. Use the routed /module/saml endpoints instead.' + +obsolete-route-gone-saml2-idp-metadata: + path: /saml2/idp/metadata.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The /saml2/idp entry points are no longer supported. Use the routed /module/saml endpoints instead.' + +obsolete-route-gone-saml2-idp-SingleLogoutService: + path: /saml2/idp/SingleLogoutService.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The /saml2/idp entry points are no longer supported. Use the routed /module/saml endpoints instead.' + +obsolete-route-gone-saml2-idp-SSOService: + path: /saml2/idp/SSOService.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The /saml2/idp entry points are no longer supported. Use the routed /module/saml endpoints instead.' + +obsolete-route-gone-module: + path: /module.php + controller: SimpleSAML\Controller\ObsoleteRouteController + defaults: + message: 'The module.php entry point is no longer supported.' diff --git a/routing/services/console.yml b/routing/services/console.yml index 942f3c8ea3..05aeed7e51 100644 --- a/routing/services/console.yml +++ b/routing/services/console.yml @@ -3,10 +3,14 @@ services: # default configuration for services in *this* file _defaults: - public: false + autowire: true + autoconfigure: true SimpleSAML\Command\SspCacheClearCommand: tags: ['console.command'] arguments: $cacheClearer: '@cache_clearer' $filesystem: '@filesystem' + + SimpleSAML\Command\AssetsPublishCommand: + tags: ['console.command'] diff --git a/routing/services/routing.yml b/routing/services/routing.yml deleted file mode 100644 index 7a30b1c46f..0000000000 --- a/routing/services/routing.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- - -services: - # default configuration for services in *this* file - _defaults: - public: false - - routing.resolver: - class: Symfony\Component\Config\Loader\LoaderResolver - - routing.loader.xml: - class: Symfony\Component\Routing\Loader\XmlFileLoader - arguments: - - '@file_locator' - tags: ['routing.loader'] - - routing.loader.yaml: - class: Symfony\Component\Routing\Loader\YamlFileLoader - arguments: - - '@file_locator' - tags: ['routing.loader'] - - routing.loader.php: - class: Symfony\Component\Routing\Loader\PhpFileLoader - arguments: - - '@file_locator' - tags: ['routing.loader'] - - routing.loader.glob: - class: Symfony\Component\Routing\Loader\GlobFileLoader - arguments: - - '@file_locator' - tags: ['routing.loader'] - - routing.loader.directory: - class: Symfony\Component\Routing\Loader\DirectoryLoader - arguments: - - '@file_locator' - tags: ['routing.loader'] - - routing.loader.service: - class: Symfony\Component\Routing\Loader\ContainerLoader - arguments: - - '@service_container' - tags: ['routing.loader'] - - routing.loader: - public: true - class: Symfony\Component\Config\Loader\DelegatingLoader - arguments: - - '@routing.resolver' - - {} - - router.default: - class: Symfony\Component\Routing\Router - arguments: - - '@routing.loader' - - 'kernel::loadRoutes' - - { - resource_type: 'service' - } - - '@?router.request_context' - - router: - alias: router.default - public: true - - router.request_context: - class: Symfony\Component\Routing\RequestContext - - router.router_listener: - class: Symfony\Component\HttpKernel\EventListener\RouterListener - arguments: - - '@router' - - '@request_stack' - - '@?router.request_context' diff --git a/routing/services/services.yml b/routing/services/services.yml deleted file mode 100644 index 0156131757..0000000000 --- a/routing/services/services.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- - -services: - # default configuration for services in *this* file - _defaults: - public: false - - request_stack: - class: Symfony\Component\HttpFoundation\RequestStack - public: true - - Symfony\Component\HttpFoundation\RequestStack: - alias: request_stack - - file_locator: - class: Symfony\Component\Config\FileLocator - - dispatcher: - class: Symfony\Component\EventDispatcher\EventDispatcher - calls: - - method: addSubscriber - arguments: - - '@router_listener' - - method: addSubscriber - arguments: - - '@response_listener' - - http_kernel: - class: Symfony\Component\HttpKernel\HttpKernel - public: true - arguments: - - '@dispatcher' - - '@controller_resolver' - - '@request_stack' - - '@argument_resolver' diff --git a/routing/services/simplesamlphp.yml b/routing/services/simplesamlphp.yml index 27a81a0d2c..c82bb6a33c 100644 --- a/routing/services/simplesamlphp.yml +++ b/routing/services/simplesamlphp.yml @@ -3,7 +3,8 @@ services: # default configuration for services in *this* file _defaults: - public: false + autowire: true + autoconfigure: true SimpleSAML\Configuration: factory: ['SimpleSAML\Configuration', 'getInstance'] @@ -11,11 +12,12 @@ services: SimpleSAML\Session: factory: ['SimpleSAML\Session', 'getSessionFromRequest'] - SimpleSAML\Auth\AuthenticationFactory: - class: SimpleSAML\Auth\AuthenticationFactory - arguments: - - '@SimpleSAML\Configuration' - - '@SimpleSAML\Session' + SimpleSAML\Auth\AuthenticationFactory: ~ - SimpleSAML\Utils\HTTP: - class: SimpleSAML\Utils\HTTP + SimpleSAML\Utils\HTTP: ~ + + SimpleSAML\EventSubscriber\ExceptionSubscriber: + tags: ['kernel.event_subscriber'] + + SimpleSAML\EventSubscriber\SecurityHeadersSubscriber: + tags: ['kernel.event_subscriber'] diff --git a/routing/services/web.yml b/routing/services/web.yml deleted file mode 100644 index fc910f081c..0000000000 --- a/routing/services/web.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -services: - # default configuration for services in *this* file - _defaults: - public: false - - controller_resolver: - class: Symfony\Component\HttpKernel\Controller\ContainerControllerResolver - arguments: - - '@service_container' - - argument_metadata_factory: - class: Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory - - argument_resolver: - class: Symfony\Component\HttpKernel\Controller\ArgumentResolver - arguments: - - '@argument_metadata_factory' - - '' - - response_listener: - class: Symfony\Component\HttpKernel\EventListener\ResponseListener - arguments: - - 'UTF-8' diff --git a/src/SimpleSAML/Asset/ModuleAssetPublisher.php b/src/SimpleSAML/Asset/ModuleAssetPublisher.php new file mode 100644 index 0000000000..92763b34a1 --- /dev/null +++ b/src/SimpleSAML/Asset/ModuleAssetPublisher.php @@ -0,0 +1,58 @@ +. + * + * @param string $baseDir + * @return string[] The list of modules whose published asset trees were updated. + */ + public function publish(string $baseDir): array + { + $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR); + $modulesDir = $baseDir . '/modules'; + $publicAssetsDir = $baseDir . '/public/assets'; + + $this->filesystem->mkdir($publicAssetsDir); + + $finder = new Finder(); + $finder->directories()->in($modulesDir)->depth(0); + + $published = []; + foreach ($finder as $moduleDir) { + $module = $moduleDir->getFilename(); + $sourceDir = $moduleDir->getRealPath() . '/public/assets'; + $targetDir = sprintf('%s/%s', $publicAssetsDir, $module); + + if (is_dir($sourceDir)) { + $this->filesystem->mirror($sourceDir, $targetDir, null, [ + 'override' => true, + 'delete' => true, + ]); + $published[] = $module; + } elseif (is_dir($targetDir)) { + $this->filesystem->remove($targetDir); + } + } + + return $published; + } +} diff --git a/src/SimpleSAML/Command/AssetsPublishCommand.php b/src/SimpleSAML/Command/AssetsPublishCommand.php new file mode 100644 index 0000000000..08b0dc992e --- /dev/null +++ b/src/SimpleSAML/Command/AssetsPublishCommand.php @@ -0,0 +1,41 @@ +publisher->publish(Configuration::getInstance()->getBaseDir()); + + if (empty($published)) { + $io->success('No module assets needed publishing.'); + } else { + $io->success('Published module assets for: ' . implode(', ', $published)); + } + + return Command::SUCCESS; + } +} diff --git a/src/SimpleSAML/Command/SspCacheClearCommand.php b/src/SimpleSAML/Command/SspCacheClearCommand.php index 272249dc94..9867a02cc6 100644 --- a/src/SimpleSAML/Command/SspCacheClearCommand.php +++ b/src/SimpleSAML/Command/SspCacheClearCommand.php @@ -6,10 +6,10 @@ use SimpleSAML\Configuration; use SimpleSAML\Error\CriticalConfigurationError; -use SimpleSAML\Kernel; -use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Bundle\FrameworkBundle\Console\Application as FrameworkApplication; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -21,25 +21,17 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface; -use Symfony\Component\HttpKernel\Kernel as BaseKernel; -use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\RebootableInterface; #[AsCommand( name: 'ssp-cache:clear', - description: 'SimpleSamlPHP cache clear command. Clear the SimpleSamlPHP and all modules cache.', + description: 'SimpleSamlPHP cache clear command. Clear and warm up the global application cache.', )] class SspCacheClearCommand extends Command { /** @var \Symfony\Component\Filesystem\Filesystem */ private Filesystem $filesystem; - /** @var array */ - private array $enabledModules; - - /** @var \Symfony\Component\HttpKernel\KernelInterface */ - private KernelInterface $temporaryKernel; - /** * @param \Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface $cacheClearer @@ -51,24 +43,6 @@ public function __construct( ) { parent::__construct(); $this->filesystem = $filesystem ?? new Filesystem(); - - $this->temporaryKernel = new class ('test', true) extends BaseKernel { - public function registerBundles(): iterable - { - return []; - } - - - public function registerContainerConfiguration(LoaderInterface $loader): void - { - } - - - public function getContainerClass(): string - { - return parent::getContainerClass(); - } - }; } @@ -104,153 +78,134 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io = new SymfonyStyle($input, $output); $fs = $this->filesystem; try { - $this->enabledModules = Configuration::getInstance()->getArray('module.enable'); - } catch (CriticalConfigurationError $e) { + Configuration::getInstance(); + } catch (CriticalConfigurationError) { $io->comment('Error:configuration file not found'); - exit; - } - $io->comment('Starting the SimpleSamlPHP cache clearing process.'); - - $application = $this->getApplication(); - - if ($application === null) { - $io->error('Application instance is not available.'); return Command::FAILURE; } + $io->comment('Starting the SimpleSAMLphp cache clearing process.'); - // Iterate and clean - foreach ($this->enabledModules as $module => $enabled) { - // Only work on enabled modules - if (!filter_var($enabled, FILTER_VALIDATE_BOOLEAN)) { - continue; - } - $io->comment(sprintf('Clearing cache for module: "%s".', $module)); - - $kernel = new Kernel($module); - $kernel->boot(); - - $realCacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir'); - $realBuildDir = $kernel->getContainer()->hasParameter('kernel.build_dir') - ? $kernel->getContainer()->getParameter('kernel.build_dir') : $realCacheDir; - // the old cache dir name must not be longer than the real one to avoid exceeding - // the maximum length of a directory or file path within it (esp. Windows MAX_PATH) - $oldCacheDir = substr($realCacheDir, 0, -1) . (str_ends_with($realCacheDir, '~') ? '+' : '~'); - $fs->remove($oldCacheDir); + $application = $this->getFrameworkApplication(); - if (!is_writable($realCacheDir)) { - throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realCacheDir)); - } + $kernel = $application->getKernel(); + $realCacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir'); + $realBuildDir = $kernel->getContainer()->hasParameter('kernel.build_dir') + ? $kernel->getContainer()->getParameter('kernel.build_dir') : $realCacheDir; + // the old cache dir name must not be longer than the real one to avoid exceeding + // the maximum length of a directory or file path within it (esp. Windows MAX_PATH) + $oldCacheDir = substr($realCacheDir, 0, -1) . (str_ends_with($realCacheDir, '~') ? '+' : '~'); + $fs->remove($oldCacheDir); - $useBuildDir = $realBuildDir !== $realCacheDir; - $oldBuildDir = substr($realBuildDir, 0, -1) . (str_ends_with($realBuildDir, '~') ? '+' : '~'); - if ($useBuildDir) { - $fs->remove($oldBuildDir); + if (!is_writable($realCacheDir)) { + throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realCacheDir)); + } - if (!is_writable($realBuildDir)) { - throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realBuildDir)); - } + $useBuildDir = $realBuildDir !== $realCacheDir; + $oldBuildDir = substr($realBuildDir, 0, -1) . (str_ends_with($realBuildDir, '~') ? '+' : '~'); + if ($useBuildDir) { + $fs->remove($oldBuildDir); - if ($this->isNfs($realCacheDir)) { - $fs->remove($realCacheDir); - } else { - $fs->rename($realCacheDir, $oldCacheDir); - } - $fs->mkdir($realCacheDir); + if (!is_writable($realBuildDir)) { + throw new RuntimeException(sprintf('Unable to write in the "%s" directory.', $realBuildDir)); } - if ($useBuildDir) { - $this->cacheClearer->clear($realBuildDir); + if ($this->isNfs($realCacheDir)) { + $fs->remove($realCacheDir); + } else { + $fs->rename($realCacheDir, $oldCacheDir); } - $this->cacheClearer->clear($realCacheDir); + $fs->mkdir($realCacheDir); + } - // The current event dispatcher is stale, let's not use it anymore - $this->getApplication()->setDispatcher(new EventDispatcher()); + $io->comment(sprintf( + 'Clearing the cache for the %s environment with debug %s.', + $kernel->getEnvironment(), + var_export($kernel->isDebug(), true), + )); + if ($useBuildDir) { + $this->cacheClearer->clear($realBuildDir); + } + $this->cacheClearer->clear($realCacheDir); - $containerFile = (new \ReflectionObject($kernel->getContainer()))->getFileName(); - $containerDir = basename(\dirname($containerFile)); + // The current event dispatcher is stale, let's not use it anymore + $application->setDispatcher(new EventDispatcher()); - // the warmup cache dir name must have the same length as the real one - // to avoid the many problems in serialized resources files - $warmupDir = substr($realBuildDir, 0, -1) . (str_ends_with($realBuildDir, '_') ? '-' : '_'); + $containerFile = (new \ReflectionObject($kernel->getContainer()))->getFileName(); + $containerDir = basename(\dirname($containerFile)); - if ($output->isVerbose() && $fs->exists($warmupDir)) { - $io->comment('Clearing outdated warmup directory...'); + // the warmup cache dir name must have the same length as the real one + // to avoid the many problems in serialized resources files + $warmupDir = substr($realBuildDir, 0, -1) . (str_ends_with($realBuildDir, '_') ? '-' : '_'); + + if ($output->isVerbose() && $fs->exists($warmupDir)) { + $io->comment('Clearing outdated warmup directory...'); + } + $fs->remove($warmupDir); + + if ($_SERVER['REQUEST_TIME'] <= filemtime($containerFile) && filemtime($containerFile) <= time()) { + if ($output->isVerbose()) { + $io->comment('Cache is fresh.'); } - $fs->remove($warmupDir); + if (!$input->getOption('no-warmup') && !$input->getOption('no-optional-warmers')) { + if ($output->isVerbose()) { + $io->comment('Warming up optional cache...'); + } + $this->warmupOptionals($realCacheDir, $realBuildDir, $io); + } + } else { + $fs->mkdir($warmupDir); - if ($_SERVER['REQUEST_TIME'] <= filemtime($containerFile) && filemtime($containerFile) <= time()) { + if (!$input->getOption('no-warmup')) { if ($output->isVerbose()) { - $io->comment('Cache is fresh.'); + $io->comment('Warming up cache...'); } - if (!$input->getOption('no-warmup') && !$input->getOption('no-optional-warmers')) { + $this->warmup($warmupDir, $realBuildDir); + + if (!$input->getOption('no-optional-warmers')) { if ($output->isVerbose()) { $io->comment('Warming up optional cache...'); } - $this->warmupOptionals($realCacheDir, $realBuildDir, $io); + $this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir, $io); } - } else { - $fs->mkdir($warmupDir); - if (!$input->getOption('no-warmup')) { - if ($output->isVerbose()) { - $io->comment('Warming up cache...'); + // fix references to cached files with the real cache directory name + $search = [ + $warmupDir, + str_replace('/', '\\/', $warmupDir), + str_replace('\\', '\\\\', $warmupDir), + ]; + $replace = str_replace('\\', '/', $realBuildDir); + foreach (Finder::create()->files()->in($warmupDir) as $file) { + $content = str_replace($search, $replace, file_get_contents($file), $count); + if ($count) { + file_put_contents($file, $content); } - $this->warmup($warmupDir, $realBuildDir); - - if (!$input->getOption('no-optional-warmers')) { - if ($output->isVerbose()) { - $io->comment('Warming up optional cache...'); - } - $this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir, $io); - } - - // fix references to cached files with the real cache directory name - $search = [ - $warmupDir, - str_replace('/', '\\/', $warmupDir), - str_replace('\\', '\\\\', $warmupDir), - ]; - $replace = str_replace('\\', '/', $realBuildDir); - foreach (Finder::create()->files()->in($warmupDir) as $file) { - $content = str_replace($search, $replace, file_get_contents($file), $count); - if ($count) { - file_put_contents($file, $content); - } - } - } - - if (!$fs->exists($warmupDir . '/' . $containerDir)) { - $fs->rename($realBuildDir . '/' . $containerDir, $warmupDir . '/' . $containerDir); - touch($warmupDir . '/' . $containerDir . '.legacy'); } + } - if ($this->isNfs($realBuildDir)) { - $noteMessage = 'For better performance, you should move ' - . 'the cache and log directories to a non-shared folder of the VM.'; - $io->note($noteMessage); - $fs->remove($realBuildDir); - } else { - $fs->rename($realBuildDir, $oldBuildDir); - } + if (!$fs->exists($warmupDir . '/' . $containerDir)) { + $fs->rename($realBuildDir . '/' . $containerDir, $warmupDir . '/' . $containerDir); + touch($warmupDir . '/' . $containerDir . '.legacy'); + } - $fs->rename($warmupDir, $realBuildDir); + if ($this->isNfs($realBuildDir)) { + $noteMessage = 'For better performance, you should move ' + . 'the cache and log directories to a non-shared folder of the VM.'; + $io->note($noteMessage); + $fs->remove($realBuildDir); + } else { + $fs->rename($realBuildDir, $oldBuildDir); + } - if ($output->isVerbose()) { - $io->comment('Removing old build and cache directory...'); - } + $fs->rename($warmupDir, $realBuildDir); - if ($useBuildDir) { - try { - $fs->remove($oldBuildDir); - } catch (IOException $e) { - if ($output->isVerbose()) { - $io->warning($e->getMessage()); - } - } - } + if ($output->isVerbose()) { + $io->comment('Removing old build and cache directory...'); + } + if ($useBuildDir) { try { - $fs->remove($oldCacheDir); + $fs->remove($oldBuildDir); } catch (IOException $e) { if ($output->isVerbose()) { $io->warning($e->getMessage()); @@ -258,20 +213,24 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } - if ($output->isVerbose()) { - $io->comment('Finished'); + try { + $fs->remove($oldCacheDir); + } catch (IOException $e) { + if ($output->isVerbose()) { + $io->warning($e->getMessage()); + } } + } - $io->comment( - sprintf('Cache for module: "%s" was successfully cleared.', $module), - ); - - - // Shutdown and restart - $kernel->shutdown(); + if ($output->isVerbose()) { + $io->comment('Finished'); } - $io->success('SimpleSAML and Modules cache clearing completed successfully!'); + $io->success(sprintf( + 'Cache for the "%s" environment (debug=%s) was successfully cleared.', + $kernel->getEnvironment(), + var_export($kernel->isDebug(), true), + )); return Command::SUCCESS; } @@ -315,8 +274,7 @@ private function isNfs(string $dir): bool */ private function warmup(string $warmupDir, string $realBuildDir): void { - // create a temporary kernel - $kernel = $this->temporaryKernel; + $kernel = $this->getFrameworkApplication()->getKernel(); if (!$kernel instanceof RebootableInterface) { $throwMessage = 'Calling "cache:clear" with a kernel that does not implement ' . '"Symfony\Component\HttpKernel\RebootableInterface" is not supported.'; @@ -333,7 +291,7 @@ private function warmup(string $warmupDir, string $realBuildDir): void */ private function warmupOptionals(string $cacheDir, string $warmupDir, SymfonyStyle $io): void { - $kernel = $this->temporaryKernel; + $kernel = $this->getFrameworkApplication()->getKernel(); $warmer = $kernel->getContainer()->get('cache_warmer'); // non optional warmers already ran during container compilation $warmer->enableOnlyOptionalWarmers(); @@ -347,4 +305,15 @@ private function warmupOptionals(string $cacheDir, string $warmupDir, SymfonySty Preloader::append($preloadFile, $preload); } } + + + private function getFrameworkApplication(): FrameworkApplication + { + $application = $this->getApplication(); + if (!$application instanceof FrameworkApplication) { + throw new LogicException('Framework application instance is not available.'); + } + + return $application; + } } diff --git a/src/SimpleSAML/Compat/SspContainer.php b/src/SimpleSAML/Compat/SspContainer.php index 1c7c5c13f8..028523d482 100644 --- a/src/SimpleSAML/Compat/SspContainer.php +++ b/src/SimpleSAML/Compat/SspContainer.php @@ -4,8 +4,11 @@ namespace SimpleSAML\Compat; +use Beste\Clock\LocalizedClock; +use DateTimeZone; +use Psr\Clock\ClockInterface; use Psr\Log\LoggerInterface; -use SAML2\Compat\AbstractContainer; +use SimpleSAML\SAML2\Compat\AbstractContainer; use SimpleSAML\Utils; class SspContainer extends AbstractContainer @@ -109,6 +112,29 @@ public function writeFile(string $filename, string $data, ?int $mode = null): vo /** + * Get the system clock + * + * @return \Psr\Clock\ClockInterface + */ + public function getClock(): ClockInterface + { + return LocalizedClock::in(new DateTimeZone('Z')); + } + + + /** + * Trigger the user to perform a POST to the given URL with the given data. + * + * @param string $url + * @param array $data + */ + public function getPOSTRedirectURL(string $url, array $data = []): string + { + return $httpUtils->getPOSTRedirectURL($url, $data); + } + + + /* */ public function getInflateSizeLimit(): int { diff --git a/src/SimpleSAML/Configuration.php b/src/SimpleSAML/Configuration.php index 834a5b29ec..eba82dfcfe 100644 --- a/src/SimpleSAML/Configuration.php +++ b/src/SimpleSAML/Configuration.php @@ -7,10 +7,10 @@ use Exception; use ParseError; use SAML2\Binding; -use SAML2\Constants; use SAML2\Exception\Protocol\UnsupportedBindingException; use SimpleSAML\Assert\Assert; use SimpleSAML\Error; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; use Symfony\Component\Filesystem\Filesystem; @@ -1178,12 +1178,12 @@ private function getDefaultBinding(string $endpointType): string case 'saml20-idp-remote:SingleSignOnService': case 'saml20-idp-remote:SingleLogoutService': case 'saml20-sp-remote:SingleLogoutService': - return Constants::BINDING_HTTP_REDIRECT; + return C::BINDING_HTTP_REDIRECT; case 'saml20-sp-remote:AssertionConsumerService': - return Constants::BINDING_HTTP_POST; + return C::BINDING_HTTP_POST; case 'saml20-idp-remote:ArtifactResolutionService': case 'attributeauthority-remote:AttributeService': - return Constants::BINDING_SOAP; + return C::BINDING_SOAP; default: throw new Exception('Missing default binding for ' . $endpointType . ' in ' . $set); } diff --git a/src/SimpleSAML/Console/Application.php b/src/SimpleSAML/Console/Application.php index c5dd8af612..86f42876e7 100644 --- a/src/SimpleSAML/Console/Application.php +++ b/src/SimpleSAML/Console/Application.php @@ -6,7 +6,6 @@ use SimpleSAML\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application as BaseApplication; -use Symfony\Component\Console\Input\InputOption; class Application extends BaseApplication { @@ -16,10 +15,5 @@ class Application extends BaseApplication public function __construct(Kernel $kernel) { parent::__construct($kernel); - - $inputDefinition = $this->getDefinition(); - $inputDefinition->addOption( - new InputOption('--module', '-m', InputOption::VALUE_REQUIRED, 'The module name', $kernel->getModule()), - ); } } diff --git a/src/SimpleSAML/Controller/FrontpageController.php b/src/SimpleSAML/Controller/FrontpageController.php new file mode 100644 index 0000000000..7eef104bef --- /dev/null +++ b/src/SimpleSAML/Controller/FrontpageController.php @@ -0,0 +1,23 @@ +getOptionalString('frontpage.redirect', Module::getModuleURL('core/welcome')); + + return new RunnableResponse([$httpUtils, 'redirectTrustedURL'], [$redirect]); + } +} diff --git a/src/SimpleSAML/Controller/ObsoleteRouteController.php b/src/SimpleSAML/Controller/ObsoleteRouteController.php new file mode 100644 index 0000000000..54266ef002 --- /dev/null +++ b/src/SimpleSAML/Controller/ObsoleteRouteController.php @@ -0,0 +1,21 @@ + 'text/plain; charset=UTF-8'], + ); + } +} diff --git a/src/SimpleSAML/Error/Error.php b/src/SimpleSAML/Error/Error.php index 21a3b0eb66..d66c259401 100644 --- a/src/SimpleSAML/Error/Error.php +++ b/src/SimpleSAML/Error/Error.php @@ -4,7 +4,6 @@ namespace SimpleSAML\Error; -use SimpleSAML\Assert\Assert; use SimpleSAML\Configuration; use SimpleSAML\Logger; use SimpleSAML\Module; @@ -174,17 +173,6 @@ public function getDictDescr(): string } - /** - * Set the HTTP return code for this error. - * - * This should be overridden by subclasses who want a different return code than 500 Internal Server Error. - */ - protected function setHTTPCode(): void - { - http_response_code($this->httpCode); - } - - /** * Save an error report. * @@ -228,14 +216,15 @@ protected function saveError(): array /** - * Display this error. + * Render this error as a Template. * - * This method displays a standard SimpleSAMLphp error page and exits. + * This method builds a standard SimpleSAMLphp error page as a Template object. * * @param int $logLevel The log-level for this exception * @param bool $suppressReport Whether or not sending an error report is an option + * @return \SimpleSAML\XHTML\Template The template representing the error page. */ - public function show(int $logLevel = Logger::ERR, bool $suppressReport = false): void + public function render(int $logLevel = Logger::ERR, bool $suppressReport = false): Template { // log the error message $this->log($logLevel); @@ -277,28 +266,36 @@ public function show(int $logLevel = Logger::ERR, bool $suppressReport = false): } } - $show_function = $config->getOptionalArray('errors.show_function', null); - if (isset($show_function)) { - Assert::isCallable($show_function); - $this->setHTTPCode(); - call_user_func($show_function, $config, $data); - Assert::true(false); - } else { - $t = new Template($config, 'error.twig'); - - // Include translations for the module that holds the included template - if ($this->includeTemplate !== null) { - $module = explode(':', $this->includeTemplate, 2); - if (count($module) === 2 && Module::isModuleEnabled($module[0])) { - $t->getLocalization()->addModuleDomain($module[0]); - } - } + $t = new Template($config, 'error.twig'); - $t->setStatusCode($this->httpCode); - $t->data = array_merge($t->data, $data); - $t->send(); + // Include translations for the module that holds the included template + if ($this->includeTemplate !== null) { + $module = explode(':', $this->includeTemplate, 2); + if (count($module) === 2 && Module::isModuleEnabled($module[0])) { + $t->getLocalization()->addModuleDomain($module[0]); + } } + $t->setStatusCode($this->httpCode); + $t->data = array_merge($t->data, $data); + $t->setContent($t->getContents()); + + return $t; + } + + + /** + * Display this error. + * + * This method displays a standard SimpleSAMLphp error page and exits. + * + * @param int $logLevel The log-level for this exception + * @param bool $suppressReport Whether or not sending an error report is an option + */ + public function show(int $logLevel = Logger::ERR, bool $suppressReport = false): void + { + $response = $this->render($logLevel, $suppressReport); + $response->send(); exit; } } diff --git a/src/SimpleSAML/Error/ExceptionHandler.php b/src/SimpleSAML/Error/ExceptionHandler.php index 6720715631..437ec0f721 100644 --- a/src/SimpleSAML/Error/ExceptionHandler.php +++ b/src/SimpleSAML/Error/ExceptionHandler.php @@ -4,17 +4,15 @@ namespace SimpleSAML\Error; -use Error as BuiltinError; -use Exception as BuiltinException; use SimpleSAML\Event\Dispatcher\ModuleEventDispatcherFactory; use SimpleSAML\Event\ExceptionHandlerEvent; use SimpleSAML\Logger; use SimpleSAML\Module; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Throwable; -use function class_exists; - /** * SimpleSAMLphp's custom exception handler. * @@ -22,11 +20,25 @@ */ class ExceptionHandler { - /** - * @param \Throwable $exception - * @return void - */ + /** + * @param \Throwable $exception + * @return void + */ public function customExceptionHandler(Throwable $exception): void + { + $response = $this->handleException($exception); + $response->send(); + exit; + } + + + /** + * Handle an exception and return a Response. + * + * @param \Throwable $exception + * @return \Symfony\Component\HttpFoundation\Response + */ + public function handleException(Throwable $exception): Response { $eventDispatcher = ModuleEventDispatcherFactory::getInstance(); /** @var \SimpleSAML\Event\ExceptionHandlerEvent $event */ @@ -37,15 +49,20 @@ public function customExceptionHandler(Throwable $exception): void if ($exception instanceof MethodNotAllowedHttpException) { $e = new MethodNotAllowed($exception); - $e->show(Logger::DEBUG, true); - } elseif ($exception instanceof Error) { - $exception->show(); - } elseif ($exception instanceof BuiltinException) { - $e = new Error(ErrorCodes::UNHANDLEDEXCEPTION, $exception); - $e->show(); - } elseif (class_exists('Error') && $exception instanceof BuiltinError) { - $e = new Error(ErrorCodes::UNHANDLEDEXCEPTION, $exception); - $e->show(); + return $e->render(Logger::DEBUG, true); } + + if ($exception instanceof NotFoundHttpException) { + $e = new NotFound(); + return $e->render(Logger::DEBUG, true); + } + + if ($exception instanceof Error) { + return $exception->render(); + } + + // Fallback for any other Throwable (Exception, Error, etc.) + $e = new Error(ErrorCodes::UNHANDLEDEXCEPTION, $exception); + return $e->render(); } } diff --git a/src/SimpleSAML/EventSubscriber/ExceptionSubscriber.php b/src/SimpleSAML/EventSubscriber/ExceptionSubscriber.php new file mode 100644 index 0000000000..86bcb0e0de --- /dev/null +++ b/src/SimpleSAML/EventSubscriber/ExceptionSubscriber.php @@ -0,0 +1,45 @@ +> + */ + public static function getSubscribedEvents(): array + { + return [ + // Use a high priority to handle exceptions before Symfony's ErrorListener + KernelEvents::EXCEPTION => ['onKernelException', 200], + ]; + } + + + public function onKernelException(ExceptionEvent $event): void + { + $exception = $event->getThrowable(); + + $handler = new ExceptionHandler(); + $response = $handler->handleException($exception); + + $event->setResponse($response); + } +} diff --git a/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriber.php b/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriber.php new file mode 100644 index 0000000000..9a86e1c920 --- /dev/null +++ b/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriber.php @@ -0,0 +1,52 @@ +> + */ + public static function getSubscribedEvents(): array + { + return [ + KernelEvents::RESPONSE => ['onKernelResponse', 0], + ]; + } + + + public function onKernelResponse(ResponseEvent $event): void + { + if (!$event->isMainRequest()) { + return; + } + + $response = $event->getResponse(); + + $headers = $this->config->getOptionalArray('headers.security', Configuration::DEFAULT_SECURITY_HEADERS); + foreach ($headers as $header => $value) { + // Some pages may have specific requirements that we must follow. Don't touch them. + if (!$response->headers->has($header)) { + $response->headers->set($header, $value); + } + } + } +} diff --git a/src/SimpleSAML/IdP.php b/src/SimpleSAML/IdP.php index 97da6a5ed3..0c8f8d1340 100644 --- a/src/SimpleSAML/IdP.php +++ b/src/SimpleSAML/IdP.php @@ -4,7 +4,7 @@ namespace SimpleSAML; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SAML2\Exception\Protocol\NoPassiveException; use SimpleSAML\Assert\Assert; use SimpleSAML\Auth; @@ -341,7 +341,7 @@ public static function postAuth(array $state): void private function authenticate(array &$state): void { if (isset($state['isPassive']) && (bool) $state['isPassive']) { - throw new NoPassiveException(Constants::STATUS_RESPONDER . ': Passive authentication not supported.'); + throw new NoPassiveException(C::STATUS_RESPONDER . ': Passive authentication not supported.'); } $this->authSource->login($state); diff --git a/src/SimpleSAML/Kernel.php b/src/SimpleSAML/Kernel.php index 32e0b48b4a..83b0252301 100644 --- a/src/SimpleSAML/Kernel.php +++ b/src/SimpleSAML/Kernel.php @@ -32,17 +32,8 @@ class Kernel extends BaseKernel public const string CONFIG_EXTS = '.{php,xml,yaml,yml}'; - /** @var string */ - private string $module; - - - /** - * @param string $module - */ - public function __construct(string $module) + public function __construct() { - $this->module = $module; - $env = getenv('APP_ENV') ?: (getenv('SYMFONY_ENV') ?: 'prod'); parent::__construct($env, false); @@ -61,7 +52,7 @@ public function getCacheDir(): string $cacheDir = $cache ?? $temp; Assert::notNull($cacheDir, "Missing cachedir parameter in config.php"); - $cachePath = $cacheDir . DIRECTORY_SEPARATOR . $this->module; + $cachePath = $cacheDir . DIRECTORY_SEPARATOR . 'global'; $sysUtils = new System(); if ($sysUtils->isAbsolutePath($cachePath)) { @@ -101,17 +92,6 @@ public function registerBundles(): array } - /** - * Get the module loaded in this kernel. - * - * @return string - */ - public function getModule(): string - { - return $this->module; - } - - /** * Configures the container. * @@ -123,9 +103,11 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa $configuration = Configuration::getInstance(); $baseDir = $configuration->getBaseDir(); $loader->load($baseDir . '/routing/services/*' . self::CONFIG_EXTS, 'glob'); - $confDir = Module::getModuleDir($this->module) . '/routing/services'; - if (is_dir($confDir)) { - $loader->load($confDir . '/**/*' . self::CONFIG_EXTS, 'glob'); + foreach ($this->getEnabledModules() as $module) { + $confDir = Module::getModuleDir($module) . '/routing/services'; + if (is_dir($confDir)) { + $loader->load($confDir . '/**/*' . self::CONFIG_EXTS, 'glob'); + } } $container->loadFromExtension('framework', [ @@ -146,9 +128,26 @@ protected function configureRoutes(RoutingConfigurator $routes): void $configuration = Configuration::getInstance(); $baseDir = $configuration->getBaseDir(); $routes->import($baseDir . '/routing/routes/*' . self::CONFIG_EXTS); - $confDir = Module::getModuleDir($this->module) . '/routing/routes'; - if (is_dir($confDir)) { - $routes->import($confDir . '/**/*' . self::CONFIG_EXTS)->prefix($this->module); + foreach ($this->getEnabledModules() as $module) { + $confDir = Module::getModuleDir($module) . '/routing/routes'; + if (is_dir($confDir)) { + $routes->import($confDir . '/**/*' . self::CONFIG_EXTS)->prefix('/module/' . $module, false); + + /** + * Transition compatibility: also serve every module route under the legacy + * "module.php" path prefix that peers may still hold in exchanged metadata + * (e.g. SSO, ACS, SLO, and metadata endpoints, including those published + * by modules such as oidc, casserver adfs, or any other custom module). + * + * @deprecated Scheduled for removal in a future major release; see the v3.0 upgrade + * notes. Implementers should republish metadata with the new URLs. + * + * @todo Remove legacy 'module.php' routes in a future major release. + */ + $routes->import($confDir . '/**/*' . self::CONFIG_EXTS) + ->prefix('/module.php/' . $module, false) + ->namePrefix('legacy-'); + } } } @@ -158,27 +157,45 @@ protected function configureRoutes(RoutingConfigurator $routes): void */ private function registerModuleControllers(ContainerBuilder $container): void { - try { - $definition = new Definition(); - $definition->setAutowired(true); - $definition->setPublic(true); + foreach ($this->getEnabledModules() as $module) { + try { + $definition = new Definition(); + $definition->setAutowired(true); + $definition->setPublic(true); + + $controllerDir = Module::getModuleDir($module) . '/src/Controller'; + + if (!is_dir($controllerDir)) { + continue; + } + + $loader = new DirectoryLoader( + $container, + new FileLocator($controllerDir . '/'), + ); + $loader->registerClasses( + $definition, + 'SimpleSAML\\Module\\' . $module . '\\Controller\\', + $controllerDir . '/*', + ); + } catch (FileLocatorFileNotFoundException $e) { + } + } + } - $controllerDir = Module::getModuleDir($this->module) . '/src/Controller'; - if (!is_dir($controllerDir)) { - return; + /** + * @return string[] + */ + private function getEnabledModules(): array + { + $modules = []; + foreach (Module::getModules() as $module) { + if (Module::isModuleEnabled($module)) { + $modules[] = $module; } - - $loader = new DirectoryLoader( - $container, - new FileLocator($controllerDir . '/'), - ); - $loader->registerClasses( - $definition, - 'SimpleSAML\\Module\\' . $this->module . '\\Controller\\', - $controllerDir . '/*', - ); - } catch (FileLocatorFileNotFoundException $e) { } + + return $modules; } } diff --git a/src/SimpleSAML/Metadata/MetaDataStorageHandler.php b/src/SimpleSAML/Metadata/MetaDataStorageHandler.php index ccd7627c87..aade24beb3 100644 --- a/src/SimpleSAML/Metadata/MetaDataStorageHandler.php +++ b/src/SimpleSAML/Metadata/MetaDataStorageHandler.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Metadata; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Assert\Assert; use SimpleSAML\Configuration; use SimpleSAML\Error; @@ -111,21 +111,21 @@ public function getGenerated( if ($set == 'saml20-sp-hosted') { if ($property === 'SingleLogoutServiceBinding') { - return Constants::BINDING_HTTP_REDIRECT; + return C::BINDING_HTTP_REDIRECT; } } elseif ($set == 'saml20-idp-hosted') { switch ($property) { case 'SingleSignOnService': - return $baseurl . 'module.php/saml/idp/singleSignOnService'; + return $baseurl . 'module/saml/idp/singleSignOnService'; case 'SingleSignOnServiceBinding': - return Constants::BINDING_HTTP_REDIRECT; + return C::BINDING_HTTP_REDIRECT; case 'SingleLogoutService': - return $baseurl . 'module.php/saml/idp/singleLogout'; + return $baseurl . 'module/saml/idp/singleLogout'; case 'SingleLogoutServiceBinding': - return Constants::BINDING_HTTP_REDIRECT; + return C::BINDING_HTTP_REDIRECT; } } diff --git a/src/SimpleSAML/Metadata/SAMLBuilder.php b/src/SimpleSAML/Metadata/SAMLBuilder.php index f5db175835..10192702d5 100644 --- a/src/SimpleSAML/Metadata/SAMLBuilder.php +++ b/src/SimpleSAML/Metadata/SAMLBuilder.php @@ -5,7 +5,6 @@ namespace SimpleSAML\Metadata; use DOMElement; -use SAML2\Constants; use SAML2\XML\idpdisc\DiscoveryResponse; use SAML2\XML\md\AttributeAuthorityDescriptor; use SAML2\XML\md\AttributeConsumingService; @@ -31,6 +30,7 @@ use SimpleSAML\Configuration; use SimpleSAML\Logger; use SimpleSAML\Module; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -162,7 +162,7 @@ private function addExtensions(Configuration $metadata, RoleDescriptor $e): void foreach ($metadata->getArray('EntityAttributes') as $attributeName => $attributeValues) { $a = new Attribute(); $a->setName($attributeName); - $a->setNameFormat(Constants::NAMEFORMAT_URI); + $a->setNameFormat(C::NAMEFORMAT_URI); // Attribute names that is not URI is prefixed as this: '{nameformat}name' if (preg_match('/^\{(.*?)\}(.*)$/', $attributeName, $matches)) { @@ -335,7 +335,7 @@ private static function createEndpoints(array $endpoints, bool $indexed): array foreach ($endpoints as &$ep) { if ($indexed) { - if ($ep['Binding'] === Constants::NS_IDPDISC) { + if ($ep['Binding'] === C::NS_IDPDISC) { $t = new DiscoveryResponse(); } else { $t = new IndexedEndpointType(); @@ -373,9 +373,9 @@ private static function createEndpoints(array $endpoints, bool $indexed): array } if (isset($ep['hoksso:ProtocolBinding'])) { $t->setAttributeNS( - Constants::NS_HOK, + C::NS_HOK, 'hoksso:ProtocolBinding', - Constants::BINDING_HTTP_REDIRECT, + C::BINDING_HTTP_REDIRECT, ); } @@ -420,14 +420,14 @@ private function addAttributeConsumingService( $attributeconsumer->setServiceName($name); $attributeconsumer->setServiceDescription($metadata->getOptionalLocalizedString('description', [])); - $nameFormat = $metadata->getOptionalString('attributes.NameFormat', Constants::NAMEFORMAT_URI); + $nameFormat = $metadata->getOptionalString('attributes.NameFormat', C::NAMEFORMAT_URI); foreach ($attributes as $friendlyName => $attribute) { $t = new RequestedAttribute(); $t->setName($attribute); if (!is_int($friendlyName)) { $t->setFriendlyName($friendlyName); } - if ($nameFormat !== Constants::NAMEFORMAT_UNSPECIFIED) { + if ($nameFormat !== C::NAMEFORMAT_UNSPECIFIED) { $t->setNameFormat($nameFormat); } if (in_array($attribute, $attributesrequired, true)) { @@ -470,9 +470,9 @@ public function addMetadata(string $set, array $metadata): void * Add SAML 2.0 SP metadata. * * @param array $metadata The metadata. - * @param string[] $protocols The protocols supported. Defaults to \SAML2\Constants::NS_SAMLP. + * @param string[] $protocols The protocols supported. Defaults to \SimpleSAML\SAML2\Constants::NS_SAMLP. */ - public function addMetadataSP20(array $metadata, array $protocols = [Constants::NS_SAMLP]): void + public function addMetadataSP20(array $metadata, array $protocols = [C::NS_SAMLP]): void { Assert::notNull($metadata['entityid']); Assert::notNull($metadata['metadata-set']); @@ -503,7 +503,7 @@ public function addMetadataSP20(array $metadata, array $protocols = [Constants:: $endpoints = $metadata->getEndpoints('AssertionConsumerService'); foreach ($metadata->getOptionalArrayizeString('AssertionConsumerService.artifact', []) as $acs) { $endpoints[] = [ - 'Binding' => Constants::BINDING_HTTP_ARTIFACT, + 'Binding' => C::BINDING_HTTP_ARTIFACT, 'Location' => $acs, ]; } @@ -534,7 +534,7 @@ public function addMetadataIdP20(array $metadata): void $metadata = Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new IDPSSODescriptor(); - $e->setProtocolSupportEnumeration(array_merge($e->getProtocolSupportEnumeration(), [Constants::NS_SAMLP])); + $e->setProtocolSupportEnumeration(array_merge($e->getProtocolSupportEnumeration(), [C::NS_SAMLP])); if ($metadata->hasValue('sign.authnrequest')) { $e->setWantAuthnRequestsSigned($metadata->getBoolean('sign.authnrequest')); @@ -591,7 +591,7 @@ public function addAttributeAuthority(array $metadata): void $metadata = Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new AttributeAuthorityDescriptor(); - $e->setProtocolSupportEnumeration($metadata->getOptionalArray('protocols', [Constants::NS_SAMLP])); + $e->setProtocolSupportEnumeration($metadata->getOptionalArray('protocols', [C::NS_SAMLP])); $this->addExtensions($metadata, $e); $this->addCertificate($e, $metadata); diff --git a/src/SimpleSAML/Module.php b/src/SimpleSAML/Module.php index e32b20381d..78c636dc57 100644 --- a/src/SimpleSAML/Module.php +++ b/src/SimpleSAML/Module.php @@ -6,43 +6,26 @@ use Exception; use SimpleSAML\Assert\Assert; -use SimpleSAML\Kernel; use SimpleSAML\Utils; -use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpFoundation\ResponseHeaderBag; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use function array_filter; use function array_key_exists; use function class_exists; use function count; use function dirname; use function explode; -use function function_exists; use function in_array; use function is_bool; use function is_callable; use function is_dir; -use function is_file; -use function is_null; use function is_subclass_of; -use function mb_strtolower; -use function mime_content_type; -use function preg_match; use function rtrim; use function str_replace; -use function strlen; -use function strpos; -use function strtolower; use function strval; -use function substr; /** * Helper class for accessing information about modules. @@ -151,207 +134,41 @@ public static function isModuleEnabled(string $module): bool /** - * Handler for module requests. - * - * This controller receives requests for pages hosted by modules, and processes accordingly. Depending on the - * configuration and the actual request, it will run a PHP script and exit, or return a Response produced either - * by another controller or by a static file. + * Legacy handler for the removed module.php entry point. * * @param \Symfony\Component\HttpFoundation\Request|null $request * The request to process. Defaults to the current one. - * @return ( - * \Symfony\Component\HttpFoundation\Response| - * \Symfony\Component\HttpFoundation\BinaryFileResponse - * ) Returns a Response object that can be sent to the browser. - * - * @throws \SimpleSAML\Error\BadRequest In case the request URI is malformed. - * @throws \SimpleSAML\Error\NotFound - * In case the request URI is invalid or the resource it points to cannot be found. + * @return never + * + * @throws \SimpleSAML\Error\NotFound Always, because module.php is no longer supported. */ - public static function process(?Request $request = null): Response + public static function process(?Request $request = null): never { - if ($request === null) { - $request = Request::createFromGlobals(); - } - - if ($request->server->get('PATH_INFO') === '/' || $request->server->get('PATH_INFO') === null) { - throw new Error\NotFound('No PATH_INFO to module.php'); - } - - $url = $request->server->get('PATH_INFO'); - Assert::same(substr($url, 0, 1), '/'); - - /* clear the PATH_INFO option, so that a script can detect whether it is called with anything following the - *'.php'-ending. - */ - unset($_SERVER['PATH_INFO']); - - $modEnd = strpos($url, '/', 1); - if ($modEnd === false) { - $modEnd = strlen($url); - $module = substr($url, 1); - $url = ''; - } else { - $module = substr($url, 1, $modEnd - 1); - $url = substr($url, $modEnd + 1); - } - - if (!self::isModuleEnabled($module)) { - throw new Error\NotFound(sprintf("The module '%s' was either not found, or wasn't enabled.", $module)); - } - - /* Make sure that the request isn't suspicious (contains references to current directory or parent directory or - * anything like that. Searching for './' in the URL will detect both '../' and './'. Searching for '\' will - * detect attempts to use Windows-style paths. - */ - if (strpos($url, '\\') !== false) { - throw new Error\BadRequest('Requested URL contained a backslash.'); - } elseif (strpos($url, './') !== false) { - throw new Error\BadRequest('Requested URL contained \'./\'.'); - } - - $config = Configuration::getInstance(); - - // rebuild REQUEST_URI and SCRIPT_NAME just in case we need to. - // This is needed for server aliases and rewrites - $translated_uri = $config->getBasePath() . 'module.php/' . $module . '/' . $url; - $request->server->set('REQUEST_URI', $translated_uri); - $request->server->set('SCRIPT_NAME', $config->getBasePath() . 'module.php'); - // strip any NULL files (form file fields with nothing selected) - // because initialize() will throw an error on them - $request_files = array_filter( - $request->files->all(), - function ($val) { - return !is_null($val); - }, - ); - $request->initialize( - $request->query->all(), - $request->request->all(), - $request->attributes->all(), - $request->cookies->all(), - $request_files, - $request->server->all(), - $request->getContent(), - ); - - try { - $kernel = new Kernel($module); - $response = $kernel->handle($request); - $kernel->terminate($request, $response); - - return $response; - } catch (FileLocatorFileNotFoundException $e) { - // no routes configured for this module, fall back to the old system - } catch (NotFoundHttpException $e) { - // this module has been migrated, but the route wasn't found - } - - $moduleDir = self::getModuleDir($module) . '/public/'; - - // check for '.php/' in the path, the presence of which indicates that another php-script should handle the - // request - for ($phpPos = strpos($url, '.php/'); $phpPos !== false; $phpPos = strpos($url, '.php/', $phpPos + 1)) { - $newURL = substr($url, 0, $phpPos + 4); - $param = substr($url, $phpPos + 4); - - if (is_file($moduleDir . $newURL)) { - /* $newPath points to a normal file. Point execution to that file, and save the remainder of the path - * in PATH_INFO. - */ - $url = $newURL; - $request->server->set('PATH_INFO', $param); - $_SERVER['PATH_INFO'] = $param; - break; - } - } - - $path = $moduleDir . $url; - $fileSystem = new Filesystem(); - - if ($path[strlen($path) - 1] === '/') { - // path ends with a slash - directory reference. Attempt to find index file in directory - foreach (self::$indexFiles as $if) { - if ($fileSystem->exists($path . $if)) { - $path .= $if; - break; - } - } - } - - if (is_dir($path)) { - /* Path is a directory - maybe no index file was found in the previous step, or maybe the path didn't end - * with a slash. Either way, we don't do directory listings. - */ - throw new Error\NotFound('Directory listing not available.'); - } - - if (!$fileSystem->exists($path)) { - // file not found - Logger::info('Could not find file \'' . $path . '\'.'); - throw new Error\NotFound("The URL wasn't found in the module."); - } - - if (mb_strtolower(substr($path, -4), 'UTF-8') === '.php') { - // PHP file - attempt to run it - - /* In some environments, $_SERVER['SCRIPT_NAME'] is already set with $_SERVER['PATH_INFO']. Check for that - * case, and append script name only if necessary. - * - * Contributed by Travis Hegner. - */ - $script = "/$module/$url"; - if (strpos($request->getScriptName(), $script) === false) { - $request->server->set('SCRIPT_NAME', $request->getScriptName() . '/' . $module . '/' . $url); - } - - require($path); - exit(); - } + throw new Error\NotFound('The module.php entry point is no longer supported.'); + } - // some other file type - attempt to serve it - // find MIME type for file, based on extension - $contentType = null; - if (preg_match('#\.([^/\.]+)$#D', $path, $type)) { - $type = strtolower($type[1]); - if (array_key_exists($type, self::$mimeTypes)) { - $contentType = self::$mimeTypes[$type]; - } - } + /** + * Get absolute URL to a published module asset. + * + * @param string $module Module name. + * @param string $asset Asset path relative to the module assets directory. + * @param array $parameters Extra parameters which should be added to the URL. Optional. + * @return string + */ + public static function getModuleAssetUrl( + string $module, + string $asset, + array $parameters = [], + ): string { + $httpUtils = new Utils\HTTP(); + $url = $httpUtils->getBaseURL() . 'assets/' . $module . '/' . ltrim($asset, '/'); - if ($contentType === null) { - /* We were unable to determine the MIME type from the file extension. Fall back to mime_content_type (if it - * exists). - */ - if (function_exists('mime_content_type')) { - $contentType = mime_content_type($path); - } else { - // mime_content_type doesn't exist. Return a default MIME type - Logger::warning('Unable to determine mime content type of file: ' . $path); - $contentType = 'application/octet-stream'; - } + if (!empty($parameters)) { + $url = $httpUtils->addURLParameters($url, $parameters); } - - $assetConfig = $config->getOptionalConfigItem('assets', []); - $cacheConfig = $assetConfig->getOptionalConfigItem('caching', []); - $response = new BinaryFileResponse($path); - $response->setCache([ - // "public" allows response caching even if the request was authenticated, - // which is exactly what we want for static resources - 'public' => true, - 'max_age' => strval($cacheConfig->getOptionalInteger('max_age', 86400)), - ]); - $response->setAutoLastModified(); - if ($cacheConfig->getOptionalBoolean('etag', false)) { - $response->setAutoEtag(); - } - $response->isNotModified($request); - $response->headers->set('Content-Type', $contentType); - $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE); - $response->prepare($request); - return $response; + return $url; } @@ -521,7 +338,7 @@ public static function getModuleURL(string $resource, array $parameters = []): s Assert::notSame($resource[0], '/'); $httpUtils = new Utils\HTTP(); - $url = $httpUtils->getBaseURL() . 'module.php/' . $resource; + $url = $httpUtils->getBaseURL() . 'module/' . $resource; if (!empty($parameters)) { $url = $httpUtils->addURLParameters($url, $parameters); } diff --git a/src/SimpleSAML/Session.php b/src/SimpleSAML/Session.php index 3f4820c738..5df115dbe5 100644 --- a/src/SimpleSAML/Session.php +++ b/src/SimpleSAML/Session.php @@ -929,9 +929,30 @@ public function setData(string $type, string $id, mixed $data, int|string|null $ $this->dataStore[$type][$id] = $dataInfo; + $this->maintainDataStoreLimit($type); + $this->markDirty(); } + /** + * This ensures that the number of elements in a data store does not exceed configured limits + * and trims it until the limit is not exceeded, removing elements from the start of the array + */ + private function maintainDataStoreLimit(string $type): void + { + $limit = self::$config->getOptionalInteger('session.datastore.limit', 0); + if ($limit <= 0) { + return; + } + if (!array_key_exists($type, $this->dataStore)) { + return; + } + $count = count($this->dataStore[$type]); + while ($count > $limit) { + array_shift($this->dataStore[$type]); + $count--; + } + } /** * This function removes expired data from the data store. diff --git a/src/SimpleSAML/Utils/Config/Metadata.php b/src/SimpleSAML/Utils/Config/Metadata.php index 021ad5b60e..99d086fc8f 100644 --- a/src/SimpleSAML/Utils/Config/Metadata.php +++ b/src/SimpleSAML/Utils/Config/Metadata.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Utils\Config; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SAML2\XML\md\ContactPerson; use SimpleSAML\Configuration; @@ -248,7 +248,7 @@ public static function parseNameIdPolicy(?array $nameIdPolicy = null): array { if ($nameIdPolicy === null) { // when NameIDPolicy is unset or set to null, default to transient - return ['Format' => Constants::NAMEID_TRANSIENT, 'AllowCreate' => false]; + return ['Format' => C::NAMEID_TRANSIENT, 'AllowCreate' => false]; } if ($nameIdPolicy === []) { @@ -258,10 +258,10 @@ public static function parseNameIdPolicy(?array $nameIdPolicy = null): array // handle configurations specifying an array in the NameIDPolicy config option $nameIdPolicy_cf = Configuration::loadFromArray($nameIdPolicy); - $format = $nameIdPolicy_cf->getOptionalString('Format', Constants::NAMEID_TRANSIENT); + $format = $nameIdPolicy_cf->getOptionalString('Format', C::NAMEID_TRANSIENT); $allowCreate = $nameIdPolicy_cf->getOptionalBoolean('AllowCreate', true); // SAML Version 2.0 Errata 05 lines 252-255 (pg 12) - if ($format === Constants::NAMEID_TRANSIENT) { + if ($format === C::NAMEID_TRANSIENT) { if ($allowCreate) { $allowCreate = false; } diff --git a/src/SimpleSAML/Utils/EMail.php b/src/SimpleSAML/Utils/EMail.php index 5ffd1837f0..ecb7ff99a9 100644 --- a/src/SimpleSAML/Utils/EMail.php +++ b/src/SimpleSAML/Utils/EMail.php @@ -86,7 +86,7 @@ public function getMailSenderAddress(): ?string { $config = Configuration::getInstance(); $options = $config->getOptionalArray('mail.transport.options', []); - return $options['sender'] ?: null; + return is_string($sender = $options['sender'] ?? null) ? $sender : null; } diff --git a/src/SimpleSAML/Utils/HTTP.php b/src/SimpleSAML/Utils/HTTP.php index 2a5f6e265e..040695a12c 100644 --- a/src/SimpleSAML/Utils/HTTP.php +++ b/src/SimpleSAML/Utils/HTTP.php @@ -18,8 +18,16 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; use function array_merge; +use function basename; +use function dirname; +use function is_string; use function parse_url; +use function realpath; +use function rtrim; use function str_replace; +use function str_starts_with; +use function strlen; +use function substr; /** * HTTP-related utility methods. @@ -652,16 +660,24 @@ public function guessBasePath(): string if (!array_key_exists('REQUEST_URI', $_SERVER) || !array_key_exists('SCRIPT_FILENAME', $_SERVER)) { return '/'; } + + $requestPath = (string) parse_url((string) $_SERVER['REQUEST_URI'], PHP_URL_PATH); + $scriptName = (string) ($_SERVER['SCRIPT_NAME'] ?? ''); + if ($scriptName !== '' && basename($scriptName) === 'index.php') { + $basePath = str_replace(DIRECTORY_SEPARATOR, '/', dirname($scriptName)); + return rtrim($basePath, '/') . '/'; + } + // get the name of the current script - $path = explode(DIRECTORY_SEPARATOR, $_SERVER['SCRIPT_FILENAME']); + $path = explode(DIRECTORY_SEPARATOR, (string) $_SERVER['SCRIPT_FILENAME']); $script = array_pop($path); // get the portion of the URI up to the script, i.e.: /simplesaml/some/directory/script.php - if (!preg_match('#^/(?:[^/]+/)*' . $script . '#', $_SERVER['REQUEST_URI'], $matches)) { + if (!preg_match('#^/(?:[^/]+/)*' . $script . '#', $requestPath, $matches)) { return '/'; } $uri_s = explode('/', $matches[0]); - $file_s = explode(DIRECTORY_SEPARATOR, $_SERVER['SCRIPT_FILENAME']); + $file_s = explode(DIRECTORY_SEPARATOR, (string) $_SERVER['SCRIPT_FILENAME']); // compare both arrays from the end, popping elements matching out of them while ($uri_s[count($uri_s) - 1] === $file_s[count($file_s) - 1]) { @@ -804,9 +820,9 @@ public function getSelfHostWithPath(): string /** * Retrieve the current URL using the base URL in the configuration, if possible. * - * This method will try to see if the current script is part of SimpleSAMLphp. In that case, it will use the - * 'baseurlpath' configuration option to rebuild the current URL based on that. If the current script is NOT - * part of SimpleSAMLphp, it will just return the current URL. + * If the current request is being handled by SimpleSAMLphp's front controller, this method rebuilds the URL from + * the configured base path and the current request URI. If SimpleSAMLphp is being called from another + * application script, it returns that application's current request URL instead. * * Note that this method does NOT make use of the HTTP X-Forwarded-* set of headers. * @@ -815,64 +831,31 @@ public function getSelfHostWithPath(): string public function getSelfURL(): string { $cfg = Configuration::getInstance(); - $baseDir = $cfg->getBaseDir(); - $cur_path = realpath($_SERVER['SCRIPT_FILENAME']); - // make sure we got a string from realpath() - $cur_path = is_string($cur_path) ? $cur_path : ''; - - // find the path to the current script relative to the public/ directory of SimpleSAMLphp - $rel_path = str_replace($baseDir . 'public' . DIRECTORY_SEPARATOR, '', $cur_path); - - $url_path = str_replace(DIRECTORY_SEPARATOR, '/', $rel_path); $requestUri = (string)($_SERVER['REQUEST_URI'] ?? ''); $requestPath = (string)parse_url($requestUri, PHP_URL_PATH); $requestQuery = (string)parse_url($requestUri, PHP_URL_QUERY); $requestFragment = (string)parse_url($requestUri, PHP_URL_FRAGMENT); - // Match script-relative path only against the path part of the request - $uri_pos = (!empty($url_path)) ? strpos($requestPath, $url_path) : false; + if (!$this->isSimpleSamlFrontControllerRequest($cfg)) { + return $this->buildExternalApplicationURL($cfg, $requestUri); + } - if ($cur_path == $rel_path || $uri_pos === false) { - /* - * We were accessed from an external script. This can happen in the following cases: - * - * - $_SERVER['SCRIPT_FILENAME'] points to a script that doesn't exist. E.g. functional testing. In this - * case, realpath() returns false and str_replace an empty string, so we compare them loosely. - * - * - The script is not located under the public/ directory of SimpleSAMLphp. In that case, removing - * SimpleSAMLphp's base dir and public/ from the current path yields the same path, so $cur_path and - * $rel_path are equal. - * - * - The request path does not match the current script. Even if the current script is located in the - * public/ directory of SimpleSAMLphp, the request path (without query string) does not contain its - * relative path, and $uri_pos is false. - * - * It doesn't matter which one of those cases we have. We just know we can't apply our base URL to the - * current URI, so we need to build it back from the PHP environment, unless we have a base URL specified - * for this case in the configuration. First, check if that's the case. - */ - $appcfg = $cfg->getOptionalConfigItem('application', null); - $appurl = ($appcfg !== null) ? $appcfg->getOptionalString('baseURL', null) : null; - - if (!empty($appurl)) { - $protocol = (string)parse_url($appurl, PHP_URL_SCHEME); - $hostname = (string)parse_url($appurl, PHP_URL_HOST); - $portNum = parse_url($appurl, PHP_URL_PORT); - $port = !empty($portNum) ? ':' . $portNum : ''; - } else { - // no base URL specified for app, just use the current URL - $protocol = $this->getServerHTTPS() ? 'https' : 'http'; - $hostname = $this->getServerHost(); - $port = $this->getServerPort(); - } + $basePath = $cfg->getBasePath(); + $trimmedBasePath = rtrim($basePath, '/'); - return $protocol . '://' . $hostname . $port . $_SERVER['REQUEST_URI']; + if ($requestPath === $trimmedBasePath) { + $suffix = ''; + } elseif ($basePath === '/' || str_starts_with($requestPath, $basePath)) { + $suffix = ltrim(substr($requestPath, strlen($basePath)), '/'); + } else { + return $this->buildExternalApplicationURL($cfg, $requestUri); } - // Normal case: baseURL + script-relative path + remaining path, plus query if present - $suffix = substr($requestPath, $uri_pos + strlen($url_path)); - $url = $this->getBaseURL() . $url_path . $suffix; + $url = $this->getBaseURL(); + if ($suffix !== '') { + $url .= $suffix; + } if ($requestQuery !== '') { $url .= '?' . $requestQuery; @@ -886,6 +869,45 @@ public function getSelfURL(): string } + /** + * Check if the current request is being handled by SimpleSAMLphp's front controller. + */ + private function isSimpleSamlFrontControllerRequest(Configuration $cfg): bool + { + if (!array_key_exists('SCRIPT_FILENAME', $_SERVER)) { + return false; + } + + $currentScript = realpath((string) $_SERVER['SCRIPT_FILENAME']); + $frontController = realpath($cfg->getBaseDir() . 'public' . DIRECTORY_SEPARATOR . 'index.php'); + + return is_string($currentScript) && is_string($frontController) && $currentScript === $frontController; + } + + + /** + * Build a URL for requests handled by an embedding application instead of SimpleSAMLphp's front controller. + */ + private function buildExternalApplicationURL(Configuration $cfg, string $requestUri): string + { + $appcfg = $cfg->getOptionalConfigItem('application', null); + $appurl = ($appcfg !== null) ? $appcfg->getOptionalString('baseURL', null) : null; + + if (!empty($appurl)) { + $protocol = (string) parse_url($appurl, PHP_URL_SCHEME); + $hostname = (string) parse_url($appurl, PHP_URL_HOST); + $portNum = parse_url($appurl, PHP_URL_PORT); + $port = !empty($portNum) ? ':' . $portNum : ''; + } else { + $protocol = $this->getServerHTTPS() ? 'https' : 'http'; + $hostname = $this->getServerHost(); + $port = $this->getServerPort(); + } + + return $protocol . '://' . $hostname . $port . $requestUri; + } + + /** * Retrieve the current URL using the base URL in the configuration, containing the protocol, the host and * optionally, the port number. diff --git a/src/SimpleSAML/XHTML/Template.php b/src/SimpleSAML/XHTML/Template.php index 9bc6039a17..10ff03e1d7 100644 --- a/src/SimpleSAML/XHTML/Template.php +++ b/src/SimpleSAML/XHTML/Template.php @@ -186,12 +186,9 @@ public function asset(string $asset, ?string $module = null, bool $tag = true): if (is_null($module)) { $file = $baseDir . 'public/assets/base/' . $asset; $path = $basePath . 'assets/base/' . $asset; - } elseif (file_exists($baseDir . 'public/assets/' . $module)) { - $file = $baseDir . '/public/assets/' . $module . '/' . $asset; - $path = $basePath . 'assets/' . $module . '/' . $asset; } else { - $file = $baseDir . 'modules/' . $module . '/public/assets/' . $asset; - $path = Module::getModuleUrl($module . '/assets/' . $asset); + $file = $baseDir . '/public/assets/' . $module . '/' . $asset; + $path = Module::getModuleAssetUrl($module, $asset); } if (!$this->fileSystem->exists($file)) { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 796ba16b46..80a6367547 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -7,4 +7,4 @@ // set the SAML2 container $container = new \SimpleSAML\Compat\SspContainer(); -\SAML2\Compat\ContainerSingleton::setContainer($container); +\SimpleSAML\SAML2\Compat\ContainerSingleton::setContainer($container); diff --git a/tests/modules/core/src/Auth/Process/TargetedIDTest.php b/tests/modules/core/src/Auth/Process/TargetedIDTest.php index 9d895a1255..b24c693af2 100644 --- a/tests/modules/core/src/Auth/Process/TargetedIDTest.php +++ b/tests/modules/core/src/Auth/Process/TargetedIDTest.php @@ -7,10 +7,10 @@ use Exception; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use SAML2\Constants; use SAML2\XML\saml\NameID; use SimpleSAML\Configuration; use SimpleSAML\Module\core\Auth\Process\TargetedID; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils; /** @@ -111,7 +111,7 @@ public function testWithSrcDst(): void public function testNameIdGeneration(): void { $nameid = new NameID(); - $nameid->setFormat(Constants::NAMEID_PERSISTENT); + $nameid->setFormat(C::NAMEID_PERSISTENT); $nameid->setNameQualifier('urn:example:src:id'); $nameid->setSPNameQualifier('joe'); $nameid->setValue('joe'); diff --git a/tests/modules/core/src/Auth/UserPassBaseTest.php b/tests/modules/core/src/Auth/UserPassBaseTest.php index 2ab4b6197d..2a148cdd66 100644 --- a/tests/modules/core/src/Auth/UserPassBaseTest.php +++ b/tests/modules/core/src/Auth/UserPassBaseTest.php @@ -6,10 +6,10 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use SAML2\Constants; use SimpleSAML\Error\Error as SspError; use SimpleSAML\Error\ErrorCodes; use SimpleSAML\Module\core\Auth\UserPassBase; +use SimpleSAML\SAML2\Constants as C; /** */ @@ -21,7 +21,7 @@ class UserPassBaseTest extends TestCase public function testAuthenticateECPCallsLoginAndSetsAttributes(): void { $state = [ - 'saml:Binding' => Constants::BINDING_PAOS, + 'saml:Binding' => C::BINDING_PAOS, ]; $attributes = ['attrib' => 'val']; @@ -53,7 +53,7 @@ public function testAuthenticateECPMissingUsername(): void $this->expectExceptionMessage(ErrorCodes::WRONGUSERPASS); $state = [ - 'saml:Binding' => Constants::BINDING_PAOS, + 'saml:Binding' => C::BINDING_PAOS, ]; unset($_SERVER['PHP_AUTH_USER']); @@ -77,7 +77,7 @@ public function testAuthenticateECPMissingPassword(): void $this->expectExceptionMessage(ErrorCodes::WRONGUSERPASS); $state = [ - 'saml:Binding' => Constants::BINDING_PAOS, + 'saml:Binding' => C::BINDING_PAOS, ]; $_SERVER['PHP_AUTH_USER'] = 'username'; @@ -98,7 +98,7 @@ public function testAuthenticateECPMissingPassword(): void public function testAuthenticateECPCallsLoginWithForcedUsername(): void { $state = [ - 'saml:Binding' => Constants::BINDING_PAOS, + 'saml:Binding' => C::BINDING_PAOS, ]; $attributes = []; diff --git a/tests/modules/cron/src/Controller/CronTest.php b/tests/modules/cron/src/Controller/CronTest.php index ef7b685ee3..55b7e9d4ac 100644 --- a/tests/modules/cron/src/Controller/CronTest.php +++ b/tests/modules/cron/src/Controller/CronTest.php @@ -84,7 +84,7 @@ public function requireAdmin(): void */ public function testInfo(): void { - $_SERVER['REQUEST_URI'] = '/module.php/cron/info'; + $_SERVER['REQUEST_URI'] = '/module/cron/info'; $c = new Controller\Cron($this->config, $this->session); $c->setAuthUtils($this->authUtils); @@ -92,8 +92,8 @@ public function testInfo(): void $this->assertTrue($response->isSuccessful()); $expect = [ - 'exec_href' => 'http://localhost/simplesaml/module.php/cron/run/daily/verysecret', - 'href' => 'http://localhost/simplesaml/module.php/cron/run/daily/verysecret/xhtml', + 'exec_href' => 'http://localhost/simplesaml/module/cron/run/daily/verysecret', + 'href' => 'http://localhost/simplesaml/module/cron/run/daily/verysecret/xhtml', 'tag' => 'daily', 'int' => '02 0 * * *', ]; @@ -106,7 +106,7 @@ public function testInfo(): void */ public function testRunCorrectKey(): void { - $_SERVER['REQUEST_URI'] = '/module.php/cron/run/daily/verysecret'; + $_SERVER['REQUEST_URI'] = '/module/cron/run/daily/verysecret'; $c = new Controller\Cron($this->config, $this->session); $response = $c->run('daily', 'verysecret'); @@ -128,7 +128,7 @@ public function testRunCorrectKey(): void */ public function testRunWrongKey(): void { - $_SERVER['REQUEST_URI'] = '/module.php/cron/run/daily/nodice'; + $_SERVER['REQUEST_URI'] = '/module/cron/run/daily/nodice'; $c = new Controller\Cron($this->config, $this->session); @@ -144,7 +144,7 @@ public function testRunWrongKey(): void #[DataProvider('provideDefaultSecret')] public function testRunDefaultSecret(string $secret): void { - $_SERVER['REQUEST_URI'] = '/module.php/cron/run/daily/' . $secret; + $_SERVER['REQUEST_URI'] = '/module/cron/run/daily/' . $secret; $c = new Controller\Cron($this->config, $this->session); @@ -174,7 +174,7 @@ public function testRunDefaultConfigSecret(string $configKey): void 'simplesaml', ); - $_SERVER['REQUEST_URI'] = '/module.php/cron/run/daily/verysecret'; + $_SERVER['REQUEST_URI'] = '/module/cron/run/daily/verysecret'; $c = new Controller\Cron($this->config, $this->session); diff --git a/tests/modules/saml/src/Auth/Process/NameIDAttributeTest.php b/tests/modules/saml/src/Auth/Process/NameIDAttributeTest.php index 090a82a9d5..427aadd108 100644 --- a/tests/modules/saml/src/Auth/Process/NameIDAttributeTest.php +++ b/tests/modules/saml/src/Auth/Process/NameIDAttributeTest.php @@ -6,7 +6,7 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SAML2\XML\saml\NameID; use SimpleSAML\Error; use SimpleSAML\Module\saml\Auth\Process\NameIDAttribute; @@ -46,7 +46,7 @@ public function testMinimalConfig(): void $nameId = new NameID(); $nameId->setValue('eugene@oombaas'); - $nameId->setFormat(Constants::NAMEID_PERSISTENT); + $nameId->setFormat(C::NAMEID_PERSISTENT); $nameId->setNameQualifier($idpId); $nameId->setSPNameQualifier($spId); @@ -76,7 +76,7 @@ public function testCustomAttributeName(): void $nameId = new NameID(); $nameId->setValue('eugene@oombaas'); - $nameId->setFormat(Constants::NAMEID_PERSISTENT); + $nameId->setFormat(C::NAMEID_PERSISTENT); $nameId->setNameQualifier($idpId); $nameId->setSPNameQualifier($spId); @@ -106,7 +106,7 @@ public function testFormat(): void $nameId = new NameID(); $nameId->setValue('eugene@oombaas'); - $nameId->setFormat(Constants::NAMEID_PERSISTENT); + $nameId->setFormat(C::NAMEID_PERSISTENT); $nameId->setNameQualifier($idpId); $nameId->setSPNameQualifier($spId); @@ -189,7 +189,7 @@ public function testCustomAttributeNameAndFormat(): void $nameId = new NameID(); $nameId->setValue('eugene@oombaas'); - $nameId->setFormat(Constants::NAMEID_PERSISTENT); + $nameId->setFormat(C::NAMEID_PERSISTENT); $nameId->setNameQualifier($idpId); $nameId->setSPNameQualifier($spId); @@ -229,7 +229,7 @@ public function testOverrideNameID(): void 'saml:sp:NameID' => $nameId, ]; $this->processFilter([], $request); - $this->assertEquals("{$nameId->getFormat()}", Constants::NAMEID_UNSPECIFIED); + $this->assertEquals("{$nameId->getFormat()}", C::NAMEID_UNSPECIFIED); $this->assertEquals("{$nameId->getNameQualifier()}", $idpId); $this->assertEquals("{$nameId->getSPNameQualifier()}", $spId); } diff --git a/tests/modules/saml/src/Auth/Source/SPTest.php b/tests/modules/saml/src/Auth/Source/SPTest.php index 3b687ff451..8b5c338353 100644 --- a/tests/modules/saml/src/Auth/Source/SPTest.php +++ b/tests/modules/saml/src/Auth/Source/SPTest.php @@ -527,7 +527,7 @@ public function testMetadataHostedBasicConfig(): void $this->assertIsArray($md['AssertionConsumerService']); foreach ($md['AssertionConsumerService'] as $acs) { $this->assertEquals( - 'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/' . $spId, + 'http://localhost/simplesaml/module/saml/sp/saml2-acs.php/' . $spId, $acs['Location'], ); $this->assertStringStartsWith('urn:oasis:names:tc:SAML:2.0:bindings', $acs['Binding']); @@ -1457,7 +1457,7 @@ public function testMetadataHolderOfKeyViaProtocolBindingIsInMetadata(): void $this->assertIsArray($hok); $this->assertEquals('urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', $hok['Binding']); $this->assertEquals( - 'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/' . $spId, + 'http://localhost/simplesaml/module/saml/sp/saml2-acs.php/' . $spId, $hok['Location'], ); $this->assertEquals(2, $hok['index']); diff --git a/tests/modules/saml/src/IdP/SAML2Test.php b/tests/modules/saml/src/IdP/SAML2Test.php index adf4caf0bc..bfbb54f4bf 100644 --- a/tests/modules/saml/src/IdP/SAML2Test.php +++ b/tests/modules/saml/src/IdP/SAML2Test.php @@ -60,7 +60,7 @@ public function testIdPInitiatedLoginMinimumParams(): void $this->assertStringStartsWith( // phpcs:ignore Generic.Files.LineLength.TooLong - 'http://idp.examlple.com/module.php/saml/idp/singleSignOnService?spentityid=https%3A%2F%2Fsome-sp-entity-id&cookie', + 'http://idp.examlple.com/module/saml/idp/singleSignOnService?spentityid=https%3A%2F%2Fsome-sp-entity-id&cookie', $state['\SimpleSAML\Auth\State.restartURL'], ); unset($state['saml:AuthnRequestReceivedAt']); // timestamp can't be tested in equality assertion @@ -91,7 +91,7 @@ public function testIdPInitiatedLoginOptionalParams(): void //currently only spentityid and relay state are used in the restart url. $this->assertStringStartsWith( - 'http://idp.examlple.com/module.php/saml/idp/singleSignOnService?' + 'http://idp.examlple.com/module/saml/idp/singleSignOnService?' . 'spentityid=https%3A%2F%2Fsome-sp-entity-id&RelayState=http%3A%2F%2Frelay&cookieTime', $state['\SimpleSAML\Auth\State.restartURL'], ); @@ -121,7 +121,7 @@ public function testIdPInitShibCompatyMinimumParams(): void $this->assertStringStartsWith( // phpcs:ignore Generic.Files.LineLength.TooLong - 'http://idp.examlple.com/module.php/saml/idp/singleSignOnService?spentityid=https%3A%2F%2Fsome-sp-entity-id&cookie', + 'http://idp.examlple.com/module/saml/idp/singleSignOnService?spentityid=https%3A%2F%2Fsome-sp-entity-id&cookie', $state['\SimpleSAML\Auth\State.restartURL'], ); unset($state['saml:AuthnRequestReceivedAt']); // timestamp can't be tested in equality assertion @@ -150,7 +150,7 @@ public function testIdPInitShibCompatOptionalParams(): void //currently only spentityid and relay state are used in the restart url. $this->assertStringStartsWith( - 'http://idp.examlple.com/module.php/saml/idp/singleSignOnService?' + 'http://idp.examlple.com/module/saml/idp/singleSignOnService?' . 'spentityid=https%3A%2F%2Fsome-sp-entity-id&RelayState=http%3A%2F%2Frelay&cookieTime', $state['\SimpleSAML\Auth\State.restartURL'], ); @@ -209,7 +209,7 @@ private function idpInitiatedHelper(array $queryParams): array // won't line up perfectly $_REQUEST = $_REQUEST + $queryParams; $_SERVER['HTTP_HOST'] = 'idp.examlple.com'; - $_SERVER['REQUEST_URI'] = '/module.php/saml/idp/singleSignOnService?' . http_build_query($queryParams); + $_SERVER['REQUEST_URI'] = '/module/saml/idp/singleSignOnService?' . http_build_query($queryParams); $state = []; @@ -302,7 +302,7 @@ public function testIdPGetHostedMetadataMinimal(): void $this->assertEquals( [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleSignOnService', ], $hostedMd['SingleSignOnService'][0], ); @@ -312,7 +312,7 @@ public function testIdPGetHostedMetadataMinimal(): void $this->assertEquals( [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleLogout', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleLogout', ], $hostedMd['SingleLogoutService'][0], ); @@ -382,7 +382,7 @@ public function testIdPGetHostedMetadataArtifact(): void [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP', 'index' => 0, - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/artifactResolutionService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/artifactResolutionService', ], $hostedMd['ArtifactResolutionService'][0], ); @@ -400,7 +400,7 @@ public function testIdPGetHostedMetadataHolderOfKey(): void $this->assertEquals( [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleSignOnService', 'hoksso:ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', ], $hostedMd['SingleSignOnService'][0], @@ -408,7 +408,7 @@ public function testIdPGetHostedMetadataHolderOfKey(): void $this->assertEquals( [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleSignOnService', ], $hostedMd['SingleSignOnService'][1], ); @@ -426,7 +426,7 @@ public function testIdPGetHostedMetadataECP(): void $this->assertEquals( [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleSignOnService', ], $hostedMd['SingleSignOnService'][0], ); @@ -434,7 +434,7 @@ public function testIdPGetHostedMetadataECP(): void [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP', 'index' => 0, - 'Location' => 'http://localhost/simplesaml/module.php/saml/idp/singleSignOnService', + 'Location' => 'http://localhost/simplesaml/module/saml/idp/singleSignOnService', ], $hostedMd['SingleSignOnService'][1], ); diff --git a/tests/src/SimpleSAML/Asset/ModuleAssetPublisherTest.php b/tests/src/SimpleSAML/Asset/ModuleAssetPublisherTest.php new file mode 100644 index 0000000000..2a12409a40 --- /dev/null +++ b/tests/src/SimpleSAML/Asset/ModuleAssetPublisherTest.php @@ -0,0 +1,41 @@ +publish($baseDir); + + $this->assertEquals(['example'], $published); + $this->assertSame('body{}', file_get_contents($baseDir . '/public/assets/example/css/site.css')); + $this->assertFalse(is_dir($baseDir . '/public/assets/empty')); + $this->assertFileDoesNotExist($baseDir . '/public/assets/example/css/stale.css'); + } +} diff --git a/tests/src/SimpleSAML/Asset/ModuleGitignoreTest.php b/tests/src/SimpleSAML/Asset/ModuleGitignoreTest.php new file mode 100644 index 0000000000..2f863535cc --- /dev/null +++ b/tests/src/SimpleSAML/Asset/ModuleGitignoreTest.php @@ -0,0 +1,48 @@ +assertFileExists($gitignorePath, '.gitignore file should exist'); + $gitignore = file_get_contents($gitignorePath); + + $modules = scandir($modulesDir); + foreach ($modules as $module) { + if ($module === '.' || $module === '..') { + continue; + } + + if (is_dir($modulesDir . '/' . $module . '/public/assets')) { + $expectedLine1 = '!/public/assets/' . $module . '/'; + $expectedLine2 = '!/public/assets/' . $module . '/**'; + + $this->assertStringContainsString( + $expectedLine1, + $gitignore, + "Module '$module' has public assets, but '$expectedLine1' is missing in .gitignore", + ); + $this->assertStringContainsString( + $expectedLine2, + $gitignore, + "Module '$module' has public assets, but '$expectedLine2' is missing in .gitignore", + ); + } + } + } +} diff --git a/tests/src/SimpleSAML/Command/AssetsPublishCommandTest.php b/tests/src/SimpleSAML/Command/AssetsPublishCommandTest.php new file mode 100644 index 0000000000..ca42be5764 --- /dev/null +++ b/tests/src/SimpleSAML/Command/AssetsPublishCommandTest.php @@ -0,0 +1,94 @@ +baseDir = sys_get_temp_dir() . '/ssp-assets-publish-command-' . uniqid(); + mkdir($this->baseDir . '/modules', 0777, true); + mkdir($this->baseDir . '/public/assets', 0777, true); + + Configuration::clearInternalState(); + Configuration::loadFromArray([ + 'basedir' => $this->baseDir, + ], '[ARRAY]', 'simplesaml'); + + $command = new AssetsPublishCommand(new ModuleAssetPublisher()); + $this->commandTester = new CommandTester($command); + } + + + protected function tearDown(): void + { + (new Filesystem())->remove($this->baseDir); + Configuration::clearInternalState(); + } + + + public function testCanCreateInstanceWithDefaultConstructor(): void + { + $command = new AssetsPublishCommand(); + $this->assertInstanceOf(AssetsPublishCommand::class, $command); + } + + + public function testCommandMetadata(): void + { + $command = new AssetsPublishCommand(); + $this->assertSame('assets:publish', $command->getName()); + $this->assertSame('Publish module assets into public/assets.', $command->getDescription()); + } + + + public function testExecuteOutputsSuccessWhenNoAssetsNeededPublishing(): void + { + $this->commandTester->execute([]); + $this->commandTester->assertCommandIsSuccessful(); + + $output = $this->commandTester->getDisplay(); + $this->assertStringContainsString('No module assets needed publishing.', $output); + } + + + public function testExecuteOutputsSuccessWhenAssetsArePublished(): void + { + mkdir($this->baseDir . '/modules/example/public/assets/css', 0777, true); + mkdir($this->baseDir . '/modules/admin/public/assets/js', 0777, true); + file_put_contents($this->baseDir . '/modules/example/public/assets/css/style.css', 'body {}'); + file_put_contents($this->baseDir . '/modules/admin/public/assets/js/script.js', 'console.log();'); + + $this->commandTester->execute([]); + $this->commandTester->assertCommandIsSuccessful(); + + $output = $this->commandTester->getDisplay(); + $this->assertStringContainsString('Published module assets for:', $output); + $this->assertStringContainsString('admin', $output); + $this->assertStringContainsString('example', $output); + } +} diff --git a/tests/src/SimpleSAML/ConfigurationTest.php b/tests/src/SimpleSAML/ConfigurationTest.php index ad01cf7e81..6457efbdc4 100644 --- a/tests/src/SimpleSAML/ConfigurationTest.php +++ b/tests/src/SimpleSAML/ConfigurationTest.php @@ -6,7 +6,7 @@ use Exception; use PHPUnit\Framework\Attributes\CoversClass; -use SAML2\Constants; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Assert\AssertionFailedException; use SimpleSAML\Configuration; use SimpleSAML\Error; @@ -731,14 +731,14 @@ public function testGetDefaultEndpoint(): void [ [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], ], // 1. define the ResponseLocation too [ [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, 'ResponseLocation' => 'https://example.com/endpoint.php', ], ], @@ -747,12 +747,12 @@ public function testGetDefaultEndpoint(): void [ 'index' => 1, 'Location' => 'https://www1.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, ], [ 'index' => 2, 'Location' => 'https://www2.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], ], // 3. make sure isDefault has priority over indexes @@ -760,13 +760,13 @@ public function testGetDefaultEndpoint(): void [ 'index' => 1, 'Location' => 'https://www2.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], [ 'index' => 2, 'isDefault' => true, 'Location' => 'https://www1.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, ], ], // 4. make sure endpoints with invalid bindings are ignored and those marked as NOT default are still used @@ -780,7 +780,7 @@ public function testGetDefaultEndpoint(): void 'index' => 2, 'isDefault' => false, 'Location' => 'https://www2.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], ], ]; @@ -788,24 +788,24 @@ public function testGetDefaultEndpoint(): void // if we specify the binding, we should get it back [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], // if we specify ResponseLocation, we should get it back too [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, 'ResponseLocation' => 'https://example.com/endpoint.php', ], // indexes must NOT be taken into account, order is the only thing that matters here [ 'Location' => 'https://www1.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, 'index' => 1, ], // isDefault must have higher priority than indexes [ 'Location' => 'https://www1.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, 'isDefault' => true, 'index' => 2, ], @@ -814,16 +814,16 @@ public function testGetDefaultEndpoint(): void 'index' => 2, 'isDefault' => false, 'Location' => 'https://www2.example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_POST, + 'Binding' => C::BINDING_HTTP_POST, ], ]; $valid_bindings = [ - Constants::BINDING_HTTP_POST, - Constants::BINDING_HTTP_REDIRECT, - Constants::BINDING_HOK_SSO, - Constants::BINDING_HTTP_ARTIFACT, - Constants::BINDING_SOAP, + C::BINDING_HTTP_POST, + C::BINDING_HTTP_REDIRECT, + C::BINDING_HOK_SSO, + C::BINDING_HTTP_ARTIFACT, + C::BINDING_SOAP, ]; $a = [ @@ -863,14 +863,14 @@ public function testGetDefaultEndpoint(): void $this->assertEquals( [ 'Location' => 'https://example.com/ars', - 'Binding' => Constants::BINDING_SOAP, + 'Binding' => C::BINDING_SOAP, ], $c->getDefaultEndpoint('ArtifactResolutionService'), ); $this->assertEquals( [ 'Location' => 'https://example.com/slo', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, ], $c->getDefaultEndpoint('SingleLogoutService'), ); @@ -954,7 +954,7 @@ public function testGetEndpoints(): void [ [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, 'ResponseLocation' => 1234, ], ], @@ -962,7 +962,7 @@ public function testGetEndpoints(): void [ [ 'Location' => 'https://example.com/endpoint.php', - 'Binding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => C::BINDING_HTTP_REDIRECT, 'index' => 'string', ], ], diff --git a/tests/src/SimpleSAML/Controller/FrontpageControllerTest.php b/tests/src/SimpleSAML/Controller/FrontpageControllerTest.php new file mode 100644 index 0000000000..d2bf40b57f --- /dev/null +++ b/tests/src/SimpleSAML/Controller/FrontpageControllerTest.php @@ -0,0 +1,78 @@ + 'https://example.com/simplesaml/', + ], '[ARRAY]', 'simplesaml'); + + $controller = new FrontpageController(); + $response = $controller->redirect(); + + $this->assertInstanceOf(RunnableResponse::class, $response); + + $callable = $response->getCallable(); + $this->assertIsArray($callable); + $this->assertInstanceOf(HTTP::class, $callable[0]); + $this->assertSame('redirectTrustedURL', $callable[1]); + + $arguments = $response->getArguments(); + $this->assertCount(1, $arguments); + $this->assertSame('https://example.com/simplesaml/module/core/welcome', $arguments[0]); + } + + + public function testRedirectUsesConfiguredFrontpageRedirect(): void + { + Configuration::loadFromArray([ + 'baseurlpath' => 'https://example.com/simplesaml/', + 'frontpage.redirect' => 'https://custom.example.org/home', + ], '[ARRAY]', 'simplesaml'); + + $controller = new FrontpageController(); + $response = $controller->redirect(); + + $this->assertInstanceOf(RunnableResponse::class, $response); + + $callable = $response->getCallable(); + $this->assertIsArray($callable); + $this->assertInstanceOf(HTTP::class, $callable[0]); + $this->assertSame('redirectTrustedURL', $callable[1]); + + $arguments = $response->getArguments(); + $this->assertCount(1, $arguments); + $this->assertSame('https://custom.example.org/home', $arguments[0]); + } +} diff --git a/tests/src/SimpleSAML/Controller/ObsoleteRouteControllerTest.php b/tests/src/SimpleSAML/Controller/ObsoleteRouteControllerTest.php new file mode 100644 index 0000000000..49a5823fba --- /dev/null +++ b/tests/src/SimpleSAML/Controller/ObsoleteRouteControllerTest.php @@ -0,0 +1,37 @@ +assertInstanceOf(Response::class, $response); + $this->assertSame(410, $response->getStatusCode()); + $this->assertSame('This route is not used anymore.', $response->getContent()); + $this->assertSame('text/plain; charset=UTF-8', $response->headers->get('Content-Type')); + } + + + public function testInvokeWithCustomArguments(): void + { + $controller = new ObsoleteRouteController(); + $response = $controller('Custom gone message', 404); + + $this->assertInstanceOf(Response::class, $response); + $this->assertSame(404, $response->getStatusCode()); + $this->assertSame('Custom gone message', $response->getContent()); + $this->assertSame('text/plain; charset=UTF-8', $response->headers->get('Content-Type')); + } +} diff --git a/tests/src/SimpleSAML/EventSubscriber/ExceptionSubscriberTest.php b/tests/src/SimpleSAML/EventSubscriber/ExceptionSubscriberTest.php new file mode 100644 index 0000000000..5d194d9dd3 --- /dev/null +++ b/tests/src/SimpleSAML/EventSubscriber/ExceptionSubscriberTest.php @@ -0,0 +1,115 @@ + ArrayLogger::class, + 'errorreporting' => false, + 'module.enable' => ['core' => true], + ], + '[ARRAY]', + 'simplesaml', + ); + Configuration::setPreLoadedConfig($config, 'config.php'); + } + + + protected function tearDown(): void + { + Configuration::clearInternalState(); + } + + + public function testGetSubscribedEvents(): void + { + $events = ExceptionSubscriber::getSubscribedEvents(); + $this->assertArrayHasKey(KernelEvents::EXCEPTION, $events); + $this->assertSame(['onKernelException', 200], $events[KernelEvents::EXCEPTION]); + } + + + public function testOnKernelExceptionHandlesGeneralException(): void + { + $kernel = $this->createMock(HttpKernelInterface::class); + $request = new Request(); + $exception = new Exception('Unhandled test error'); + $event = new ExceptionEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $exception); + + $subscriber = new ExceptionSubscriber(); + $subscriber->onKernelException($event); + + $response = $event->getResponse(); + $this->assertInstanceOf(Template::class, $response); + $this->assertSame(500, $response->getStatusCode()); + } + + + public function testOnKernelExceptionHandlesNotFoundHttpException(): void + { + $kernel = $this->createMock(HttpKernelInterface::class); + $request = new Request(); + $exception = new NotFoundHttpException('Route not found'); + $event = new ExceptionEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $exception); + + $subscriber = new ExceptionSubscriber(); + $subscriber->onKernelException($event); + + $response = $event->getResponse(); + $this->assertInstanceOf(Template::class, $response); + $this->assertSame(404, $response->getStatusCode()); + } + + + public function testOnKernelExceptionHandlesMethodNotAllowedHttpException(): void + { + $kernel = $this->createMock(HttpKernelInterface::class); + $request = new Request(); + $exception = new MethodNotAllowedHttpException(['GET', 'POST'], 'Method not allowed'); + $event = new ExceptionEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $exception); + + $subscriber = new ExceptionSubscriber(); + $subscriber->onKernelException($event); + + $response = $event->getResponse(); + $this->assertInstanceOf(Template::class, $response); + $this->assertSame(405, $response->getStatusCode()); + } +} diff --git a/tests/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriberTest.php b/tests/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriberTest.php new file mode 100644 index 0000000000..dc6eea9135 --- /dev/null +++ b/tests/src/SimpleSAML/EventSubscriber/SecurityHeadersSubscriberTest.php @@ -0,0 +1,89 @@ +config = Configuration::loadFromArray([ + 'headers.security' => [ + 'X-Content-Type-Options' => 'nosniff', + 'X-Frame-Options' => 'SAMEORIGIN', + ], + ], '', 'simplesaml'); + + $this->subscriber = new SecurityHeadersSubscriber($this->config); + $this->kernel = $this->createMock(HttpKernelInterface::class); + } + + + public function testGetSubscribedEvents(): void + { + $events = SecurityHeadersSubscriber::getSubscribedEvents(); + $this->assertArrayHasKey(KernelEvents::RESPONSE, $events); + $this->assertEquals(['onKernelResponse', 0], $events[KernelEvents::RESPONSE]); + } + + + public function testOnKernelResponseMainRequestAppliesHeaders(): void + { + $request = new Request(); + $response = new Response(); + $event = new ResponseEvent($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); + + $this->subscriber->onKernelResponse($event); + + $this->assertTrue($response->headers->has('X-Content-Type-Options')); + $this->assertEquals('nosniff', $response->headers->get('X-Content-Type-Options')); + $this->assertTrue($response->headers->has('X-Frame-Options')); + $this->assertEquals('SAMEORIGIN', $response->headers->get('X-Frame-Options')); + } + + + public function testOnKernelResponseSubRequestIgnoresHeaders(): void + { + $request = new Request(); + $response = new Response(); + $event = new ResponseEvent($this->kernel, $request, HttpKernelInterface::SUB_REQUEST, $response); + + $this->subscriber->onKernelResponse($event); + + $this->assertFalse($response->headers->has('X-Content-Type-Options')); + $this->assertFalse($response->headers->has('X-Frame-Options')); + } + + + public function testOnKernelResponsePreservesExistingHeaders(): void + { + $request = new Request(); + $response = new Response(); + $response->headers->set('X-Frame-Options', 'DENY'); + $event = new ResponseEvent($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); + + $this->subscriber->onKernelResponse($event); + + $this->assertEquals('DENY', $response->headers->get('X-Frame-Options')); + $this->assertEquals('nosniff', $response->headers->get('X-Content-Type-Options')); + } +} diff --git a/tests/src/SimpleSAML/KernelTest.php b/tests/src/SimpleSAML/KernelTest.php new file mode 100644 index 0000000000..c95a09d86f --- /dev/null +++ b/tests/src/SimpleSAML/KernelTest.php @@ -0,0 +1,67 @@ + 'https://example.com/simplesaml/', + 'cachedir' => $cacheDir, + 'tempdir' => $cacheDir, + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', + 'module.enable' => [ + 'admin' => true, + 'core' => true, + 'saml' => true, + ], + ], '', 'simplesaml'); + Configuration::setPreLoadedConfig($config); + + $kernel = new Kernel(); + $kernel->boot(); + + $routes = $kernel->getContainer()->get('router')->getRouteCollection(); + $adminMain = $routes->get('admin-main'); + $samlMetadata = $routes->get('saml-sp-metadata'); + + $this->assertInstanceOf(Route::class, $adminMain); + $this->assertEquals('/module/admin', $adminMain->getPath()); + + $this->assertInstanceOf(Route::class, $samlMetadata); + $this->assertEquals('/module/saml/sp/metadata/{sourceId}', $samlMetadata->getPath()); + + // Every module route is also served natively (no redirect) under the legacy + // "module.php" path prefix, so peers holding pre-3.0 SAML metadata keep working. + $legacyAdminMain = $routes->get('legacy-admin-main'); + $legacySamlMetadata = $routes->get('legacy-saml-sp-metadata'); + + $this->assertInstanceOf(Route::class, $legacyAdminMain); + $this->assertEquals('/module.php/admin', $legacyAdminMain->getPath()); + + $this->assertInstanceOf(Route::class, $legacySamlMetadata); + $this->assertEquals('/module.php/saml/sp/metadata/{sourceId}', $legacySamlMetadata->getPath()); + + $kernel->shutdown(); + } +} diff --git a/tests/src/SimpleSAML/Metadata/SAMLParserTest.php b/tests/src/SimpleSAML/Metadata/SAMLParserTest.php index 58d1c38730..9f280418e5 100644 --- a/tests/src/SimpleSAML/Metadata/SAMLParserTest.php +++ b/tests/src/SimpleSAML/Metadata/SAMLParserTest.php @@ -6,8 +6,8 @@ use DOMDocument; use PHPUnit\Framework\Attributes\CoversClass; -use SAML2\Constants; use SimpleSAML\Metadata\SAMLParser; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Test\SigningTestCase; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\Signer; @@ -26,7 +26,7 @@ public function testDiscoveryResponse(): void $expected = [ 0 => [ 'index' => 43, - 'Binding' => Constants::NS_IDPDISC, + 'Binding' => C::NS_IDPDISC, 'Location' => 'https://simplesamlphp.org/some/endpoint', 'isDefault' => false, ], diff --git a/tests/src/SimpleSAML/ModuleTest.php b/tests/src/SimpleSAML/ModuleTest.php index 7942cb36f1..2cedbf517f 100644 --- a/tests/src/SimpleSAML/ModuleTest.php +++ b/tests/src/SimpleSAML/ModuleTest.php @@ -50,11 +50,11 @@ public function testGetModuleURL(): void 'baseurlpath' => 'https://example.com/simplesaml/', ], '', 'simplesaml'); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/script.php', + 'https://example.com/simplesaml/module/module/script.php', Module::getModuleURL('module/script.php'), ); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/script.php?param1=value1¶m2=value2', + 'https://example.com/simplesaml/module/module/script.php?param1=value1¶m2=value2', Module::getModuleURL('module/script.php', [ 'param1' => 'value1', 'param2' => 'value2', @@ -63,6 +63,21 @@ public function testGetModuleURL(): void } + /** + * Test for SimpleSAML\Module::getModuleAssetUrl(). + */ + public function testGetModuleAssetUrl(): void + { + Configuration::loadFromArray([ + 'baseurlpath' => 'https://example.com/simplesaml/', + ], '', 'simplesaml'); + $this->assertEquals( + 'https://example.com/simplesaml/assets/admin/css/admin.css', + Module::getModuleAssetUrl('admin', 'css/admin.css'), + ); + } + + /** * Test for SimpleSAML\Module::getModules(). */ @@ -100,6 +115,12 @@ public function testResolveClassNotSubclass(): void */ public function testResolveClass(): void { + Module::$module_info = []; + $config = Configuration::loadFromArray([ + 'module.enable' => ['cron' => true], + ], '', 'simplesaml'); + Configuration::setPreLoadedConfig($config); + // most basic test $this->assertEquals('SimpleSAML\Module\cron\Cron', Module::resolveClass('cron:Cron', '')); diff --git a/tests/src/SimpleSAML/SessionTest.php b/tests/src/SimpleSAML/SessionTest.php index c6d943fba0..f904211c8e 100644 --- a/tests/src/SimpleSAML/SessionTest.php +++ b/tests/src/SimpleSAML/SessionTest.php @@ -134,4 +134,30 @@ public function testGetDataWithExpiredSessionKey(bool $allowedExpired, string|in $this->assertNull($fetchedData); } } + + public function testDataStoreLimit() + { + $session = Session::getSessionFromRequest(); + + //for this test, we set a datastore limit + $config = Configuration::loadFromArray(['session.datastore.limit' => 3], '[ARRAY]', 'simplesaml'); + $session->setConfiguration($config); + + //set 3 values for a data type testType + $session->setData('testType', 'testKey1', 'data1'); + $session->setData('testType', 'testKey2', 'data2'); + $session->setData('testType', 'testKey3', 'data3'); + + //we still expect the first value to be present... + $this->assertEquals('data1', $this->session->getData('testType', 'testKey1')); + + //but if we add one more, it should get removed + $session->setData('testType', 'testKey4', 'data4'); + $this->assertNull($this->session->getData('testType', 'testKey1')); + + //verify the other expected values remain + $this->assertEquals('data2', $this->session->getData('testType', 'testKey2')); + $this->assertEquals('data3', $this->session->getData('testType', 'testKey3')); + $this->assertEquals('data4', $this->session->getData('testType', 'testKey4')); + } } diff --git a/tests/src/SimpleSAML/Utils/Config/MetadataTest.php b/tests/src/SimpleSAML/Utils/Config/MetadataTest.php index f9084a81ae..a69952f8ca 100644 --- a/tests/src/SimpleSAML/Utils/Config/MetadataTest.php +++ b/tests/src/SimpleSAML/Utils/Config/MetadataTest.php @@ -7,8 +7,8 @@ use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -use SAML2\Constants; use SAML2\XML\md\ContactPerson; +use SimpleSAML\SAML2\Constants as C; use SimpleSAML\Utils\Config\Metadata; use TypeError; @@ -256,7 +256,7 @@ public function testParseNameIdPolicyDefaults(): void // Test null or unset $nameIdPolicy = null; $this->assertEquals([ - 'Format' => Constants::NAMEID_TRANSIENT, + 'Format' => C::NAMEID_TRANSIENT, 'AllowCreate' => false, ], Metadata::parseNameIdPolicy($nameIdPolicy)); @@ -272,7 +272,7 @@ public function testParseNameIdPolicyDefaults(): void 'AllowCreate' => false, ]; $this->assertEquals([ - 'Format' => Constants::NAMEID_TRANSIENT, + 'Format' => C::NAMEID_TRANSIENT, 'AllowCreate' => false, ], Metadata::parseNameIdPolicy($nameIdPolicy)); } diff --git a/tests/src/SimpleSAML/Utils/HTTPTest.php b/tests/src/SimpleSAML/Utils/HTTPTest.php index 1520ace66a..b32fe26d80 100644 --- a/tests/src/SimpleSAML/Utils/HTTPTest.php +++ b/tests/src/SimpleSAML/Utils/HTTPTest.php @@ -108,31 +108,38 @@ public function testGuessBasePath(): void $original = $_SERVER; $httpUtils = new Utils\HTTP(); - $_SERVER['REQUEST_URI'] = '/simplesaml/module.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/simplesaml/index.php'; + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/simplesaml/', $httpUtils->guessBasePath()); - $_SERVER['REQUEST_URI'] = '/simplesaml/module.php/some/path/to/other/script.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/simplesaml/module/admin'; + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/simplesaml/', $httpUtils->guessBasePath()); - $_SERVER['REQUEST_URI'] = '/module.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/index.php'; + $_SERVER['SCRIPT_NAME'] = '/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/', $httpUtils->guessBasePath()); - $_SERVER['REQUEST_URI'] = '/module.php/some/path/to/other/script.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/module/admin'; + $_SERVER['SCRIPT_NAME'] = '/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/', $httpUtils->guessBasePath()); - $_SERVER['REQUEST_URI'] = '/some/path/module.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/some/path/index.php'; + $_SERVER['SCRIPT_NAME'] = '/some/path/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/some/path/', $httpUtils->guessBasePath()); - $_SERVER['REQUEST_URI'] = '/some/path/module.php/some/path/to/other/script.php'; - $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/module.php'); + $_SERVER['REQUEST_URI'] = '/some/path/module/admin'; + $_SERVER['SCRIPT_NAME'] = '/some/path/index.php'; + $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/public/index.php'); $this->assertEquals('/some/path/', $httpUtils->guessBasePath()); $_SERVER['REQUEST_URI'] = '/some/dir/in/www/script.php'; + unset($_SERVER['SCRIPT_NAME']); $_SERVER['SCRIPT_FILENAME'] = self::makeNativePath('/some/path/simplesamlphp/www/some/dir/in/www/script.php'); $this->assertEquals('/', $httpUtils->guessBasePath()); @@ -217,12 +224,13 @@ public function testGetSelfURLMethods(): void $this->assertTrue($httpUtils->isHTTPS()); $this->assertEquals('https://' . $httpUtils->getSelfHostWithNonStandardPort(), $httpUtils->getSelfURLHost()); - // test a request URI that doesn't match the current script + // test a request URI that doesn't match the configured SimpleSAMLphp base path $cfg = Configuration::loadFromArray([ 'baseurlpath' => 'https://example.org/simplesaml/', ], '[ARRAY]', 'simplesaml'); $baseDir = $cfg->getBaseDir(); - $_SERVER['SCRIPT_FILENAME'] = $baseDir . 'public/module.php'; + $_SERVER['SCRIPT_FILENAME'] = $baseDir . 'public/index.php'; + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; $this->setupEnvFromURL('http://www.example.com/protected/resource.asp?foo=bar'); $this->assertEquals('http://www.example.com/protected/resource.asp?foo=bar', $httpUtils->getSelfURL()); $this->assertEquals('http://www.example.com', $httpUtils->getSelfURLHost()); @@ -235,14 +243,16 @@ public function testGetSelfURLMethods(): void Configuration::loadFromArray([ 'baseurlpath' => 'https://example.com/simplesaml/', ], '[ARRAY]', 'simplesaml'); - $this->setupEnvFromURL('http://www.example.org/module.php/module/file.php?foo=bar'); + $_SERVER['SCRIPT_FILENAME'] = $baseDir . 'public/index.php'; + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $this->setupEnvFromURL('http://www.example.org/simplesaml/module/module/file.php?foo=bar'); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/file.php?foo=bar', + 'https://example.com/simplesaml/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('https://example.com', $httpUtils->getSelfURLHost()); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/file.php', + 'https://example.com/simplesaml/module/module/file.php', $httpUtils->getSelfURLNoQuery(), ); $this->assertTrue($httpUtils->isHTTPS()); @@ -253,12 +263,12 @@ public function testGetSelfURLMethods(): void 'baseurlpath' => 'https://example.com/simplesaml', ], '[ARRAY]', 'simplesaml'); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/file.php?foo=bar', + 'https://example.com/simplesaml/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('https://example.com', $httpUtils->getSelfURLHost()); $this->assertEquals( - 'https://example.com/simplesaml/module.php/module/file.php', + 'https://example.com/simplesaml/module/module/file.php', $httpUtils->getSelfURLNoQuery(), ); $this->assertTrue($httpUtils->isHTTPS()); @@ -268,12 +278,14 @@ public function testGetSelfURLMethods(): void Configuration::loadFromArray([ 'baseurlpath' => 'https://example.com', ], '[ARRAY]', 'simplesaml'); + $_SERVER['SCRIPT_NAME'] = '/index.php'; + $this->setupEnvFromURL('http://www.example.org/module/module/file.php?foo=bar'); $this->assertEquals( - 'https://example.com/module.php/module/file.php?foo=bar', + 'https://example.com/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('https://example.com', $httpUtils->getSelfURLHost()); - $this->assertEquals('https://example.com/module.php/module/file.php', $httpUtils->getSelfURLNoQuery()); + $this->assertEquals('https://example.com/module/module/file.php', $httpUtils->getSelfURLNoQuery()); $this->assertTrue($httpUtils->isHTTPS()); $this->assertEquals('https://' . $httpUtils->getSelfHostWithNonStandardPort(), $httpUtils->getSelfURLHost()); @@ -281,14 +293,15 @@ public function testGetSelfURLMethods(): void Configuration::loadFromArray([ 'baseurlpath' => '/simplesaml/', ], '[ARRAY]', 'simplesaml'); - $this->setupEnvFromURL('http://www.example.org/simplesaml/module.php/module/file.php?foo=bar'); + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $this->setupEnvFromURL('http://www.example.org/simplesaml/module/module/file.php?foo=bar'); $this->assertEquals( - 'http://www.example.org/simplesaml/module.php/module/file.php?foo=bar', + 'http://www.example.org/simplesaml/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('http://www.example.org', $httpUtils->getSelfURLHost()); $this->assertEquals( - 'http://www.example.org/simplesaml/module.php/module/file.php', + 'http://www.example.org/simplesaml/module/module/file.php', $httpUtils->getSelfURLNoQuery(), ); $this->assertFalse($httpUtils->isHTTPS()); @@ -298,14 +311,15 @@ public function testGetSelfURLMethods(): void Configuration::loadFromArray([ 'baseurlpath' => '/simplesaml/', ], '[ARRAY]', 'simplesaml'); - $this->setupEnvFromURL('http://example.org:8080/simplesaml/module.php/module/file.php?foo=bar'); + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $this->setupEnvFromURL('http://example.org:8080/simplesaml/module/module/file.php?foo=bar'); $this->assertEquals( - 'http://example.org:8080/simplesaml/module.php/module/file.php?foo=bar', + 'http://example.org:8080/simplesaml/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('http://example.org:8080', $httpUtils->getSelfURLHost()); $this->assertEquals( - 'http://example.org:8080/simplesaml/module.php/module/file.php', + 'http://example.org:8080/simplesaml/module/module/file.php', $httpUtils->getSelfURLNoQuery(), ); $this->assertFalse($httpUtils->isHTTPS()); @@ -315,14 +329,15 @@ public function testGetSelfURLMethods(): void Configuration::loadFromArray([ 'baseurlpath' => '/simplesaml/', ], '[ARRAY]', 'simplesaml'); - $this->setupEnvFromURL('https://example.org:8080/simplesaml/module.php/module/file.php?foo=bar'); + $_SERVER['SCRIPT_NAME'] = '/simplesaml/index.php'; + $this->setupEnvFromURL('https://example.org:8080/simplesaml/module/module/file.php?foo=bar'); $this->assertEquals( - 'https://example.org:8080/simplesaml/module.php/module/file.php?foo=bar', + 'https://example.org:8080/simplesaml/module/module/file.php?foo=bar', $httpUtils->getSelfURL(), ); $this->assertEquals('https://example.org:8080', $httpUtils->getSelfURLHost()); $this->assertEquals( - 'https://example.org:8080/simplesaml/module.php/module/file.php', + 'https://example.org:8080/simplesaml/module/module/file.php', $httpUtils->getSelfURLNoQuery(), ); $this->assertTrue($httpUtils->isHTTPS()); @@ -344,7 +359,7 @@ public function testCheckURLAllowedWithoutRegex(): void 'trusted.url.regex' => false, ], '[ARRAY]', 'simplesaml'); - $_SERVER['REQUEST_URI'] = '/module.php'; + $_SERVER['REQUEST_URI'] = '/index.php'; $allowed = [ 'https://sp.example.com/', @@ -377,7 +392,7 @@ public function testCheckURLAllowedWithRegex(): void 'trusted.url.regex' => true, ], '[ARRAY]', 'simplesaml'); - $_SERVER['REQUEST_URI'] = '/module.php'; + $_SERVER['REQUEST_URI'] = '/index.php'; $allowed = [ 'https://sp.example.com/', @@ -460,7 +475,7 @@ public function testCheckURLAllowedWithRegexWithoutDelimiters(): void 'trusted.url.regex' => true, ], '[ARRAY]', 'simplesaml'); - $_SERVER['REQUEST_URI'] = '/module.php'; + $_SERVER['REQUEST_URI'] = '/index.php'; $this->expectException(Error\Exception::class); $httpUtils->checkURLAllowed('https://app.example.com.evil.com'); @@ -676,7 +691,7 @@ public function testSubmitPOSTDataRedirectsFromHttpsToHttp(): void ], '[ARRAY]', 'simplesaml'); // Simulate the current request being HTTPS - $this->setupEnvFromURL('https://idp.example.org/simplesaml/module.php/core/someaction?x=1'); + $this->setupEnvFromURL('https://idp.example.org/simplesaml/module/core/someaction?x=1'); // Destination is explicitly http:// $destination = 'http://sp.example.com/acs'; @@ -761,14 +776,14 @@ public static function slowPostDelayProvider(): array /** * Ensure getSelfURL() returns the externally visible URL when SimpleSAMLphp - * is reached via a rewritten path (e.g. /cas/login -> /simplesaml/module.php/...), - * and the internal script name (module.php) appears only in the query string. + * is reached via a rewritten path (e.g. /cas/login -> /simplesaml/index.php), + * and the front controller path is not part of the externally visible URL. * * This simulates an Apache mod_rewrite rule like: - * RewriteRule ^/cas/login(.*) /${SSP_APACHE_ALIAS}module.php/casserver/login.php$1 [PT] + * RewriteRule ^/cas/login(.*) /${SSP_APACHE_ALIAS}index.php [PT] * * In this scenario the public URL is /cas/login?... while the actual script is - * public/module.php. + * public/index.php. */ public function testGetSelfURLWithRewrittenCasLogin(): void { @@ -787,21 +802,21 @@ public function testGetSelfURLWithRewrittenCasLogin(): void 'SERVER_NAME' => 'tr-monitor-okta2.qa.athena-institute.net', 'SERVER_PORT' => 443, 'SCRIPT_URI' => 'https://tr-monitor-okta2.qa.athena-institute.net/cas/login', - 'SCRIPT_NAME' => '/module.php', - 'SCRIPT_FILENAME' => $baseDir . 'public' . DIRECTORY_SEPARATOR . 'module.php', - 'PATH_TRANSLATED' => $baseDir . 'public' . DIRECTORY_SEPARATOR . 'casserver/login.php', - 'PHP_SELF' => '/module.php/casserver/login.php', + 'SCRIPT_NAME' => '/simplesaml/index.php', + 'SCRIPT_FILENAME' => $baseDir . 'public' . DIRECTORY_SEPARATOR . 'index.php', + 'PATH_TRANSLATED' => $baseDir . 'public' . DIRECTORY_SEPARATOR . 'index.php', + 'PHP_SELF' => '/simplesaml/index.php', 'QUERY_STRING' => 'service=' - . 'https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule.php%2Fcas%2Flinkback.php' + . 'https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule%2Fcas%2Flinkback' . '%3FstateId%3D_somestate', 'REQUEST_URI' => '/cas/login?service=' - . 'https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule.php%2Fcas%2Flinkback.php' + . 'https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule%2Fcas%2Flinkback' . '%3FstateId%3D_somestate', ]; $expected = 'https://tr-monitor-okta2.qa.athena-institute.net' . '/cas/login' - . '?service=https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule.php%2Fcas%2Flinkback.php' + . '?service=https%3A%2F%2Fcas-test-bridge.bridge.qa.cirrusidentity.com%2Fmodule%2Fcas%2Flinkback' . '%3FstateId%3D_somestate'; $this->assertSame($expected, $httpUtils->getSelfURL()); diff --git a/tests/src/SimpleSAML/XHTML/TemplateTest.php b/tests/src/SimpleSAML/XHTML/TemplateTest.php index 2bfebec83c..5b425fe332 100644 --- a/tests/src/SimpleSAML/XHTML/TemplateTest.php +++ b/tests/src/SimpleSAML/XHTML/TemplateTest.php @@ -182,7 +182,7 @@ public function testAssetWillReturnPathOnTagIsFalse(): void $tagModule = $moduleTemplate->asset('css/admin.css', 'admin', false); $this->assertStringNotContainsString('?tag=', $tagModule); $this->assertEquals( - 'http://localhost/simplesaml/module.php/admin/assets/css/admin.css', + 'http://localhost/simplesaml/assets/admin/css/admin.css', $tagModule, ); } diff --git a/tests/www/IndexTest.php b/tests/www/IndexTest.php index 7f0a443a54..123e3f04d4 100644 --- a/tests/www/IndexTest.php +++ b/tests/www/IndexTest.php @@ -71,39 +71,51 @@ public function testRedirection(): void // test most basic redirection $this->updateConfig([ 'baseurlpath' => 'http://example.org/simplesaml/', + 'cachedir' => sys_get_temp_dir(), + 'tempdir' => sys_get_temp_dir(), + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', ]); $resp = self::$server->get('/index.php', [], [ CURLOPT_FOLLOWLOCATION => 0, ]); $this->assertEquals('303', $resp['code']); $this->assertEquals( - 'http://example.org/simplesaml/module.php/core/welcome', + 'http://example.org/simplesaml/module/core/welcome', $resp['headers']['Location'], ); // test non-default path and https $this->updateConfig([ 'baseurlpath' => 'https://example.org/', + 'cachedir' => sys_get_temp_dir(), + 'tempdir' => sys_get_temp_dir(), + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', ]); $resp = self::$server->get('/index.php', [], [ CURLOPT_FOLLOWLOCATION => 0, ]); $this->assertEquals('303', $resp['code']); $this->assertEquals( - 'https://example.org/module.php/core/welcome', + 'https://example.org/module/core/welcome', $resp['headers']['Location'], ); // test URL guessing $this->updateConfig([ 'baseurlpath' => '/simplesaml/', + 'cachedir' => sys_get_temp_dir(), + 'tempdir' => sys_get_temp_dir(), + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', ]); $resp = self::$server->get('/index.php', [], [ CURLOPT_FOLLOWLOCATION => 0, ]); $this->assertEquals('303', $resp['code']); $this->assertEquals( - 'http://' . self::$server_addr . '/simplesaml/module.php/core/welcome', + 'http://' . self::$server_addr . '/simplesaml/module/core/welcome', $resp['headers']['Location'], ); } @@ -116,10 +128,15 @@ public function testRedirectionFrontpageRedirectOption(): void { $this->updateConfig([ 'frontpage.redirect' => 'https://www.example.edu/', + 'cachedir' => sys_get_temp_dir(), + 'tempdir' => sys_get_temp_dir(), + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', ]); $resp = self::$server->get('/index.php', [], [ CURLOPT_FOLLOWLOCATION => 0, ]); + $this->assertEquals('303', $resp['code']); $this->assertEquals( 'https://www.example.edu/', @@ -128,6 +145,27 @@ public function testRedirectionFrontpageRedirectOption(): void } + /** + * Test that module URLs are handled by the front controller branch instead of being redirected. + */ + public function testModulePathIsHandledByFrontController(): void + { + $this->updateConfig([ + 'baseurlpath' => 'http://example.org/simplesaml/', + 'cachedir' => sys_get_temp_dir(), + 'tempdir' => sys_get_temp_dir(), + 'logging.handler' => 'errorlog', + 'secretsalt' => 'test-secret', + ]); + $resp = self::$server->get('/index.php/module/doesnotexist', [], [ + CURLOPT_FOLLOWLOCATION => 0, + ]); + + $this->assertEquals('404', $resp['code']); + $this->assertArrayNotHasKey('Location', $resp['headers']); + } + + /** * The tear down method that is executed after all tests in this class. */