From 9f3eff4a393782f5ba0d05cc2a20437679f62b28 Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Mon, 17 Jun 2024 17:20:09 +0200 Subject: [PATCH] Upgraded deployment using Authress managed UI. --- Authress_Sso_Login.php | 2 +- composer.lock | 374 +++++++++++------- contributing.md | 12 + functions.php | 4 + lib/Authress_Sso_Login_Lock.php | 2 +- lib/Authress_Sso_Login_LoginManager.php | 14 +- lib/Authress_Sso_Login_Options.php | 6 +- ..._Login_RegistrationNotEnabledException.php | 3 - lib/Authress_Sso_Login_UsersRepo.php | 7 +- templates/assets/img/logo_16x16.png | Bin 3018 -> 3106 bytes templates/authress-login-form.php | 95 +++-- 11 files changed, 308 insertions(+), 211 deletions(-) delete mode 100644 lib/Authress_Sso_Login_RegistrationNotEnabledException.php diff --git a/Authress_Sso_Login.php b/Authress_Sso_Login.php index 0a50ed3..a079fef 100644 --- a/Authress_Sso_Login.php +++ b/Authress_Sso_Login.php @@ -272,7 +272,7 @@ function authress_sso_login_init() { add_action( 'init', 'authress_sso_login_init'); function check_for_user_logged_in() { - authress_debug_log('=> check_for_user_logged_in'); + authress_debug_log('=> check_for_user_logged_in()'); if (!is_user_logged_in() && isset($_REQUEST['nonce'])) { $users_repo = new Authress_Sso_Login_UsersRepo( Authress_Sso_Login_Options::Instance() ); diff --git a/composer.lock b/composer.lock index 14ffaa5..756205a 100644 --- a/composer.lock +++ b/composer.lock @@ -52,22 +52,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.1", + "version": "7.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -76,10 +76,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -89,8 +90,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -156,7 +158,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + "source": "https://github.com/guzzle/guzzle/tree/7.8.1" }, "funding": [ { @@ -172,38 +174,37 @@ "type": "tidelift" } ], - "time": "2021-12-06T18:43:05+00:00" + "time": "2023-12-03T20:35:24+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -240,7 +241,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/2.0.2" }, "funding": [ { @@ -256,26 +257,26 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2023-12-03T20:19:20+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -283,17 +284,18 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.36 || ^9.6.15" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -355,7 +357,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.2" }, "funding": [ { @@ -371,35 +373,38 @@ "type": "tidelift" } ], - "time": "2021-10-06T17:43:30+00:00" + "time": "2023-12-03T20:05:35+00:00" }, { "name": "lcobucci/clock", - "version": "2.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3" + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/353d83fe2e6ae95745b16b3d911813df6a05bfb3", - "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": "~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" }, "require-dev": { - "infection/infection": "^0.17", - "lcobucci/coding-standard": "^6.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/php-code-coverage": "9.1.4", - "phpunit/phpunit": "9.3.7" + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" }, "type": "library", "autoload": { @@ -420,7 +425,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/2.0.x" + "source": "https://github.com/lcobucci/clock/tree/3.2.0" }, "funding": [ { @@ -432,20 +437,20 @@ "type": "patreon" } ], - "time": "2020-08-27T18:56:02+00:00" + "time": "2023-11-17T17:00:27+00:00" }, { "name": "lcobucci/jwt", - "version": "4.1.5", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582" + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/fe2d89f2eaa7087af4aa166c6f480ef04e000582", - "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4", + "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4", "shasum": "" }, "require": { @@ -454,19 +459,19 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "lcobucci/clock": "^2.0", + "lcobucci/clock": "^2.0 || ^3.0", "php": "^7.4 || ^8.0" }, "require-dev": { "infection/infection": "^0.21", "lcobucci/coding-standard": "^6.0", "mikey179/vfsstream": "^1.6.7", - "phpbench/phpbench": "^1.0", + "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/php-invoker": "^3.1", "phpunit/phpunit": "^9.5" }, @@ -494,7 +499,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.1.5" + "source": "https://github.com/lcobucci/jwt/tree/4.3.0" }, "funding": [ { @@ -506,28 +511,28 @@ "type": "patreon" } ], - "time": "2021-09-28T19:34:56+00:00" + "time": "2023-01-02T13:28:00+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v2.5.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8" + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/9229e15f2e6ba772f0c55dd6986c563b937170a8", - "reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/df1e7fde177501eee2037dd159cf04f5f301a512", + "reference": "df1e7fde177501eee2037dd159cf04f5f301a512", "shasum": "" }, "require": { - "php": "^7|^8" + "php": "^8" }, "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" + "phpunit/phpunit": "^9", + "vimeo/psalm": "^4|^5" }, "type": "library", "autoload": { @@ -573,7 +578,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2022-01-17T05:32:27+00:00" + "time": "2024-05-08T12:36:18+00:00" }, { "name": "paragonie/random_compat", @@ -627,29 +632,28 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.13", + "version": "3.0.38", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "1443ab79364eea48665fa8c09ac67f37d1025f7e" + "reference": "b18b8788e51156c4dd97b7f220a31149a0052067" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/1443ab79364eea48665fa8c09ac67f37d1025f7e", - "reference": "1443ab79364eea48665fa8c09ac67f37d1025f7e", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/b18b8788e51156c4dd97b7f220a31149a0052067", + "reference": "b18b8788e51156c4dd97b7f220a31149a0052067", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "^1|^2", + "paragonie/constant_time_encoding": "^1|^2|^3", "paragonie/random_compat": "^1.4|^2.0|^9.99.99", "php": ">=5.6.1" }, "require-dev": { - "phing/phing": "~2.7", - "phpunit/phpunit": "^5.7|^6.0|^9.4", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "*" }, "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", @@ -718,7 +722,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.13" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.38" }, "funding": [ { @@ -734,25 +738,73 @@ "type": "tidelift" } ], - "time": "2022-01-30T08:50:05+00:00" + "time": "2024-06-17T10:11:32+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "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" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -772,7 +824,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -784,27 +836,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -824,10 +876,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -839,31 +891,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -878,7 +930,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -892,9 +944,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "ralouphie/getallheaders", @@ -942,25 +994,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -989,7 +1041,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { @@ -1005,7 +1057,7 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2024-04-18T09:32:20+00:00" } ], "packages-dev": [ @@ -1148,28 +1200,28 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.1", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43" + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -1194,13 +1246,29 @@ "paragonie", "phpcs", "polyfill", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2021-02-15T10:24:51+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", @@ -1258,16 +1326,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "version": "3.10.1", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -1277,11 +1345,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -1296,21 +1364,45 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2021-12-12T21:44:58+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-05-22T21:24:41+00:00" }, { "name": "wp-coding-standards/wpcs", diff --git a/contributing.md b/contributing.md index 95d367f..4502de8 100644 --- a/contributing.md +++ b/contributing.md @@ -32,3 +32,15 @@ sudo apt install php-xmlwriter php-cli php-curl php-mbstring docker-compose-plug To test login, navigate to `http://localhost:8080/wp-login.php` * The default login credentials as `admin` - `admin` Likewise the admin menu is at: `http://localhost:8080/wp-admin.php` + +### WordPress related documented for custom integrations +* [add_action / add_filter](https://developer.wordpress.org/apis/hooks/filter-reference/#redirect-rewrite-filters) + +### Files + +* /templates + * authress-login-form.php - UI mask for the login box +* /lib + * Authress_Sso_Login_LoginManager.php - Logic for handling authentication +* /wordpress + * Configuration files for the WordPress plugin on WordPress.org \ No newline at end of file diff --git a/functions.php b/functions.php index fcc0795..1c0bfe7 100644 --- a/functions.php +++ b/functions.php @@ -42,6 +42,10 @@ function authress_user_is_currently_on_login_action( array $actions ) { return false; } + if (isset( $_REQUEST['force'] ) && $_REQUEST['force']) { + return true; + } + // Null coalescing validates input variable. return in_array( wp_unslash( $_REQUEST['action'] ?? '' ), $actions, true); } diff --git a/lib/Authress_Sso_Login_Lock.php b/lib/Authress_Sso_Login_Lock.php index 6e73799..90c577d 100644 --- a/lib/Authress_Sso_Login_Lock.php +++ b/lib/Authress_Sso_Login_Lock.php @@ -23,7 +23,7 @@ public function __construct( $extended_settings = [], $opts = null ) { * @param array $specialSettings - Additional settings from widget or shortcode. */ public static function render( $canShowLegacyLogin = true, $specialSettings = [] ) { - if (is_user_logged_in() ) { + if (is_user_logged_in() && ! isset($_REQUEST['force'])) { return; } diff --git a/lib/Authress_Sso_Login_LoginManager.php b/lib/Authress_Sso_Login_LoginManager.php index 02c155f..e2e7b9a 100644 --- a/lib/Authress_Sso_Login_LoginManager.php +++ b/lib/Authress_Sso_Login_LoginManager.php @@ -62,6 +62,11 @@ public function login_auto() { return false; } + // Do not redirect anywhere if the force action is set + if ( authress_user_is_currently_on_login_action( [ 'force' ] ) ) { + return false; + } + // Do not redirect login page override. if ( authress_show_user_wordpress_login_form() ) { return false; @@ -94,6 +99,7 @@ public function init_authress() { // Not an Authress login process or settings are not configured to allow logins. if ( ! authress_plugin_has_been_fully_configured() ) { + authress_debug_log(' Plugin has not been loaded yet.'); return false; } @@ -110,7 +116,7 @@ public function init_authress() { } // No need to process a login if the user is already logged in and there is no error. - if ( is_user_logged_in() ) { + if (is_user_logged_in()) { authress_debug_log(' returning without further setup'); return true; } @@ -145,7 +151,7 @@ public function init_authress() { */ public function handle_login_redirect() { setcookie('authress-authorization-step', 'parse'); - authress_debug_log('=> handle_login_redirect'); + authress_debug_log('=> handle_login_redirect()'); $access_token = sanitize_text_field(isset($_COOKIE['authorization']) ? wp_unslash($_COOKIE['authorization']) : ''); if (!isset($_COOKIE['authorization']) && isset($_REQUEST['access_token'])) { $access_token = sanitize_text_field(wp_unslash($_REQUEST['access_token'])); @@ -234,10 +240,6 @@ public function login_user( $userinfo) { } catch ( Authress_Sso_Login_CouldNotCreateUserException $e ) { throw new Authress_Sso_Login_LoginFlowValidationException( $e->getMessage() ); - } catch ( Authress_Sso_Login_RegistrationNotEnabledException $e ) { - - $msg = __( 'Could not create user. The registration process is not available. Please contact your site’s administrator.', 'wp-authress' ); - throw new Authress_Sso_Login_LoginFlowValidationException( $msg ); } return is_user_logged_in(); } diff --git a/lib/Authress_Sso_Login_Options.php b/lib/Authress_Sso_Login_Options.php index a202889..f63bd64 100644 --- a/lib/Authress_Sso_Login_Options.php +++ b/lib/Authress_Sso_Login_Options.php @@ -239,10 +239,6 @@ public function get_defaults( $keys_only = false ) { return $keys_only ? array_keys( $default_opts ) : $default_opts; } - public function is_wp_registration_enabled() { - return is_multisite() ? users_can_register_signup_filter() : get_site_option( 'users_can_register' ); - } - public function get_default( $key ) { $defaults = $this->defaults(); return $defaults[ $key ]; @@ -392,7 +388,7 @@ protected function defaults() { 'skip_strategies' => '', 'remember_users_session' => true, 'default_login_redirection' => home_url(), - 'auto_provisioning' => false, + 'auto_provisioning' => true, 'valid_proxy_ip' => '' ]; diff --git a/lib/Authress_Sso_Login_RegistrationNotEnabledException.php b/lib/Authress_Sso_Login_RegistrationNotEnabledException.php deleted file mode 100644 index 0e5c53b..0000000 --- a/lib/Authress_Sso_Login_RegistrationNotEnabledException.php +++ /dev/null @@ -1,3 +0,0 @@ -a0_options->is_wp_registration_enabled() || $this->a0_options->get( 'auto_provisioning' ) ) { + // } elseif ( ( is_multisite() ? users_can_register_signup_filter() : get_site_option( 'users_can_register' ) ) || $this->a0_options->get( 'auto_provisioning' ) ) { + } else { // WP user does not exist and registration is allowed. $user_id = Authress_Sso_Login_Users::create_user( $userinfo ); @@ -82,9 +82,6 @@ public function create( $userinfo ) { // Registration failed for another reason. throw new Authress_Sso_Login_CouldNotCreateUserException(); } - } else { - // Signup is not allowed. - throw new Authress_Sso_Login_RegistrationNotEnabledException(); } $this->update_authress_object( $user_id, $userinfo ); diff --git a/templates/assets/img/logo_16x16.png b/templates/assets/img/logo_16x16.png index 5c80201fc4514e660b716cca89b859aab457fedd..a7e942af0b070a6e8431263d41618ed40935a540 100644 GIT binary patch delta 398 zcmV;90dfAy7or%D865%u005AYXf^-<010qNS#tmYE+YT{E+YYWr9XDDHi-&<0ZmCn zK~#9!VwBalW*`Nypz%3b|7F{~2-1Hi&ini2XV!HWg{B^o`2L#-u7H_eLJrPhXZg1{ z?v9`CdlqJf=bu=Gxc^!ze6djYvgxwm-+zo)G-O!63^I7P_JUCKLe<&F#21_t6X*Ty ztp4feAEwifcpz$+klhog|L)U&59Zpfvfq9&F)%QE`^8kdRrb>l<{*Q2a5X3z6oh}? ze$Dao4?^(gAEw){Ipl?YV%NaP!0-p=Ryg?ckC72iC>hFpJydWNSwxiQH@;wHWBxDA z|BHlpIQft#YJn=U$g+gn=JH>#`+|hSw=2_5zq#@>0PBVabfZ=4o(9Awgp!b7m?-->;M1&07*qo IM6N<$f?GO(aR2}S diff --git a/templates/authress-login-form.php b/templates/authress-login-form.php index d3f8102..c1e0fa9 100644 --- a/templates/authress-login-form.php +++ b/templates/authress-login-form.php @@ -2,46 +2,49 @@ $authress_options = Authress_Sso_Login_Options::Instance(); $wle = 'link'; $loginFlowIsPassword = isset($_REQUEST['login']); + $showWordPressLogin = (isset($_REQUEST['wle']) || $loginFlowIsPassword) && !isset($_REQUEST['action']); ?>
- +
-
+ @@ -96,33 +104,22 @@ function checkIfLoaded() {


- - -
-