diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a93a81..3732f01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,29 +3,18 @@ workflows: version: 2 main: jobs: - - lint - - test-behat: - requires: - - lint + - test-behat - test-phpunit: name: "Test with PHP 7.4" - requires: - - lint php_version: "7.4" - test-phpunit: name: "Test with PHP 8.0" - requires: - - lint php_version: "8.0" - test-phpunit: name: "Test with PHP 8.1" - requires: - - lint php_version: "8.1" - test-phpunit: name: "Test with PHP 8.2" - requires: - - lint php_version: "8.2" nightly: triggers: @@ -38,24 +27,6 @@ workflows: jobs: - test-behat jobs: - lint: - working_directory: ~/pantheon-systems/wp-saml-auth - docker: - - image: quay.io/pantheon-public/build-tools-ci:8.x-php8.0 - steps: - - checkout - - restore_cache: - keys: - - test-lint-dependencies-{{ checksum "composer.json" }} - - run: composer install -n --prefer-dist - - save_cache: - key: test-lint-dependencies-{{ checksum "composer.json" }} - paths: - - vendor - - run: - name: "Run PHP Lint" - command: | - composer phpcs test-behat: working_directory: ~/pantheon-systems/wp-saml-auth parallelism: 1 diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 4e3c384..3a0c451 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -19,3 +19,13 @@ jobs: uses: pantheon-systems/action-wporg-validator@1.0.0 with: type: plugin + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Lint + run: | + composer install + composer lint diff --git a/bin/behat-prepare.sh b/bin/behat-prepare.sh index 2745570..ee1eab6 100755 --- a/bin/behat-prepare.sh +++ b/bin/behat-prepare.sh @@ -43,12 +43,14 @@ git clone -b $TERMINUS_ENV $PANTHEON_GIT_URL $PREPARE_DIR ### # Add WP Native PHP Sessions and child theme to environment ### +echo "Creating a child theme called $TERMINUS_SITE" rm -rf $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE # Create a child theme that includes WP SAML Auth configuration details mkdir $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE cp $BASH_DIR/fixtures/functions.php $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE/functions.php cp $BASH_DIR/fixtures/style.css $PREPARE_DIR/wp-content/themes/$TERMINUS_SITE/style.css +echo "Adding WP Native PHP Sessions to the environment" rm -rf $PREPARE_DIR/wp-content/plugins/wp-native-php-sessions # Download the latest WP Native PHP sessions release from WordPress.org wget -O $PREPARE_DIR/wp-native-php-sessions.zip https://downloads.wordpress.org/plugin/wp-native-php-sessions.zip @@ -59,6 +61,7 @@ rm $PREPARE_DIR/wp-native-php-sessions.zip ### # Add the copy of this plugin itself to the environment ### +echo "Copying WP SAML Auth into WordPress" cd $BASH_DIR/.. rsync -av --exclude='node_modules/' --exclude='simplesamlphp/' --exclude='tests/' ./* $PREPARE_DIR/wp-content/plugins/wp-saml-auth rm -rf $PREPARE_DIR/wp-content/plugins/wp-saml-auth/.git @@ -68,6 +71,7 @@ rm -rf $PREPARE_DIR/wp-content/plugins/wp-saml-auth/.git # SimpleSAMLphp is installed to ~/code/private, and then symlinked into the # web root ### +echo "Setting up SimpleSAMLphp" rm -rf $PREPARE_DIR/private mkdir $PREPARE_DIR/private wget https://github.com/simplesamlphp/simplesamlphp/releases/download/v1.18.4/simplesamlphp-1.18.4.tar.gz -O $PREPARE_DIR/simplesamlphp-latest.tar.gz diff --git a/bin/fixtures/functions.php b/bin/fixtures/functions.php index f2bdfd5..faf0b4b 100644 --- a/bin/fixtures/functions.php +++ b/bin/fixtures/functions.php @@ -3,10 +3,10 @@ add_action( 'wp_enqueue_scripts', 'samltheme_parent_theme_enqueue_styles' ); function samltheme_parent_theme_enqueue_styles() { - wp_enqueue_style( 'twentytwentythree-style', get_template_directory_uri() . '/style.css' ); + wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'samltheme-style', get_stylesheet_directory_uri() . '/style.css', - array( 'twentytwentythree-style' ) + array( 'theme-style' ) ); } diff --git a/bin/fixtures/style.css b/bin/fixtures/style.css index af976a1..bc4de3e 100644 --- a/bin/fixtures/style.css +++ b/bin/fixtures/style.css @@ -1,7 +1,7 @@ /* Theme Name: WP SAML Auth Theme URI: https://pantheon.io -Description: Twentytwentythree child theme. +Description: TwentyTwentyThree child theme. Author: x Author URI: https://pantheon.io Template: twentytwentythree diff --git a/composer.lock b/composer.lock index c6e7ae8..ee69976 100644 --- a/composer.lock +++ b/composer.lock @@ -688,30 +688,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -738,7 +738,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -754,7 +754,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "fabpot/goutte", @@ -818,16 +818,16 @@ }, { "name": "fig-r/psr2r-sniffer", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/php-fig-rectified/psr2r-sniffer.git", - "reference": "53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2" + "reference": "c950b88ed7ad8ae115e11896bbe36d5896aa4f36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2", - "reference": "53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2", + "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/c950b88ed7ad8ae115e11896bbe36d5896aa4f36", + "reference": "c950b88ed7ad8ae115e11896bbe36d5896aa4f36", "shasum": "" }, "require": { @@ -868,9 +868,9 @@ ], "support": { "issues": "https://github.com/php-fig-rectified/psr2r-sniffer/issues", - "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/1.5.0" + "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/1.5.1" }, - "time": "2023-01-01T15:31:05+00:00" + "time": "2023-09-23T19:16:19+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1646,16 +1646,16 @@ }, { "name": "phpcsstandards/phpcsextra", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "98bcdbacbda14b1db85f710b1853125726795bbc" + "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/98bcdbacbda14b1db85f710b1853125726795bbc", - "reference": "98bcdbacbda14b1db85f710b1853125726795bbc", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", "shasum": "" }, "require": { @@ -1705,7 +1705,7 @@ "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, - "time": "2023-08-26T04:46:45+00:00" + "time": "2023-09-20T22:06:18+00:00" }, { "name": "phpcsstandards/phpcsutils", @@ -1782,16 +1782,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.0", + "version": "1.24.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6" + "reference": "12f01d214f1c73b9c91fdb3b1c415e4c70652083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/3510b0a6274cc42f7219367cb3abfc123ffa09d6", - "reference": "3510b0a6274cc42f7219367cb3abfc123ffa09d6", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/12f01d214f1c73b9c91fdb3b1c415e4c70652083", + "reference": "12f01d214f1c73b9c91fdb3b1c415e4c70652083", "shasum": "" }, "require": { @@ -1823,22 +1823,22 @@ "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/1.24.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.3" }, - "time": "2023-09-07T20:46:32+00:00" + "time": "2023-11-18T20:15:32+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.28", + "version": "9.2.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef" + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", - "reference": "7134a5ccaaf0f1c92a4f5501a6c9f98ac4dcc0ef", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { @@ -1895,7 +1895,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/9.2.28" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" }, "funding": [ { @@ -1903,7 +1903,7 @@ "type": "github" } ], - "time": "2023-09-12T14:36:20+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2148,16 +2148,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.12", + "version": "9.6.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a122c2ebd469b751d774aa0f613dc0d67697653f" + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a122c2ebd469b751d774aa0f613dc0d67697653f", - "reference": "a122c2ebd469b751d774aa0f613dc0d67697653f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", "shasum": "" }, "require": { @@ -2231,7 +2231,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.12" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" }, "funding": [ { @@ -2247,7 +2247,7 @@ "type": "tidelift" } ], - "time": "2023-09-12T14:39:31+00:00" + "time": "2023-09-19T05:39:22+00:00" }, { "name": "psr/container", @@ -3468,32 +3468,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.13.4", + "version": "8.14.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322" + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/4b2af2fb17773656d02fbfb5d18024ebd19fe322", - "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.0", + "phpstan/phpdoc-parser": "^1.23.1", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.26", - "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan": "1.10.37", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.14", "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" + "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" }, "type": "phpcodesniffer-standard", "extra": { @@ -3517,7 +3517,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.13.4" + "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" }, "funding": [ { @@ -3529,24 +3529,24 @@ "type": "tidelift" } ], - "time": "2023-07-25T10:28:55+00:00" + "time": "2023-10-08T07:28:08+00:00" }, { "name": "spryker/code-sniffer", - "version": "0.17.18", + "version": "0.17.19", "source": { "type": "git", "url": "https://github.com/spryker/code-sniffer.git", - "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29" + "reference": "2156a1d4d257e20dacc955872c8f6b9c7b8be3fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/5fb8b573abc4a906d0d364a4a03abd38e565ba29", - "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29", + "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/2156a1d4d257e20dacc955872c8f6b9c7b8be3fd", + "reference": "2156a1d4d257e20dacc955872c8f6b9c7b8be3fd", "shasum": "" }, "require": { - "php": ">=7.4", + "php": ">=8.0", "slevomat/coding-standard": "^7.2.0 || ^8.0.1", "squizlabs/php_codesniffer": "^3.6.2" }, @@ -3587,7 +3587,7 @@ "issues": "https://github.com/spryker/code-sniffer/issues", "source": "https://github.com/spryker/code-sniffer" }, - "time": "2023-01-03T16:08:22+00:00" + "time": "2023-11-02T19:16:04+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3798,16 +3798,16 @@ }, { "name": "symfony/console", - "version": "v5.4.28", + "version": "v5.4.31", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827" + "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827", + "url": "https://api.github.com/repos/symfony/console/zipball/11ac5f154e0e5c4c77af83ad11ead9165280b92a", + "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a", "shasum": "" }, "require": { @@ -3877,7 +3877,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.28" + "source": "https://github.com/symfony/console/tree/v5.4.31" }, "funding": [ { @@ -3893,7 +3893,7 @@ "type": "tidelift" } ], - "time": "2023-08-07T06:12:30+00:00" + "time": "2023-10-31T07:58:33+00:00" }, { "name": "symfony/css-selector", @@ -4049,25 +4049,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4096,7 +4096,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.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { @@ -4112,7 +4112,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/dom-crawler", @@ -4275,29 +4275,26 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.2", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4334,7 +4331,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" }, "funding": [ { @@ -4350,7 +4347,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", @@ -5235,32 +5232,33 @@ }, { "name": "symfony/string", - "version": "v6.0.19", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" + "reference": "13880a87790c76ef994c91e87efb96134522577a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", + "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a", + "reference": "13880a87790c76ef994c91e87efb96134522577a", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -5300,7 +5298,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" + "source": "https://github.com/symfony/string/tree/v6.3.8" }, "funding": [ { @@ -5316,7 +5314,7 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2023-11-09T08:28:21+00:00" }, { "name": "symfony/translation", @@ -5487,20 +5485,21 @@ }, { "name": "symfony/yaml", - "version": "v6.0.19", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884" + "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3493af8a8dad7fa91c77fa473ba23ecd95334a92", + "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -5509,9 +5508,6 @@ "require-dev": { "symfony/console": "^5.4|^6.0" }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, "bin": [ "Resources/bin/yaml-lint" ], @@ -5541,7 +5537,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.0.19" + "source": "https://github.com/symfony/yaml/tree/v6.3.8" }, "funding": [ { @@ -5557,20 +5553,20 @@ "type": "tidelift" } ], - "time": "2023-01-11T11:50:03+00:00" + "time": "2023-11-06T10:58:05+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -5599,7 +5595,7 @@ "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/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -5607,20 +5603,20 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "bb792cb331472b82c5d7f28fb9b8ec2d20f68826" + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bb792cb331472b82c5d7f28fb9b8ec2d20f68826", - "reference": "bb792cb331472b82c5d7f28fb9b8ec2d20f68826", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", "shasum": "" }, "require": { @@ -5667,7 +5663,13 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2023-08-21T14:28:38+00:00" + "funding": [ + { + "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "type": "custom" + } + ], + "time": "2023-09-14T07:06:09+00:00" }, { "name": "yoast/phpunit-polyfills", @@ -5741,5 +5743,5 @@ "php": "^7.3 || ^8.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/inc/class-wp-saml-auth.php b/inc/class-wp-saml-auth.php index 64dd774..710679a 100644 --- a/inc/class-wp-saml-auth.php +++ b/inc/class-wp-saml-auth.php @@ -235,15 +235,25 @@ public function filter_login_body_class( $classes ) { public function filter_authenticate( $user, $username, $password ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable,Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed $permit_wp_login = self::get_option( 'permit_wp_login' ); - if ( is_a( $user, 'WP_User' ) && $permit_wp_login ) { + if ( is_a( $user, 'WP_User' ) ) { + + if ( ! $permit_wp_login ) { + $user = $this->do_saml_authentication(); + } + return $user; } - if ( ! empty( $_POST['SAMLResponse'] ) ) { - $user = $this->do_saml_authentication(); - } elseif ( ( ! $permit_wp_login && empty( $_GET['loggedout'] ) ) || ( ! empty( $_GET['action'] ) && 'wp-saml-auth' === $_GET['action'] ) ) { - $user = $this->do_saml_authentication(); + if ( ! $permit_wp_login ) { + $should_saml = ! isset( $_GET['loggedout'] ); + } else { + $should_saml = isset( $_POST['SAMLResponse'] ) || isset( $_GET['action'] ) && 'wp-saml-auth' === $_GET['action']; } + + if ( $should_saml ) { + return $this->do_saml_authentication(); + } + return $user; }