From 5d686c8755be0c27d5210d69f7421ce3d7b02269 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 9 Mar 2019 14:44:48 +0100 Subject: [PATCH 001/113] Prepare for SSP 2.0 --- .travis.yml | 157 +++++++++++++++++++++++++++++++++--------- bin/check-syntax.sh | 15 ---- composer.json | 9 ++- default-enable | 0 lib/AuthMemCookie.php | 45 +++++------- phpcs.xml | 16 +++++ phpunit.xml | 2 +- psalm.xml | 5 ++ tests/bootstrap.php | 4 +- www/auth.php | 22 +++--- 10 files changed, 180 insertions(+), 95 deletions(-) delete mode 100755 bin/check-syntax.sh delete mode 100644 default-enable create mode 100644 phpcs.xml diff --git a/.travis.yml b/.travis.yml index 1b8a9ba..f17beae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,45 +2,134 @@ sudo: required language: php +# Stage order +stages: + - pre-conditions + - test + - quality + + +################ +# Test stage # +################ + php: - - 5.6 - - 7.0 - - 7.1 - 7.2 + - 7.3 + - 7.4 env: - - SIMPLESAMLPHP_VERSION=1.16.* - -matrix: - include: - - php: 5.6 - env: SIMPLESAMLPHP_VERSION=dev-master - - php: 7.0 - env: SIMPLESAMLPHP_VERSION=dev-master - - php: 7.1 - env: SIMPLESAMLPHP_VERSION=dev-master - - php: 7.2 - env: SIMPLESAMLPHP_VERSION=dev-master - - php: 7.3 - env: SIMPLESAMLPHP_VERSION=dev-master - allow_failures: - - env: SIMPLESAMLPHP_VERSION=dev-master - - php: 7.3 + - COMMAND="composer install" + - COMMAND="composer update" + +before_install: + - printf "\n" | pecl install memcached before_script: - - composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update - - composer update --no-interaction - - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer require --dev vimeo/psalm; fi + - ${COMMAND} script: - - bin/check-syntax.sh - - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi - - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi - -after_success: - # Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved - - curl -s https://codecov.io/bash > .codecov - - sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov - - chmod +x .codecov - - if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi -# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi + - php vendor/bin/phpunit --no-coverage + +jobs: + fast_finish: true + allow_failures: + - php: 7.3 + env: Psalm + - php: 7.3 + env: Security check (composer install) + - php: 7.3 + env: Security check (composer update) + - php: 7.3 + env: PHP Codesniffer + + include: + + ########################## + # Pre-conditions stage # + ########################## + + - stage: pre-conditions + php: 7.2 + env: Syntax check PHP + before_script: + - composer install + script: + - vendor/bin/check-syntax-php.sh + + - stage: pre-conditions + php: 7.3 + env: Syntax check PHP + before_script: + - composer install + script: + - vendor/bin/check-syntax-php.sh + + - stage: pre-conditions + php: 7.4 + env: Syntax check PHP + before_script: + - composer install + script: + - vendor/bin/check-syntax-php.sh + + - stage: pre-conditions + php: 7.3 + env: Syntax check YAML / XML / JSON + before_script: + - composer update + script: + - vendor/bin/check-syntax-yaml.sh + - vendor/bin/check-syntax-xml.sh + - vendor/bin/check-syntax-json.sh + + + ################### + # Quality stage # + ################### + + - stage: quality + php: 7.3 + env: Security check (composer install) + before_script: + - composer install + script: + - vendor/bin/security-checker security:check + + - stage: quality + php: 7.3 + env: Security check (composer update) + before_script: + - composer update + script: + - vendor/bin/security-checker security:check + + - stage: quality + php: 7.3 + env: Codecov + before_script: + - composer update + - php vendor/bin/phpunit + script: + - bash <(curl -s https://codecov.io/bash) + + - stage: quality + php: 7.3 + env: Psalm + before_script: + - composer update + script: + - vendor/bin/psalm + - vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run + + - stage: quality + php: 7.3 + env: PHP Codesniffer + before_script: + - composer update + script: + - vendor/bin/phpcs + +notifications: + slack: + secure: h5YiO7tAk5bzAQBkUZ3crnOFAOBkNqHp0nc2cxvGauogVfCLE9K8bME512uTeu9QWMht2D30uyTOHFKQ7sPEW4omHNF4qYl4p9L037oQFfEwZPBzJFo9QUzviT3mvKHTN4HSQOkq/08ZoMhh1i3p/OhyFS56J28IDJWDqGZkEUE= diff --git a/bin/check-syntax.sh b/bin/check-syntax.sh deleted file mode 100755 index 204d4ca..0000000 --- a/bin/check-syntax.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -PHP='/usr/bin/env php' -RETURN=0 - -# check PHP files -for FILE in `find config-templates lib www -name "*.php"`; do - $PHP -l $FILE > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Syntax check failed for ${FILE}" - RETURN=`expr ${RETURN} + 1` - fi -done - -exit $RETURN diff --git a/composer.json b/composer.json index 0edd87f..967e5d6 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,14 @@ } ], "require": { - "simplesamlphp/composer-module-installer": ">=1.1.6" + "php": ">=7.2", + "ext-memcached": "*", + "simplesamlphp/composer-module-installer": ">=1.1.6", + "simplesamlphp/simplesamlphp": "dev-master" }, "require-dev": { - "simplesamlphp/simplesamlphp": "^1.16", - "phpunit/phpunit": "~4.8.35" + "phpunit/phpunit": "~8.5", + "simplesamlphp/simplesamlphp-test-framework": "^0.1.0" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", diff --git a/default-enable b/default-enable deleted file mode 100644 index e69de29..0000000 diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index 07e946e..e742cc2 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -12,11 +12,10 @@ class AuthMemCookie { /** - * @var AuthMemCookie This is the singleton instance of this class. + * @var AuthMemCookie|null This is the singleton instance of this class. */ private static $instance = null; - /** * @var \SimpleSAML\Configuration The configuration for Auth MemCookie. */ @@ -26,9 +25,9 @@ class AuthMemCookie /** * This function is used to retrieve the singleton instance of this class. * - * @return AuthMemCookie The singleton instance of this class. + * @return \SimpleSAML\Module\memcookie\AuthMemCookie The singleton instance of this class. */ - public static function getInstance() + public static function getInstance(): AuthMemCookie { if (self::$instance === null) { self::$instance = new AuthMemCookie(); @@ -53,7 +52,7 @@ private function __construct() * * @return string The login type which should be used for Auth MemCookie. */ - public function getAuthSource() + public function getAuthSource(): string { return $this->config->getString('authsource'); } @@ -65,7 +64,7 @@ public function getAuthSource() * @return string The name of the cookie. * @throws \Exception If the value of the 'cookiename' configuration option is invalid. */ - public function getCookieName() + public function getCookieName(): string { $cookieName = $this->config->getString('cookiename', 'AuthMemCookie'); if (!is_string($cookieName) || strlen($cookieName) === 0) { @@ -81,13 +80,11 @@ public function getCookieName() /** * This function retrieves the name of the attribute which contains the username from the configuration. * - * @return string The name of the attribute which contains the username. + * @return string|null The name of the attribute which contains the username. */ - public function getUsernameAttr() + public function getUsernameAttr(): ?string { - $usernameAttr = $this->config->getString('username', null); - - return $usernameAttr; + return $this->config->getString('username', null); } @@ -96,38 +93,32 @@ public function getUsernameAttr() * * @return string|null The name of the attribute which contains the groups. */ - public function getGroupsAttr() + public function getGroupsAttr(): ?string { - $groupsAttr = $this->config->getString('groups', null); - - return $groupsAttr; + return $this->config->getString('groups', null); } /** * This function creates and initializes a Memcache object from our configuration. * - * @return \Memcache|\Memcached A Memcache object initialized from our configuration. + * @return \Memcached A Memcache object initialized from our configuration. */ - public function getMemcache() + public function getMemcache(): \Memcached { $memcacheHost = $this->config->getString('memcache.host', '127.0.0.1'); $memcachePort = $this->config->getInteger('memcache.port', 11211); - $class = class_exists('\Memcache') ? '\Memcache' : (class_exists('\Memcached') ? '\Memcached' : false); + $class = class_exists('\Memcached') ? '\Memcached' : false; if (!$class) { - throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); + throw new \Exception('Missing Memcached implementation. You must install either the Memcached extension.'); } - $memcache = new $class; + $memcache = new \Memcached(); foreach (explode(',', $memcacheHost) as $memcacheHost) { - if ($memcache instanceof \Memcached) { - $memcache->addServer($memcacheHost, $memcachePort); - } else { - $memcache->addServer($memcacheHost, $memcachePort, true); - } + $memcache->addServer($memcacheHost, $memcachePort); } return $memcache; @@ -138,7 +129,7 @@ public function getMemcache() * This function logs the user out by deleting the session information from memcache. * @return void */ - private function doLogout() + private function doLogout(): void { $cookieName = $this->getCookieName(); @@ -162,7 +153,7 @@ private function doLogout() * This function implements the logout handler. It deletes the information from Memcache. * @return void */ - public static function logoutHandler() + public static function logoutHandler(): void { self::getInstance()->doLogout(); } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..40a5316 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,16 @@ + + + + By default it is less stringent about long lines than other coding standards + + + lib + tests + www + + + + + + + diff --git a/phpunit.xml b/phpunit.xml index c0985fd..f747895 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -12,7 +12,7 @@ - + diff --git a/psalm.xml b/psalm.xml index 056be8f..c257963 100644 --- a/psalm.xml +++ b/psalm.xml @@ -29,4 +29,9 @@ + + + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0fda7dc..ef08979 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,10 @@ getUsernameAttr(); -if (!array_key_exists($usernameAttr, $attributes)) { +if ($usernameAttr === null || !array_key_exists($usernameAttr, $attributes)) { throw new \SimpleSAML\Error\Exception( - "The user doesn't have an attribute named '".$usernameAttr. + "The user doesn't have an attribute named '" . $usernameAttr . "'. This attribute is expected to contain the username." ); } @@ -50,7 +50,7 @@ if ($groupsAttr !== null) { if (!array_key_exists($groupsAttr, $attributes)) { throw new \SimpleSAML\Error\Exception( - "The user doesn't have an attribute named '".$groupsAttr. + "The user doesn't have an attribute named '" . $groupsAttr . "'. This attribute is expected to contain the groups the user is a member of." ); } @@ -62,7 +62,7 @@ $authData['RemoteIP'] = $_SERVER['REMOTE_ADDR']; foreach ($attributes as $n => $v) { - $authData['ATTR_'.$n] = $v; + $authData['ATTR_' . $n] = $v; } // store the authentication data in the memcache server @@ -71,16 +71,12 @@ if (is_array($v)) { $v = implode(':', $v); } - $data .= $n.'='.$v."\r\n"; + $data .= $n . '=' . $v . "\r\n"; } $memcache = $amc_cf->getMemcache(); $expirationTime = $s->getAuthData('Expire'); -if ($memcache instanceof \Memcached) { - $memcache->set($sessionID, $data, $expirationTime); -} else { - $memcache->set($sessionID, $data, 0, $expirationTime); -} +$memcache->set($sessionID, $data, $expirationTime ?? 0); // register logout handler $session = \SimpleSAML\Session::getSessionFromRequest(); From fccaed849104198ec0e296d31bc619e7598e4fc5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 25 Feb 2020 16:43:38 +0100 Subject: [PATCH 002/113] Rename .codecov.yml to codecov.yml --- .codecov.yml => codecov.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .codecov.yml => codecov.yml (100%) diff --git a/.codecov.yml b/codecov.yml similarity index 100% rename from .codecov.yml rename to codecov.yml From b69aeaaa09fdb5d11aab5343f4701b0cdbf40fa4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 20 Mar 2020 22:01:11 +0100 Subject: [PATCH 003/113] Add LICENSE --- LICENSE | 459 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 459 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a345e48 --- /dev/null +++ b/LICENSE @@ -0,0 +1,459 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + \ No newline at end of file From 5dbba6e8cc2623cd8edd90b6c118a3c258f720ec Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 10 Sep 2020 20:46:05 +0200 Subject: [PATCH 004/113] Remove all @author tags; we have Git history --- lib/AuthMemCookie.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index e742cc2..a5762dd 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -6,7 +6,6 @@ * This is a helper class for the Auth MemCookie module. * It handles the configuration, and implements the logout handler. * - * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ class AuthMemCookie From c6c13fb399436299c008b7257bacd9596e6ec15a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 15 Sep 2020 22:34:50 +0200 Subject: [PATCH 005/113] Remove @return void --- lib/AuthMemCookie.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index a5762dd..3e29632 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -126,7 +126,6 @@ public function getMemcache(): \Memcached /** * This function logs the user out by deleting the session information from memcache. - * @return void */ private function doLogout(): void { @@ -150,7 +149,6 @@ private function doLogout(): void /** * This function implements the logout handler. It deletes the information from Memcache. - * @return void */ public static function logoutHandler(): void { From 41f216c37f19ea66d14aaa611adab9f974f059c5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 18 Dec 2020 13:49:39 +0100 Subject: [PATCH 006/113] Create .gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce45e20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.phpunit.result.cache +composer.lock +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock From cb98090edf1c591d7060ef7b6810e133cc759d86 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 18 Dec 2020 16:39:34 +0100 Subject: [PATCH 007/113] Remove deprecated MisplacedRequiredParam --- psalm.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index c257963..09033f0 100644 --- a/psalm.xml +++ b/psalm.xml @@ -20,7 +20,6 @@ - From ad854c3a0650f13764efaf21e2f753ae516c3961 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 20 Dec 2020 23:29:01 +0100 Subject: [PATCH 008/113] Bump PHP version + add Actions workflow --- .github/workflows/php.yml | 202 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 135 ------------------------- composer.json | 6 +- 3 files changed, 205 insertions(+), 138 deletions(-) create mode 100644 .github/workflows/php.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..ab1aef5 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,202 @@ +name: CI + +on: + push: + branches: [ '**' ] + pull_request: + branches: [ master, release-* ] + +jobs: + basic-tests: + name: Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }} + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest] + php-versions: ['7.4'] + + steps: + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + extensions: ldap, mbstring, memcache, xml + coverage: pcov + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install Composer dependencies + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + + - name: Syntax check PHP + run: bash vendor/bin/check-syntax-php.sh + + - name: Decide whether to run code coverage or not + if: ${{ matrix.php-versions != '7.4' || matrix.operating-system != 'ubuntu-latest' }} + run: | + echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV + + - name: Run unit tests + run: | + echo $NO_COVERAGE + ./vendor/bin/phpunit $NO_COVERAGE + + - name: Save coverage data + if: ${{ matrix.php-versions == '7.4' && matrix.operating-system == 'ubuntu-latest' }} + uses: actions/upload-artifact@v1 + with: + name: build-data + path: ${{ github.workspace }}/build + + security: + name: Security checks + runs-on: [ubuntu-latest] + steps: + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: '7.4' + extensions: ldap, mbstring, memcache, xml + coverage: none + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - uses: actions/checkout@v2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + + - name: Security check for locked dependencies + run: ./vendor/bin/security-checker security:check + + - name: Update Composer dependencies + run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader + + - name: Security check for updated dependencies + run: ./vendor/bin/security-checker security:check + + sanity-check: + name: Sanity checks + runs-on: [ubuntu-latest] + + steps: + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: '7.4' + extensions: ldap, mbstring, memcache, xml + coverage: none + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - uses: actions/checkout@v2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + + - name: Syntax check YAML / XML / JSON + run: | + bash vendor/bin/check-syntax-yaml.sh + bash vendor/bin/check-syntax-xml.sh + bash vendor/bin/check-syntax-json.sh + + quality: + name: Quality control + runs-on: [ubuntu-latest] + needs: [basic-tests] + + steps: + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: '7.4' + extensions: ldap, mbstring, memcache, xml + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - uses: actions/checkout@v2 + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + + - uses: actions/download-artifact@v1 + with: + name: build-data + path: ${{ github.workspace }}/build + + - name: Codecov + uses: codecov/codecov-action@v1 + + - name: PHP Code Sniffer + continue-on-error: true + run: php vendor/bin/phpcs + + - name: Psalm + continue-on-error: true + run: php vendor/bin/psalm --show-info=true + + - name: Psalter + continue-on-error: true + run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f17beae..0000000 --- a/.travis.yml +++ /dev/null @@ -1,135 +0,0 @@ -sudo: required - -language: php - -# Stage order -stages: - - pre-conditions - - test - - quality - - -################ -# Test stage # -################ - -php: - - 7.2 - - 7.3 - - 7.4 - -env: - - COMMAND="composer install" - - COMMAND="composer update" - -before_install: - - printf "\n" | pecl install memcached - -before_script: - - ${COMMAND} - -script: - - php vendor/bin/phpunit --no-coverage - -jobs: - fast_finish: true - allow_failures: - - php: 7.3 - env: Psalm - - php: 7.3 - env: Security check (composer install) - - php: 7.3 - env: Security check (composer update) - - php: 7.3 - env: PHP Codesniffer - - include: - - ########################## - # Pre-conditions stage # - ########################## - - - stage: pre-conditions - php: 7.2 - env: Syntax check PHP - before_script: - - composer install - script: - - vendor/bin/check-syntax-php.sh - - - stage: pre-conditions - php: 7.3 - env: Syntax check PHP - before_script: - - composer install - script: - - vendor/bin/check-syntax-php.sh - - - stage: pre-conditions - php: 7.4 - env: Syntax check PHP - before_script: - - composer install - script: - - vendor/bin/check-syntax-php.sh - - - stage: pre-conditions - php: 7.3 - env: Syntax check YAML / XML / JSON - before_script: - - composer update - script: - - vendor/bin/check-syntax-yaml.sh - - vendor/bin/check-syntax-xml.sh - - vendor/bin/check-syntax-json.sh - - - ################### - # Quality stage # - ################### - - - stage: quality - php: 7.3 - env: Security check (composer install) - before_script: - - composer install - script: - - vendor/bin/security-checker security:check - - - stage: quality - php: 7.3 - env: Security check (composer update) - before_script: - - composer update - script: - - vendor/bin/security-checker security:check - - - stage: quality - php: 7.3 - env: Codecov - before_script: - - composer update - - php vendor/bin/phpunit - script: - - bash <(curl -s https://codecov.io/bash) - - - stage: quality - php: 7.3 - env: Psalm - before_script: - - composer update - script: - - vendor/bin/psalm - - vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run - - - stage: quality - php: 7.3 - env: PHP Codesniffer - before_script: - - composer update - script: - - vendor/bin/phpcs - -notifications: - slack: - secure: h5YiO7tAk5bzAQBkUZ3crnOFAOBkNqHp0nc2cxvGauogVfCLE9K8bME512uTeu9QWMht2D30uyTOHFKQ7sPEW4omHNF4qYl4p9L037oQFfEwZPBzJFo9QUzviT3mvKHTN4HSQOkq/08ZoMhh1i3p/OhyFS56J28IDJWDqGZkEUE= diff --git a/composer.json b/composer.json index 967e5d6..7311b82 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "require": { - "php": ">=7.2", + "php": ">=7.4", "ext-memcached": "*", + "simplesamlphp/composer-module-installer": ">=1.1.6", "simplesamlphp/simplesamlphp": "dev-master" }, "require-dev": { - "phpunit/phpunit": "~8.5", - "simplesamlphp/simplesamlphp-test-framework": "^0.1.0" + "simplesamlphp/simplesamlphp-test-framework": "^1.0.4" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From b9b025573165fbc67b2818eb4d3468a7be0ad277 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 16 Jan 2021 13:47:43 +0100 Subject: [PATCH 009/113] Replace abandoned security-checker --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ab1aef5..f304a2f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -105,13 +105,13 @@ jobs: run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader - name: Security check for locked dependencies - run: ./vendor/bin/security-checker security:check + uses: symfonycorp/security-checker-action@v2 - name: Update Composer dependencies run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader - name: Security check for updated dependencies - run: ./vendor/bin/security-checker security:check + uses: symfonycorp/security-checker-action@v2 sanity-check: name: Sanity checks From dee0f24b1c73b499790f8dfe873ff3bd00b4fb4d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 21:53:58 +0100 Subject: [PATCH 010/113] Start testing for PHP 8.0 --- .github/workflows/php.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f304a2f..2d944b7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ['7.4'] + php-versions: ['7.4', '8.0'] steps: - name: Setup PHP, with composer and extensions diff --git a/composer.json b/composer.json index 7311b82..c41e2fa 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=7.4 || ^8.0", "ext-memcached": "*", "simplesamlphp/composer-module-installer": ">=1.1.6", From 83bf75ee1fbcdd43aaac1578b59284e2430d5683 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 21:57:19 +0100 Subject: [PATCH 011/113] Fix badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cea74f2..d5a27a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/workflows/CI/badge.svg?branch=master) +[![Coverage Status](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie) + SimpleSAMLphp AuthMemCookie module ================================== From 5d2bb8f472d2c98736b4a974db9093bd36b8d89b Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 22:20:10 +0100 Subject: [PATCH 012/113] Add controller-class --- lib/Controller/Memcookie.php | 138 +++++++++++++++++++++++++++++++++++ routing/routes/routes.yml | 3 + www/auth.php | 86 ---------------------- 3 files changed, 141 insertions(+), 86 deletions(-) create mode 100644 lib/Controller/Memcookie.php create mode 100644 routing/routes/routes.yml delete mode 100644 www/auth.php diff --git a/lib/Controller/Memcookie.php b/lib/Controller/Memcookie.php new file mode 100644 index 0000000..485eb07 --- /dev/null +++ b/lib/Controller/Memcookie.php @@ -0,0 +1,138 @@ +config = $config; + $this->session = $session; + } + + + /** + * This method implements an script which can be used to authenticate users with Auth MemCookie. + * See: https://zenprojects.github.io/Apache-Authmemcookie-Module/ + * + * The configuration for this script is stored in config/module_authmemcookie.php. + * + * The file extra/auth_memcookie.conf contains an example of how Auth Memcookie can be configured + * to use SimpleSAMLphp. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * @return \SimpleSAML\HTTP\RunnableResponse + */ + public function main(Request $request): RunnableResponse + { + // load SimpleSAMLphp configuration + $ssp_cf = $this->config::getInstance(); + + // load Auth MemCookie configuration + $amc_cf = AuthMemCookie::getInstance(); + + $sourceId = $amc_cf->getAuthSource(); + $s = new Auth\Simple($sourceId); + + // check if the user is authorized. We attempt to authenticate the user if not + $s->requireAuth(); + + // generate session id and save it in a cookie + $sessionID = Utils\Random::generateID(); + $cookieName = $amc_cf->getCookieName(); + Utils\HTTP::setCookie($cookieName, $sessionID); + + // generate the authentication information + $attributes = $s->getAttributes(); + + $authData = []; + + // username + $usernameAttr = $amc_cf->getUsernameAttr(); + if ($usernameAttr === null || !array_key_exists($usernameAttr, $attributes)) { + throw new Error\Exception( + "The user doesn't have an attribute named '" . $usernameAttr . + "'. This attribute is expected to contain the username." + ); + } + $authData['UserName'] = $attributes[$usernameAttr]; + + // groups + $groupsAttr = $amc_cf->getGroupsAttr(); + if ($groupsAttr !== null) { + if (!array_key_exists($groupsAttr, $attributes)) { + throw new Error\Exception( + "The user doesn't have an attribute named '" . $groupsAttr . + "'. This attribute is expected to contain the groups the user is a member of." + ); + } + $authData['Groups'] = $attributes[$groupsAttr]; + } else { + $authData['Groups'] = []; + } + + $authData['RemoteIP'] = $request->server->get('REMOTE_ADDR'); + + foreach ($attributes as $n => $v) { + $authData['ATTR_' . $n] = $v; + } + + // store the authentication data in the memcache server + $data = ''; + foreach ($authData as $n => $v) { + if (is_array($v)) { + $v = implode(':', $v); + } + $data .= $n . '=' . $v . "\r\n"; + } + + $memcache = $amc_cf->getMemcache(); + $expirationTime = $s->getAuthData('Expire'); + $memcache->set($sessionID, $data, $expirationTime ?? 0); + + // register logout handler + $session = $this->session::getSessionFromRequest(); + $session->registerLogoutHandler($sourceId, '\SimpleSAML\Module\memcookie\AuthMemCookie', 'logoutHandler'); + + // redirect the user back to this page to signal that the login is completed + return RunnableResponse([Utils\HTTP::class, 'redirectTrustedURL'], [Utils\HTTP::getSelfURL()]); + } +} diff --git a/routing/routes/routes.yml b/routing/routes/routes.yml new file mode 100644 index 0000000..3ebbf48 --- /dev/null +++ b/routing/routes/routes.yml @@ -0,0 +1,3 @@ +memcookie-main: + path: / + defaults: { _controller: 'SimpleSAML\Module\memcookie\Controller\Memcookie::main' } diff --git a/www/auth.php b/www/auth.php deleted file mode 100644 index 1cd4994..0000000 --- a/www/auth.php +++ /dev/null @@ -1,86 +0,0 @@ -getAuthSource(); -$s = new SimpleSAML\Auth\Simple($sourceId); - -// check if the user is authorized. We attempt to authenticate the user if not -$s->requireAuth(); - -// generate session id and save it in a cookie -$sessionID = Utils\Random::generateID(); -$cookieName = $amc_cf->getCookieName(); -Utils\HTTP::setCookie($cookieName, $sessionID); - -// generate the authentication information -$attributes = $s->getAttributes(); - -$authData = []; - -// username -$usernameAttr = $amc_cf->getUsernameAttr(); -if ($usernameAttr === null || !array_key_exists($usernameAttr, $attributes)) { - throw new \SimpleSAML\Error\Exception( - "The user doesn't have an attribute named '" . $usernameAttr . - "'. This attribute is expected to contain the username." - ); -} -$authData['UserName'] = $attributes[$usernameAttr]; - -// groups -$groupsAttr = $amc_cf->getGroupsAttr(); -if ($groupsAttr !== null) { - if (!array_key_exists($groupsAttr, $attributes)) { - throw new \SimpleSAML\Error\Exception( - "The user doesn't have an attribute named '" . $groupsAttr . - "'. This attribute is expected to contain the groups the user is a member of." - ); - } - $authData['Groups'] = $attributes[$groupsAttr]; -} else { - $authData['Groups'] = []; -} - -$authData['RemoteIP'] = $_SERVER['REMOTE_ADDR']; - -foreach ($attributes as $n => $v) { - $authData['ATTR_' . $n] = $v; -} - -// store the authentication data in the memcache server -$data = ''; -foreach ($authData as $n => $v) { - if (is_array($v)) { - $v = implode(':', $v); - } - $data .= $n . '=' . $v . "\r\n"; -} - -$memcache = $amc_cf->getMemcache(); -$expirationTime = $s->getAuthData('Expire'); -$memcache->set($sessionID, $data, $expirationTime ?? 0); - -// register logout handler -$session = \SimpleSAML\Session::getSessionFromRequest(); -$session->registerLogoutHandler($sourceId, '\SimpleSAML\Module\memcookie\AuthMemCookie', 'logoutHandler'); - -// redirect the user back to this page to signal that the login is completed -Utils\HTTP::redirectTrustedURL(Utils\HTTP::getSelfURL()); From bc5f6e95e97666de32d46fc3a3bae0f560aefbae Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 22:20:21 +0100 Subject: [PATCH 013/113] Move config --- ...authmemcookie.php => module_authmemcookie.php} | 0 lib/AuthMemCookie.php | 15 ++++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) rename config-templates/{authmemcookie.php => module_authmemcookie.php} (100%) diff --git a/config-templates/authmemcookie.php b/config-templates/module_authmemcookie.php similarity index 100% rename from config-templates/authmemcookie.php rename to config-templates/module_authmemcookie.php diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index 3e29632..b9f8d95 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -2,6 +2,11 @@ namespace SimpleSAML\Module\memcookie; +use Exception; +use Memcached; +use SimpleSAML\Configuration; +use SimpleSAML\Utils; + /** * This is a helper class for the Auth MemCookie module. * It handles the configuration, and implements the logout handler. @@ -42,7 +47,7 @@ public static function getInstance(): AuthMemCookie private function __construct() { // load AuthMemCookie configuration - $this->config = \SimpleSAML\Configuration::getConfig('authmemcookie.php'); + $this->config = Configuration::getConfig('module_authmemcookie.php'); } @@ -67,7 +72,7 @@ public function getCookieName(): string { $cookieName = $this->config->getString('cookiename', 'AuthMemCookie'); if (!is_string($cookieName) || strlen($cookieName) === 0) { - throw new \Exception( + throw new Exception( "Configuration option 'cookiename' contains an invalid value. This option should be a string." ); } @@ -111,10 +116,10 @@ public function getMemcache(): \Memcached $class = class_exists('\Memcached') ? '\Memcached' : false; if (!$class) { - throw new \Exception('Missing Memcached implementation. You must install either the Memcached extension.'); + throw new Exception('Missing Memcached implementation. You must install either the Memcached extension.'); } - $memcache = new \Memcached(); + $memcache = new Memcached(); foreach (explode(',', $memcacheHost) as $memcacheHost) { $memcache->addServer($memcacheHost, $memcachePort); @@ -143,7 +148,7 @@ private function doLogout(): void $memcache->delete($sessionID); // delete the session cookie - \SimpleSAML\Utils\HTTP::setCookie($cookieName, null); + Utils\HTTP::setCookie($cookieName, null); } From 80216acd05ad1ad9605ec9a76a912c2ef3d854ac Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 22:38:14 +0100 Subject: [PATCH 014/113] Add PSR-4 autoloader --- composer.json | 7 ++- tests/lib/Controller/MemcookieTest.php | 72 ++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 tests/lib/Controller/MemcookieTest.php diff --git a/composer.json b/composer.json index c41e2fa..4e03e00 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,11 @@ "email": "jaime.perez@uninett.no" } ], + "autoload": { + "psr-4": { + "SimpleSAML\\Module\\memcookie\\": "lib/" + } + }, "require": { "php": ">=7.4 || ^8.0", "ext-memcached": "*", @@ -23,7 +28,7 @@ "simplesamlphp/simplesamlphp": "dev-master" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.0.4" + "simplesamlphp/simplesamlphp-test-framework": "^1.0.5" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/lib/Controller/MemcookieTest.php new file mode 100644 index 0000000..3ee966e --- /dev/null +++ b/tests/lib/Controller/MemcookieTest.php @@ -0,0 +1,72 @@ +config = Configuration::loadFromArray( + [ + 'module.enable' => ['memcookie' => true], + ], + '[ARRAY]', + 'simplesaml' + ); + + $this->session = Session::getSessionFromRequest(); + } + + + /** + * Test that a valid requests results in a RunnableResponse + * @return void + */ + public function testMemcookie(): void + { + $request = Request::create( + '/', + 'GET', + [] + ); + + $c = new Controller\Memcookie($this->config, $this->session); + $response = $c->main($request); + + $this->assertInstanceOf(RunnableResponse::class, $response); + $this->assertTrue($response->isSuccessful()); + } +} From ec2cf9cfaa055c8ab009af2f005f879b965a6c4a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 23:03:40 +0100 Subject: [PATCH 015/113] Add unit test --- tests/lib/Controller/MemcookieTest.php | 42 ++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/lib/Controller/MemcookieTest.php index 3ee966e..4257ff5 100644 --- a/tests/lib/Controller/MemcookieTest.php +++ b/tests/lib/Controller/MemcookieTest.php @@ -5,17 +5,12 @@ namespace SimpleSAML\Test\Module\memcookie\Controller; use PHPUnit\Framework\TestCase; -//use SimpleSAML\Auth\Source; -//use SimpleSAML\Auth\State; use SimpleSAML\Configuration; use SimpleSAML\Error; use SimpleSAML\HTTP\RunnableResponse; -//use SimpleSAML\Module\multiauth\Auth\Source\MultiAuth; use SimpleSAML\Module\memcookie\Controller; use SimpleSAML\Session; -//use SimpleSAML\XHTML\Template; use Symfony\Component\HttpFoundation\Request; -//use Symfony\Component\HttpFoundation\Response; /** * Set of tests for the controllers in the "memcookie" module. @@ -24,9 +19,15 @@ */ class MemcookieTest extends TestCase { + /** @var \SimpleSAML\Configuration */ + protected $authsources; + /** @var \SimpleSAML\Configuration */ protected $config; + /** @var \SimpleSAML\Configuration */ + protected $module_config; + /** @var \SimpleSAML\Session */ protected $session; @@ -47,6 +48,30 @@ protected function setUp(): void 'simplesaml' ); + + $this->authsources = Configuration::loadFromArray( + [ + 'default-sp' => ['saml:SP'], + ], + '[ARRAY]', + 'authsources.php' + ); + Configuration::setPreLoadedConfig($this->authsources, 'authsources.php'); + + $this->module_config = Configuration::loadFromArray( + [ + 'authsource' => 'default-sp', + 'cookiename' => 'AuthMemCookie', + 'username' => null, + 'groups' => null, + 'memcache.host' => '127.0.0.1', + 'memcache.port' => 11211, + ], + '[ARRAY]', + 'module_authmemcookie.php' + ); + Configuration::setPreLoadedConfig($this->module_config, 'module_authmemcookie.php'); + $this->session = Session::getSessionFromRequest(); } @@ -57,13 +82,18 @@ protected function setUp(): void */ public function testMemcookie(): void { + $_SERVER['REQUEST_METHOD'] = 'GET'; + $_SERVER['REQUEST_URI'] = '/module.php/memcookie/'; + $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; + $request = Request::create( - '/', + '/module.php/memcookie/', 'GET', [] ); $c = new Controller\Memcookie($this->config, $this->session); + /** @var \SimpleSAML\HTTP\RunnableResponse $response */ $response = $c->main($request); $this->assertInstanceOf(RunnableResponse::class, $response); From a17727e5db38624ba2532599f0ff92428b63827e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 23:04:25 +0100 Subject: [PATCH 016/113] Update phpunit config --- phpunit.xml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index f747895..b0160ae 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,19 +1,19 @@ - - - - - tests/ - - - - - ./lib - - - - - - - + + + + + ./lib + + + + + + + + + + tests/ + + + - From c32ae2d82dd3313a451ab8ccd0f74c94f1299986 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Jan 2021 23:59:07 +0100 Subject: [PATCH 017/113] Fix tests --- lib/Controller/Memcookie.php | 44 +++++++++++++++++++++--- tests/lib/Controller/MemcookieTest.php | 47 ++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 12 deletions(-) diff --git a/lib/Controller/Memcookie.php b/lib/Controller/Memcookie.php index 485eb07..bd2a432 100644 --- a/lib/Controller/Memcookie.php +++ b/lib/Controller/Memcookie.php @@ -23,9 +23,21 @@ */ class Memcookie { + /** + * @var \SimpleSAML\Auth\Simple|string + * @psalm-var \SimpleSAML\Auth\Simple|class-string + */ + protected $auth_simple = Auth\Simple::class; + /** @var \SimpleSAML\Configuration */ protected $config; + /** + * @var \SimpleSAML\Utils\HTTP|string + * @psalm-var \SimpleSAML\Utils\HTTP|class-string + */ + protected $http_utils = Utils\HTTP::class; + /** @var \SimpleSAML\Session */ protected $session; @@ -49,6 +61,28 @@ public function __construct( } + /** + * Inject the \SimpleSAML\Auth\Simple dependency. + * + * @param \SimpleSAML\Auth\Simple $authSimple + */ + public function setAuthSimple(Auth\Simple $authSimple): void + { + $this->auth_simple = $authSimple; + } + + + /** + * Inject the \SimpleSAML\Utils\HTTP dependency. + * + * @param \SimpleSAML\Utils\HTTP $httpUtils + */ + public function setHttpUtils(Utils\HTTP $httpUtils): void + { + $this->http_utils = $httpUtils; + } + + /** * This method implements an script which can be used to authenticate users with Auth MemCookie. * See: https://zenprojects.github.io/Apache-Authmemcookie-Module/ @@ -70,7 +104,8 @@ public function main(Request $request): RunnableResponse $amc_cf = AuthMemCookie::getInstance(); $sourceId = $amc_cf->getAuthSource(); - $s = new Auth\Simple($sourceId); + $simple = $this->auth_simple; + $s = new $simple($sourceId); // check if the user is authorized. We attempt to authenticate the user if not $s->requireAuth(); @@ -78,7 +113,7 @@ public function main(Request $request): RunnableResponse // generate session id and save it in a cookie $sessionID = Utils\Random::generateID(); $cookieName = $amc_cf->getCookieName(); - Utils\HTTP::setCookie($cookieName, $sessionID); + $this->http_utils::setCookie($cookieName, $sessionID); // generate the authentication information $attributes = $s->getAttributes(); @@ -129,10 +164,9 @@ public function main(Request $request): RunnableResponse $memcache->set($sessionID, $data, $expirationTime ?? 0); // register logout handler - $session = $this->session::getSessionFromRequest(); - $session->registerLogoutHandler($sourceId, '\SimpleSAML\Module\memcookie\AuthMemCookie', 'logoutHandler'); + $this->session->registerLogoutHandler($sourceId, '\SimpleSAML\Module\memcookie\AuthMemCookie', 'logoutHandler'); // redirect the user back to this page to signal that the login is completed - return RunnableResponse([Utils\HTTP::class, 'redirectTrustedURL'], [Utils\HTTP::getSelfURL()]); + return new RunnableResponse([$this->http_utils, 'redirectTrustedURL'], [$this->http_utils::getSelfURL()]); } } diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/lib/Controller/MemcookieTest.php index 4257ff5..5c172ac 100644 --- a/tests/lib/Controller/MemcookieTest.php +++ b/tests/lib/Controller/MemcookieTest.php @@ -5,11 +5,13 @@ namespace SimpleSAML\Test\Module\memcookie\Controller; use PHPUnit\Framework\TestCase; +use SimpleSAML\Auth; use SimpleSAML\Configuration; use SimpleSAML\Error; use SimpleSAML\HTTP\RunnableResponse; use SimpleSAML\Module\memcookie\Controller; use SimpleSAML\Session; +use SimpleSAML\Utils; use Symfony\Component\HttpFoundation\Request; /** @@ -25,6 +27,9 @@ class MemcookieTest extends TestCase /** @var \SimpleSAML\Configuration */ protected $config; + /** @var \SimpleSAML\Utils\HTTP */ + protected $http_utils; + /** @var \SimpleSAML\Configuration */ protected $module_config; @@ -48,31 +53,46 @@ protected function setUp(): void 'simplesaml' ); + $session = $this->createMock(Session::class); + $session->method('getData')->willReturn(['default-sp' => []]); + /** @var \SimpleSAML\Session $session */ + $this->session = $session; + $this->authsources = Configuration::loadFromArray( [ 'default-sp' => ['saml:SP'], ], '[ARRAY]', - 'authsources.php' + 'simplesaml' ); - Configuration::setPreLoadedConfig($this->authsources, 'authsources.php'); + Configuration::setPreLoadedConfig($this->authsources, 'authsources.php', 'simplesaml'); + + $this->http_utils = new class () extends Utils\HTTP { + public static function setCookie(string $name, ?string $value, array $params = null, bool $throw = true): void + { + // stub + } + + public static function redirectTrustedURL(string $url, array $parameters = []): void + { + // stub + } + }; $this->module_config = Configuration::loadFromArray( [ 'authsource' => 'default-sp', 'cookiename' => 'AuthMemCookie', - 'username' => null, + 'username' => 'uid', 'groups' => null, 'memcache.host' => '127.0.0.1', 'memcache.port' => 11211, ], '[ARRAY]', - 'module_authmemcookie.php' + 'simplesaml' ); - Configuration::setPreLoadedConfig($this->module_config, 'module_authmemcookie.php'); - - $this->session = Session::getSessionFromRequest(); + Configuration::setPreLoadedConfig($this->module_config, 'module_authmemcookie.php', 'simplesaml'); } @@ -93,6 +113,19 @@ public function testMemcookie(): void ); $c = new Controller\Memcookie($this->config, $this->session); + $c->setHttpUtils($this->http_utils); + $c->setAuthSimple(new class ('admin') extends Auth\Simple { + public function requireAuth(array $params = []): void + { + // stub + } + + public function getAttributes(): array + { + return ['uid' => ['dduck']]; + } + }); + /** @var \SimpleSAML\HTTP\RunnableResponse $response */ $response = $c->main($request); From 3d941ad8c0ec7761efa1bb0bb71d046eec98f433 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Jan 2021 00:05:01 +0100 Subject: [PATCH 018/113] Use memcached instead of memcache --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2d944b7..4a90677 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: ${{ matrix.php-versions }} - extensions: ldap, mbstring, memcache, xml + extensions: ldap, mbstring, memcached, xml coverage: pcov - name: Setup problem matchers for PHP @@ -82,7 +82,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' - extensions: ldap, mbstring, memcache, xml + extensions: ldap, mbstring, memcached, xml coverage: none - name: Setup problem matchers for PHP @@ -122,7 +122,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' - extensions: ldap, mbstring, memcache, xml + extensions: ldap, mbstring, memcached, xml coverage: none - name: Setup problem matchers for PHP @@ -160,7 +160,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' - extensions: ldap, mbstring, memcache, xml + extensions: ldap, mbstring, memcached, xml - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" From fddacf5b85f8cb993901e58bfafab4eab82c69f0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Jan 2021 00:53:31 +0100 Subject: [PATCH 019/113] Mark test as skipped on Windows --- tests/lib/Controller/MemcookieTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/lib/Controller/MemcookieTest.php index 5c172ac..c772d3c 100644 --- a/tests/lib/Controller/MemcookieTest.php +++ b/tests/lib/Controller/MemcookieTest.php @@ -102,6 +102,10 @@ public static function redirectTrustedURL(string $url, array $parameters = []): */ public function testMemcookie(): void { + if (Utils\System::getOS() === Utils\System::WINDOWS) { + $this->markTestSkipped('This test can only run on Linux because of the availability of the memcached-extension.'); + } + $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['REQUEST_URI'] = '/module.php/memcookie/'; $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; From f236a67a80510efcf0b6e9333d2cffcc8424b6de Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Jan 2021 00:56:33 +0100 Subject: [PATCH 020/113] Ignore composer-dependency on ext-memcached --- .github/workflows/php.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4a90677..6f46446 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -52,7 +52,7 @@ jobs: run: composer validate - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Syntax check PHP run: bash vendor/bin/check-syntax-php.sh @@ -102,13 +102,13 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for locked dependencies uses: symfonycorp/security-checker-action@v2 - name: Update Composer dependencies - run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader + run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for updated dependencies uses: symfonycorp/security-checker-action@v2 @@ -142,7 +142,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Syntax check YAML / XML / JSON run: | @@ -179,7 +179,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader + run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - uses: actions/download-artifact@v1 with: From ddc5bbe9254e73d4e22a8ecb2ce309b4a42de140 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Jan 2021 01:04:19 +0100 Subject: [PATCH 021/113] Fix Psalm-config --- psalm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 09033f0..601ab0d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -7,7 +7,7 @@ - + From 3ce0ea4d602d36417b238d397aa0894734aa45fc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Jan 2021 01:05:53 +0100 Subject: [PATCH 022/113] Suppress UnresolvableInclude --- psalm.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/psalm.xml b/psalm.xml index 601ab0d..329f315 100644 --- a/psalm.xml +++ b/psalm.xml @@ -27,6 +27,13 @@ + + + + + + + From a371485004397799efa9d46636105a7109e9925e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 21 Jan 2021 19:18:09 +0100 Subject: [PATCH 023/113] Add badges --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d5a27a1..03a21e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/workflows/CI/badge.svg?branch=master) [![Coverage Status](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/?branch=master) SimpleSAMLphp AuthMemCookie module ================================== From 2a93dbfc1bd4e47b6edc24a4e09339921a44aac4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 24 Jan 2021 16:32:20 +0100 Subject: [PATCH 024/113] Use composer v2 --- .github/workflows/php.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6f46446..3255215 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,6 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: ${{ matrix.php-versions }} + tools: composer:v2 extensions: ldap, mbstring, memcached, xml coverage: pcov @@ -52,7 +53,7 @@ jobs: run: composer validate - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Syntax check PHP run: bash vendor/bin/check-syntax-php.sh @@ -82,6 +83,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' + tools: composer:v2 extensions: ldap, mbstring, memcached, xml coverage: none @@ -102,13 +104,13 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for locked dependencies uses: symfonycorp/security-checker-action@v2 - name: Update Composer dependencies - run: composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer update --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for updated dependencies uses: symfonycorp/security-checker-action@v2 @@ -122,6 +124,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' + tools: composer:v2 extensions: ldap, mbstring, memcached, xml coverage: none @@ -142,7 +145,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Syntax check YAML / XML / JSON run: | @@ -160,6 +163,7 @@ jobs: uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' + tools: composer:v2 extensions: ldap, mbstring, memcached, xml - name: Setup problem matchers for PHP @@ -179,7 +183,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - uses: actions/download-artifact@v1 with: From 7a3f7b0a36f581c2a88354532f3c223e2869a910 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 24 Jan 2021 16:35:24 +0100 Subject: [PATCH 025/113] Typed properties & strict typing --- lib/AuthMemCookie.php | 6 ++++-- lib/Controller/Memcookie.php | 4 ++-- tests/bootstrap.php | 2 ++ tests/lib/Controller/MemcookieTest.php | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index b9f8d95..d68a36c 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -1,5 +1,7 @@ Date: Fri, 26 Mar 2021 18:43:26 +0100 Subject: [PATCH 026/113] Migrate to non-static utils --- lib/AuthMemCookie.php | 3 ++- lib/Controller/Memcookie.php | 12 ++++++------ tests/lib/Controller/MemcookieTest.php | 7 ++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index d68a36c..538e0cf 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -150,7 +150,8 @@ private function doLogout(): void $memcache->delete($sessionID); // delete the session cookie - Utils\HTTP::setCookie($cookieName, null); + $httpUtils = new Utils\HTTP(); + $httpUtils->setCookie($cookieName, null); } diff --git a/lib/Controller/Memcookie.php b/lib/Controller/Memcookie.php index fb6504c..fe2cfee 100644 --- a/lib/Controller/Memcookie.php +++ b/lib/Controller/Memcookie.php @@ -33,10 +33,9 @@ class Memcookie protected Configuration $config; /** - * @var \SimpleSAML\Utils\HTTP|string - * @psalm-var \SimpleSAML\Utils\HTTP|class-string + * @var \SimpleSAML\Utils\HTTP */ - protected $http_utils = Utils\HTTP::class; + protected $http_utils; /** @var \SimpleSAML\Session */ protected Session $session; @@ -111,9 +110,10 @@ public function main(Request $request): RunnableResponse $s->requireAuth(); // generate session id and save it in a cookie - $sessionID = Utils\Random::generateID(); + $randomUtils = new Utils\Random(); + $sessionID = $randomUtils->generateID(); $cookieName = $amc_cf->getCookieName(); - $this->http_utils::setCookie($cookieName, $sessionID); + $this->http_utils->setCookie($cookieName, $sessionID); // generate the authentication information $attributes = $s->getAttributes(); @@ -167,6 +167,6 @@ public function main(Request $request): RunnableResponse $this->session->registerLogoutHandler($sourceId, '\SimpleSAML\Module\memcookie\AuthMemCookie', 'logoutHandler'); // redirect the user back to this page to signal that the login is completed - return new RunnableResponse([$this->http_utils, 'redirectTrustedURL'], [$this->http_utils::getSelfURL()]); + return new RunnableResponse([$this->http_utils, 'redirectTrustedURL'], [$this->http_utils->getSelfURL()]); } } diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/lib/Controller/MemcookieTest.php index 0117250..d4db2ef 100644 --- a/tests/lib/Controller/MemcookieTest.php +++ b/tests/lib/Controller/MemcookieTest.php @@ -69,12 +69,12 @@ protected function setUp(): void Configuration::setPreLoadedConfig($this->authsources, 'authsources.php', 'simplesaml'); $this->http_utils = new class () extends Utils\HTTP { - public static function setCookie(string $name, ?string $value, array $params = null, bool $throw = true): void + public function setCookie(string $name, ?string $value, array $params = null, bool $throw = true): void { // stub } - public static function redirectTrustedURL(string $url, array $parameters = []): void + public function redirectTrustedURL(string $url, array $parameters = []): void { // stub } @@ -102,7 +102,8 @@ public static function redirectTrustedURL(string $url, array $parameters = []): */ public function testMemcookie(): void { - if (Utils\System::getOS() === Utils\System::WINDOWS) { + $sysUtils = new Utils\System(); + if ($sysUtils->getOS() === $sysUtils::WINDOWS) { $this->markTestSkipped('This test can only run on Linux because of the availability of the memcached-extension.'); } From 973bb28635d39c633b6ad009e65b553306b7b8ff Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 26 Mar 2021 18:53:02 +0100 Subject: [PATCH 027/113] Bump test-framework --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4e03e00..d54844a 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "simplesamlphp/simplesamlphp": "dev-master" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.0.5" + "simplesamlphp/simplesamlphp-test-framework": "^1.1.0" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From 20201a70be5aee21044bc1dd70bf577942c4433f Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 3 Sep 2021 20:02:22 +0200 Subject: [PATCH 028/113] Suppress annotations --- codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codecov.yml b/codecov.yml index f7f39e1..d194c1c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,3 +9,6 @@ comment: require_base: no require_head: yes branches: null + +github_checks: + annotations: false From bffaec583b5ae8fc9ad4f73f1e8f1ecee08ec5dc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 7 Dec 2021 18:36:44 +0100 Subject: [PATCH 029/113] Bump dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d54844a..78370ba 100644 --- a/composer.json +++ b/composer.json @@ -25,10 +25,10 @@ "ext-memcached": "*", "simplesamlphp/composer-module-installer": ">=1.1.6", - "simplesamlphp/simplesamlphp": "dev-master" + "simplesamlphp/simplesamlphp": "^2.0.0-beta.2" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.1.0" + "simplesamlphp/simplesamlphp-test-framework": "^1.1.4" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From 3969919165e8921783a50e2c1cf15331aa196426 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 9 Dec 2021 18:19:11 +0100 Subject: [PATCH 030/113] Start testing PHP 8.1 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3255215..c65576f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ['7.4', '8.0'] + php-versions: ['7.4', '8.0', '8.1'] steps: - name: Setup PHP, with composer and extensions From 63962cd5f08323a6909720f2c8ec6817fdde267e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 6 Jan 2022 13:22:40 +0100 Subject: [PATCH 031/113] Allow minor coverage decrease --- codecov.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index d194c1c..d7327b3 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,10 @@ coverage: status: project: yes - + default: + target: 0% + threshold: 2% + patch: off comment: layout: "diff" behavior: once From 326f9bc90e81b0f3dab6d122f18edb6026dc8b40 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 6 Jan 2022 23:40:50 +0100 Subject: [PATCH 032/113] Set allow-plugins tag --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index 78370ba..b674564 100644 --- a/composer.json +++ b/composer.json @@ -33,5 +33,11 @@ "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", "source": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/" + }, + "config": { + "allow-plugins": { + "composer/package-versions-deprecated": true, + "simplesamlphp/composer-module-installer": true + } } } From e11c4f56c9ec1e4c596dda7732d54c583d35bf98 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 15 Mar 2022 21:44:00 +0100 Subject: [PATCH 033/113] Add badge for type-coverage --- .github/workflows/php.yml | 2 +- README.md | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c65576f..a11302f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -199,7 +199,7 @@ jobs: - name: Psalm continue-on-error: true - run: php vendor/bin/psalm --show-info=true + run: php vendor/bin/psalm --show-info=true --shepherd - name: Psalter continue-on-error: true diff --git a/README.md b/README.md index 03a21e0..4015255 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/workflows/CI/badge.svg?branch=master) [![Coverage Status](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/?branch=master) +[![Type Coverage](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie/coverage.svg)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie) +[![Psalm Level](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie/level.svg)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie) SimpleSAMLphp AuthMemCookie module ================================== @@ -28,8 +30,8 @@ Once you have installed SimpleSAMLphp, installing this module is very simple. Fi Composer](https://getcomposer.org/) if you haven't already. After installing Composer, just execute the following command in the root of your SimpleSAMLphp installation: -``` -./composer.phar require simplesamlphp/simplesamlphp-module-memcookie:dev-master +```shell +composer.phar require simplesamlphp/simplesamlphp-module-memcookie:dev-master ``` where `dev-master` instructs Composer to install the `master` branch from the Git repository. See the @@ -45,7 +47,7 @@ Configuration The first step to use this module is to configure *Auth MemCookie* appropriately. The following example (that you can find also in `extra/auth_memcookie.conf`) might be helpful: -``` +```apacheconf # This is a list of memcache servers which Auth MemCookie # should use. @@ -98,7 +100,7 @@ redirect you automatically to the IdP for authentication. In order to see all the environment variables you have available in the protected location, you can drop a PHP script like the following in there and access it from your browser after authenticating to your IdP: -``` +```html From 3f500d756ec652421d04c988e221139b10de10ef Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 16 Mar 2022 22:03:52 +0100 Subject: [PATCH 034/113] Fix Psalm configuration --- psalm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 329f315..db6eb41 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,7 +2,8 @@ From eff8fccfba31a76e300c707ccd6a9a9fc5004bf3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 16 Mar 2022 23:29:22 +0100 Subject: [PATCH 035/113] Fix Configuration-getters --- lib/AuthMemCookie.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/AuthMemCookie.php b/lib/AuthMemCookie.php index 538e0cf..54390ca 100644 --- a/lib/AuthMemCookie.php +++ b/lib/AuthMemCookie.php @@ -72,7 +72,7 @@ public function getAuthSource(): string */ public function getCookieName(): string { - $cookieName = $this->config->getString('cookiename', 'AuthMemCookie'); + $cookieName = $this->config->getOptionalString('cookiename', 'AuthMemCookie'); if (!is_string($cookieName) || strlen($cookieName) === 0) { throw new Exception( "Configuration option 'cookiename' contains an invalid value. This option should be a string." @@ -90,7 +90,7 @@ public function getCookieName(): string */ public function getUsernameAttr(): ?string { - return $this->config->getString('username', null); + return $this->config->getOptionalString('username', null); } @@ -101,7 +101,7 @@ public function getUsernameAttr(): ?string */ public function getGroupsAttr(): ?string { - return $this->config->getString('groups', null); + return $this->config->getOptionalString('groups', null); } @@ -112,8 +112,8 @@ public function getGroupsAttr(): ?string */ public function getMemcache(): \Memcached { - $memcacheHost = $this->config->getString('memcache.host', '127.0.0.1'); - $memcachePort = $this->config->getInteger('memcache.port', 11211); + $memcacheHost = $this->config->getOptionalString('memcache.host', '127.0.0.1'); + $memcachePort = $this->config->getOptionalInteger('memcache.port', 11211); $class = class_exists('\Memcached') ? '\Memcached' : false; From bde2ecdb37afbb77580a0d6c92e558ba6fb3a0ba Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 16 Mar 2022 23:29:33 +0100 Subject: [PATCH 036/113] Add missing intl dependency --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a11302f..53ec37e 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -22,7 +22,7 @@ jobs: with: php-version: ${{ matrix.php-versions }} tools: composer:v2 - extensions: ldap, mbstring, memcached, xml + extensions: intl, mbstring, memcached, xml coverage: pcov - name: Setup problem matchers for PHP From 8cd859ee6a7c024239d1a4337beb88712bf3e807 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 5 Apr 2022 21:37:47 +0200 Subject: [PATCH 037/113] Suppress deprecation errors --- .github/workflows/php.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 53ec37e..cbbce62 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -20,10 +20,11 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: + coverage: pcov + extensions: intl, mbstring, memcached, xml + ini-values: error_reporting=E_ALL php-version: ${{ matrix.php-versions }} tools: composer:v2 - extensions: intl, mbstring, memcached, xml - coverage: pcov - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" From b0a720285348e2ba7e93d6f4276a44191a16076c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 5 Apr 2022 21:56:07 +0200 Subject: [PATCH 038/113] Use Xdebug for coverage reports --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cbbce62..13facfd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -20,7 +20,7 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: - coverage: pcov + coverage: debug extensions: intl, mbstring, memcached, xml ini-values: error_reporting=E_ALL php-version: ${{ matrix.php-versions }} From 71f1f239494333d28e56e457ebc32fca63f72cd5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 5 Apr 2022 22:19:06 +0200 Subject: [PATCH 039/113] Add markdown-linter to QC --- .github/workflows/php.yml | 6 ++++++ .markdownlintignore | 1 + 2 files changed, 7 insertions(+) create mode 100644 .markdownlintignore diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 13facfd..a6c07bb 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -205,3 +205,9 @@ jobs: - name: Psalter continue-on-error: true run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run + + - name: Lint markdown files + uses: nosborn/github-action-markdown-cli@v3.0.1 + with: + files: . + ignore_path: .markdownlintignore diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 0000000..140fada --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1 @@ +vendor/* From 5b55cd9cfa9966b3057f862229eaa18c8a2ded38 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 12 Jun 2022 23:34:00 +0200 Subject: [PATCH 040/113] Suppress markdown long lines --- .markdownlintrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .markdownlintrc diff --git a/.markdownlintrc b/.markdownlintrc new file mode 100644 index 0000000..b077f0e --- /dev/null +++ b/.markdownlintrc @@ -0,0 +1,4 @@ +{ + "default": true, + "MD013": false +} From 9a46c5b9108458e184a05416214e9128c6a9633d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 13 Jun 2022 23:25:37 +0200 Subject: [PATCH 041/113] Fix codecov configuration syntax error --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index d7327b3..d01dd7d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,6 @@ coverage: status: - project: yes + project: default: target: 0% threshold: 2% From 481964a497f177efd090048b84731ef5ccfb2728 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 14 Jun 2022 01:04:42 +0200 Subject: [PATCH 042/113] Update upload/download artifacts --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a6c07bb..6e838b5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -71,7 +71,7 @@ jobs: - name: Save coverage data if: ${{ matrix.php-versions == '7.4' && matrix.operating-system == 'ubuntu-latest' }} - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: build-data path: ${{ github.workspace }}/build @@ -186,7 +186,7 @@ jobs: - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - - uses: actions/download-artifact@v1 + - uses: actions/download-artifact@v3 with: name: build-data path: ${{ github.workspace }}/build From 2c9aa8716f0c3a374f32095c2841543c1c4443e0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 14 Jun 2022 22:30:16 +0200 Subject: [PATCH 043/113] move lib > src --- .php_cs.dist | 17 +++++++++++++++++ composer.json | 6 +++--- phpcs.xml | 2 +- phpunit.xml | 2 +- psalm.xml | 2 +- {lib => src}/AuthMemCookie.php | 0 {lib => src}/Controller/Memcookie.php | 0 tests/{lib => src}/Controller/MemcookieTest.php | 0 8 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .php_cs.dist rename {lib => src}/AuthMemCookie.php (100%) rename {lib => src}/Controller/Memcookie.php (100%) rename tests/{lib => src}/Controller/MemcookieTest.php (100%) diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..795e2b1 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,17 @@ +in([ + __DIR__ . '/hooks', + __DIR__ . '/templates', + __DIR__ . '/tests', + __DIR__ . '/www', + ]) +; +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + '@PSR4' => true, + '@PSR5' => true, + ]) + ->setFinder($finder) +; diff --git a/composer.json b/composer.json index b674564..a877207 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,11 @@ "php": ">=7.4 || ^8.0", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": ">=1.1.6", - "simplesamlphp/simplesamlphp": "^2.0.0-beta.2" + "simplesamlphp/composer-module-installer": ">=1.1.8", + "simplesamlphp/simplesamlphp": "^2.0.0-beta.11" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.1.4" + "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", diff --git a/phpcs.xml b/phpcs.xml index 40a5316..5581d03 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,7 +4,7 @@ By default it is less stringent about long lines than other coding standards - lib + src tests www diff --git a/phpunit.xml b/phpunit.xml index b0160ae..e5ddedb 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ - ./lib + ./src diff --git a/psalm.xml b/psalm.xml index db6eb41..e79917b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -7,7 +7,7 @@ > - + diff --git a/lib/AuthMemCookie.php b/src/AuthMemCookie.php similarity index 100% rename from lib/AuthMemCookie.php rename to src/AuthMemCookie.php diff --git a/lib/Controller/Memcookie.php b/src/Controller/Memcookie.php similarity index 100% rename from lib/Controller/Memcookie.php rename to src/Controller/Memcookie.php diff --git a/tests/lib/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php similarity index 100% rename from tests/lib/Controller/MemcookieTest.php rename to tests/src/Controller/MemcookieTest.php From d134c1afb2d481de4310234c2980c3a0d0990d5b Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 10 Jul 2022 22:11:37 +0200 Subject: [PATCH 044/113] Fix typos --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 5581d03..8b22712 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -11,6 +11,6 @@ - + From 260b82c2ef929c1cfbca18cb8fbf126b28d5ca74 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 4 Sep 2022 17:28:16 +0200 Subject: [PATCH 045/113] Update security-checker --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6e838b5..2baa967 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -108,13 +108,13 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for locked dependencies - uses: symfonycorp/security-checker-action@v2 + uses: symfonycorp/security-checker-action@v3 - name: Update Composer dependencies run: composer update --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for updated dependencies - uses: symfonycorp/security-checker-action@v2 + uses: symfonycorp/security-checker-action@v3 sanity-check: name: Sanity checks From 3640773359e2fdddcf20946f451a470605949486 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 13 Sep 2022 18:09:34 +0200 Subject: [PATCH 046/113] Fix namespace --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a877207..5f80e5b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "autoload": { "psr-4": { - "SimpleSAML\\Module\\memcookie\\": "lib/" + "SimpleSAML\\Module\\memcookie\\": "src/" } }, "require": { From 29b10edeeb5887d8a6b2f6e5454a3368a7994fb0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 13 Sep 2022 18:09:49 +0200 Subject: [PATCH 047/113] Bump SSP requirement --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5f80e5b..80ff20c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "ext-memcached": "*", "simplesamlphp/composer-module-installer": ">=1.1.8", - "simplesamlphp/simplesamlphp": "^2.0.0-beta.11" + "simplesamlphp/simplesamlphp": "^2.0.0-rc1" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" From cfae3fd49a81bd5d6597e948c889c53ea57f7575 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 13 Sep 2022 18:23:00 +0200 Subject: [PATCH 048/113] Fix markdown --- README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4015255..106831f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ +# SimpleSAMLphp AuthMemCookie module + ![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/workflows/CI/badge.svg?branch=master) [![Coverage Status](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/?branch=master) [![Type Coverage](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie/coverage.svg)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie) [![Psalm Level](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie/level.svg)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie) -SimpleSAMLphp AuthMemCookie module -================================== - This module implements [Auth MemCookie](https://zenprojects.github.io/Apache-Authmemcookie-Module/) support for SimpleSAMLphp. This allows you to integrate SimpleSAMLphp with web applications written in languages other than PHP. @@ -14,8 +13,7 @@ you to integrate SimpleSAMLphp with web applications written in languages other the attributes found in this data. It also allows you to use the default **Apache access control** features to restrict access to your site. -Requisites ----------- +## Requisites This module requires you to install and set up the following requirements: @@ -23,8 +21,7 @@ This module requires you to install and set up the following requirements: * A *memcache* server. * [Auth MemCookie](https://zenprojects.github.io/Apache-Authmemcookie-Module/) . -Installation ------------- +## Installation Once you have installed SimpleSAMLphp, installing this module is very simple. First of all, you will need to [download Composer](https://getcomposer.org/) if you haven't already. After installing Composer, just execute the following @@ -41,8 +38,8 @@ stable version of the module. The module is enabled by default. If you want to disable the module once installed, you just need to create a file named `disable` in the `modules/memcookie` directory inside your SimpleSAMLphp installation. -Configuration -------------- +## Configuration + The first step to use this module is to configure *Auth MemCookie* appropriately. The following example (that you can find also in `extra/auth_memcookie.conf`) might be helpful: From cc92086b03892f7f1e028998df5998904ec1a2b1 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 21 Sep 2022 23:23:35 +0200 Subject: [PATCH 049/113] Bump actions --- .github/workflows/documentation.yml | 53 +++++++++++++++++++++++++++++ .github/workflows/php.yml | 33 +++++++++--------- 2 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..16bfce3 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,53 @@ +name: Documentation + +on: + push: + branches: [ master, simplesamlphp-* ] + paths: + - '**.md' + pull_request: + branches: [ master, simplesamlphp-* ] + paths: + - '**.md' + +jobs: + quality: + name: Quality checks + runs-on: [ubuntu-latest] + + steps: + - uses: actions/checkout@v3 + + - name: Lint markdown files + uses: nosborn/github-action-markdown-cli@v3.1.0 + with: + files: . + ignore_path: .markdownlintignore + + - name: Perform spell check + uses: codespell-project/actions-codespell@master + with: + path: '**/*.md' + check_filenames: true + ignore_words_list: tekst + + build: + name: Build documentation + needs: quality + runs-on: [ubuntu-latest] + + steps: + - name: Run docs build + if: github.event_name != 'pull_request' + uses: actions/github-script@v6 + with: + # Token has to be generated on a user account that controls the docs-repository. + # The _only_ scope to select is "Access public repositories", nothing more. + github-token: ${{ secrets.PAT_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'simplesamlphp', + repo: 'docs', + workflow_id: 'mk_docs.yml', + ref: 'main' + }) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2baa967..0d6eeba 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,8 +3,12 @@ name: CI on: push: branches: [ '**' ] + paths-ignore: + - '**.md' pull_request: branches: [ master, release-* ] + paths-ignore: + - '**.md' jobs: basic-tests: @@ -37,14 +41,14 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -91,14 +95,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -132,14 +136,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -161,6 +165,7 @@ jobs: steps: - name: Setup PHP, with composer and extensions + id: setup-php uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' @@ -170,14 +175,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -192,7 +197,7 @@ jobs: path: ${{ github.workspace }}/build - name: Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 - name: PHP Code Sniffer continue-on-error: true @@ -200,14 +205,8 @@ jobs: - name: Psalm continue-on-error: true - run: php vendor/bin/psalm --show-info=true --shepherd + run: php vendor/bin/psalm --show-info=true --shepherd --php-version=${{ steps.setup-php.outputs.php-version }} - name: Psalter continue-on-error: true - run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run - - - name: Lint markdown files - uses: nosborn/github-action-markdown-cli@v3.0.1 - with: - files: . - ignore_path: .markdownlintignore + run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run --php-version=${{ steps.setup-php.outputs.php-version }} From d51c01f693b08a1cca9d5affb91e880af13d592d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 22 Sep 2022 00:02:41 +0200 Subject: [PATCH 050/113] Add enable-instructions --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 106831f..d640088 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,15 @@ where `dev-master` instructs Composer to install the `master` branch from the Gi [releases](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/releases) available if you want to use a stable version of the module. -The module is enabled by default. If you want to disable the module once installed, you just need to create a file named -`disable` in the `modules/memcookie` directory inside your SimpleSAMLphp installation. - ## Configuration +Next thing you need to do is to enable the module: + +in `config.php`, search for the `module.enable` key and set `memcookie` to true: + +```php + 'module.enable' => [ 'memcookie' => true, … ], +``` The first step to use this module is to configure *Auth MemCookie* appropriately. The following example (that you can find also in `extra/auth_memcookie.conf`) might be helpful: From 6e5a7821a65ad40a26cb49c4a1f2958bcb750798 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 4 Oct 2022 21:56:04 +0200 Subject: [PATCH 051/113] Use faster pcov instead of xdebug --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0d6eeba..8cb3a82 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -24,7 +24,7 @@ jobs: - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: - coverage: debug + coverage: pcov extensions: intl, mbstring, memcached, xml ini-values: error_reporting=E_ALL php-version: ${{ matrix.php-versions }} From 7d76094f0ecd1fb4fbf421a2d32431676c1d2eec Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 22 Nov 2022 22:43:33 +0100 Subject: [PATCH 052/113] Fix deprecated set-output --- .github/workflows/php.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8cb3a82..1084db7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -43,9 +43,13 @@ jobs: - uses: actions/checkout@v3 - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Get composer cache directory (linux) + if: ${{ matrix.operating-system == 'ubuntu-latest' }} + run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $GITHUB_ENV + + - name: Get composer cache directory (windows) + if: ${{ matrix.operating-system == 'windows-latest' }} + run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $env:GITHUB_ENV - name: Cache composer dependencies uses: actions/cache@v3 From 950f56eeceeb1d7bcf24ffd30b16b140d48e01f2 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 12 Dec 2022 21:31:52 +0100 Subject: [PATCH 053/113] Fix build --- .github/workflows/php.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1084db7..f3e9b04 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ['7.4', '8.0', '8.1'] + php-versions: ['7.4', '8.0', '8.1', '8.2'] steps: - name: Setup PHP, with composer and extensions @@ -54,7 +54,7 @@ jobs: - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -101,14 +101,10 @@ jobs: - uses: actions/checkout@v3 - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -142,14 +138,10 @@ jobs: - uses: actions/checkout@v3 - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -181,14 +173,10 @@ jobs: - uses: actions/checkout@v3 - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache composer dependencies uses: actions/cache@v3 with: - path: ${{ steps.composer-cache.outputs.dir }} + path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- From 3560abf66405aec52942ab7ca705e62ddca8a8e4 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 4 Jan 2023 18:08:18 +0100 Subject: [PATCH 054/113] Use composer audit instead of third party security checker --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f3e9b04..d398296 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -112,13 +112,13 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for locked dependencies - uses: symfonycorp/security-checker-action@v3 + run: composer audit - name: Update Composer dependencies run: composer update --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached - name: Security check for updated dependencies - uses: symfonycorp/security-checker-action@v3 + run: composer audit sanity-check: name: Sanity checks From 843de70c2874880cd63ab6bf11a71cce5e6279eb Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 23 Jan 2023 20:24:42 +0100 Subject: [PATCH 055/113] Update module-installer --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 80ff20c..97bebed 100644 --- a/composer.json +++ b/composer.json @@ -24,8 +24,8 @@ "php": ">=7.4 || ^8.0", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": ">=1.1.8", - "simplesamlphp/simplesamlphp": "^2.0.0-rc1" + "simplesamlphp/composer-module-installer": "^1.3.2", + "simplesamlphp/simplesamlphp": "^2.0.0-rc2" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" From 6c7fdcccb2dba42792a4ae3cd59e75cf1097437e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 18 Mar 2023 11:11:12 +0100 Subject: [PATCH 056/113] Bump nosborn --- .github/workflows/documentation.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 16bfce3..bc44f1e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,12 +1,14 @@ +--- + name: Documentation -on: +on: # yamllint disable-line rule:truthy push: - branches: [ master, simplesamlphp-* ] + branches: [master, simplesamlphp-*] paths: - '**.md' pull_request: - branches: [ master, simplesamlphp-* ] + branches: [master, simplesamlphp-*] paths: - '**.md' @@ -19,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Lint markdown files - uses: nosborn/github-action-markdown-cli@v3.1.0 + uses: nosborn/github-action-markdown-cli@v3.2.0 with: files: . ignore_path: .markdownlintignore From ad6ca9ad6e54d574a3395a7878449b6557b23d22 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 18 Mar 2023 18:38:19 +0100 Subject: [PATCH 057/113] Lock conversations of closed issues/prs after 90 days of inactivity --- .github/workflows/autolock-conversations.yml | 25 ++++++++++++++++++++ .github/workflows/documentation.yml | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/autolock-conversations.yml diff --git a/.github/workflows/autolock-conversations.yml b/.github/workflows/autolock-conversations.yml new file mode 100644 index 0000000..5d66869 --- /dev/null +++ b/.github/workflows/autolock-conversations.yml @@ -0,0 +1,25 @@ +--- + +name: 'Lock Threads' + +on: # yamllint disable-line rule:truthy + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v4 + with: + issue-inactive-days: '90' + pr-inactive-days: '90' + log-output: true diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index bc44f1e..71477d4 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 - name: Lint markdown files - uses: nosborn/github-action-markdown-cli@v3.2.0 + uses: nosborn/github-action-markdown-cli@v3 with: files: . ignore_path: .markdownlintignore From ba876c093e05ec7b0e0f6b293cce106873c86b31 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 2 Apr 2023 12:43:50 +0200 Subject: [PATCH 058/113] Add .gitattributes file --- .gitattributes | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3b911a4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +/.github/ export-ignore +/tools/ export-ignore +/tests/ export-ignore +codecov.yml export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +psalm.xml export-ignore +psalm-dev.xml export-ignore +phpcs.xml export-ignore +phpunit.xml export-ignore +.php_cs.dist export-ignore +.markdownlintignore export-ignore +.markdownlintrc export-ignore From 9e56115c32e363ac8b0dc6bfd25e48d5efba235c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 23 Oct 2023 22:33:00 +0200 Subject: [PATCH 059/113] Set allowed methods --- routing/routes/routes.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routing/routes/routes.yml b/routing/routes/routes.yml index 3ebbf48..2a51241 100644 --- a/routing/routes/routes.yml +++ b/routing/routes/routes.yml @@ -1,3 +1,4 @@ memcookie-main: - path: / - defaults: { _controller: 'SimpleSAML\Module\memcookie\Controller\Memcookie::main' } + path: / + defaults: { _controller: 'SimpleSAML\Module\memcookie\Controller\Memcookie::main' } + methods: [GET] From 5b7b39d86095b1cbd0b880dc8f0f0cc2b11ea255 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 5 Dec 2023 21:36:02 +0100 Subject: [PATCH 060/113] Bump test-framework --- .github/workflows/documentation.yml | 2 +- .github/workflows/php.yml | 296 ++++++++++++------ codecov.yml | 9 +- composer.json | 9 +- .../module_authmemcookie.php.dist | 0 phpcs.xml | 3 +- psalm-dev.xml | 32 ++ psalm.xml | 15 +- tests/src/Controller/MemcookieTest.php | 4 +- tools/composer-require-checker.json | 4 + 10 files changed, 248 insertions(+), 126 deletions(-) rename config-templates/module_authmemcookie.php => config/module_authmemcookie.php.dist (100%) create mode 100644 psalm-dev.xml create mode 100644 tools/composer-require-checker.json diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 71477d4..507ccff 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Lint markdown files uses: nosborn/github-action-markdown-cli@v3 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d398296..df3b7c5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,55 +1,66 @@ +--- + name: CI -on: +on: # yamllint disable-line rule:truthy push: - branches: [ '**' ] + branches: ['**'] paths-ignore: - '**.md' pull_request: - branches: [ master, release-* ] + branches: [master, release-*] paths-ignore: - '**.md' + workflow_dispatch: jobs: - basic-tests: - name: Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }} - runs-on: ${{ matrix.operating-system }} - strategy: - fail-fast: false - matrix: - operating-system: [ubuntu-latest, windows-latest] - php-versions: ['7.4', '8.0', '8.1', '8.2'] + linter: + name: Linter + runs-on: ['ubuntu-latest'] + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter/slim@v5 + env: + LOG_LEVEL: NOTICE + VALIDATE_ALL_CODEBASE: true + LINTER_RULES_PATH: 'tools/linters' + VALIDATE_CSS: true + VALIDATE_JAVASCRIPT_ES: true + VALIDATE_JSON: true + VALIDATE_PHP_BUILTIN: true + VALIDATE_YAML: true + VALIDATE_XML: true + VALIDATE_GITHUB_ACTIONS: true + + quality: + name: Quality control + runs-on: [ubuntu-latest] steps: - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + id: setup-php + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 with: - coverage: pcov - extensions: intl, mbstring, memcached, xml - ini-values: error_reporting=E_ALL - php-version: ${{ matrix.php-versions }} - tools: composer:v2 + # Should be the higest supported version, so we can use the newest tools + php-version: '8.3' + tools: composer, composer-require-checker, composer-unused, phpcs, psalm + # optional performance gain for psalm: opcache + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ + memcached, opcache, openssl, pcre, posix, spl, xml - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - uses: actions/checkout@v4 - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: actions/checkout@v3 - - - name: Get composer cache directory (linux) - if: ${{ matrix.operating-system == 'ubuntu-latest' }} - run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $GITHUB_ENV - - - name: Get composer cache directory (windows) - if: ${{ matrix.operating-system == 'windows-latest' }} - run: echo "COMPOSER_CACHE=$(composer config cache-files-dir)" >> $env:GITHUB_ENV + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies uses: actions/cache@v3 @@ -62,143 +73,224 @@ jobs: run: composer validate - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Check code for hard dependencies missing in composer.json + run: composer-require-checker check --config-file=tools/composer-require-checker.json composer.json + + - name: Check code for unused dependencies in composer.json + run: composer-unused - - name: Syntax check PHP - run: bash vendor/bin/check-syntax-php.sh + - name: PHP Code Sniffer + run: phpcs - - name: Decide whether to run code coverage or not - if: ${{ matrix.php-versions != '7.4' || matrix.operating-system != 'ubuntu-latest' }} + - name: Psalm + continue-on-error: true run: | - echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV + psalm -c psalm.xml \ + --show-info=true \ + --shepherd \ + --php-version=${{ steps.setup-php.outputs.php-version }} - - name: Run unit tests + - name: Psalm (testsuite) run: | - echo $NO_COVERAGE - ./vendor/bin/phpunit $NO_COVERAGE + psalm -c psalm-dev.xml \ + --show-info=true \ + --shepherd \ + --php-version=${{ steps.setup-php.outputs.php-version }} - - name: Save coverage data - if: ${{ matrix.php-versions == '7.4' && matrix.operating-system == 'ubuntu-latest' }} - uses: actions/upload-artifact@v3 - with: - name: build-data - path: ${{ github.workspace }}/build + - name: Psalter + run: | + psalm --alter \ + --issues=UnnecessaryVarAnnotation \ + --dry-run \ + --php-version=${{ steps.setup-php.outputs.php-version }} security: name: Security checks runs-on: [ubuntu-latest] steps: - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 with: - php-version: '7.4' - tools: composer:v2 - extensions: ldap, mbstring, memcached, xml - coverage: none + # Should be the lowest supported version + php-version: '8.1' + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ + memcached, openssl, pcre, posix, spl, xml + tools: composer + coverage: none - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies uses: actions/cache@v3 with: - path: $COMPOSER_CACHE - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + path: $COMPOSER_CACHE + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Security check for locked dependencies run: composer audit - name: Update Composer dependencies - run: composer update --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer update --no-progress --prefer-dist --optimize-autoloader - name: Security check for updated dependencies run: composer audit - sanity-check: - name: Sanity checks - runs-on: [ubuntu-latest] + unit-tests-linux: + name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" + runs-on: ${{ matrix.operating-system }} + needs: [linter, quality, security] + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.1', '8.2', '8.3'] steps: - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 with: - php-version: '7.4' - tools: composer:v2 - extensions: ldap, mbstring, memcached, xml - coverage: none + php-version: ${{ matrix.php-versions }} + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ + memcached, openssl, pcre, posix, spl, xml + tools: composer + ini-values: error_reporting=E_ALL + coverage: pcov - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v3 + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v4 + + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies uses: actions/cache@v3 with: - path: $COMPOSER_CACHE - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + path: $COMPOSER_CACHE + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader - - name: Syntax check YAML / XML / JSON - run: | - bash vendor/bin/check-syntax-yaml.sh - bash vendor/bin/check-syntax-xml.sh - bash vendor/bin/check-syntax-json.sh + - name: Run unit tests with coverage + if: ${{ matrix.php-versions == '8.3' }} + run: vendor/bin/phpunit - quality: - name: Quality control - runs-on: [ubuntu-latest] - needs: [basic-tests] + - name: Run unit tests (no coverage) + if: ${{ matrix.php-versions != '8.3' }} + run: vendor/bin/phpunit --no-coverage + + - name: Save coverage data + if: ${{ matrix.php-versions == '8.3' }} + uses: actions/upload-artifact@v3 + with: + name: coverage-data + path: ${{ github.workspace }}/build + + unit-tests-windows: + name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" + runs-on: ${{ matrix.operating-system }} + needs: [linter, quality, security] + strategy: + fail-fast: true + matrix: + operating-system: [windows-latest] + php-versions: ['8.1'] + #php-versions: ['8.1', '8.2', '8.3'] Waiting for memcached-3.2.1 steps: - name: Setup PHP, with composer and extensions - id: setup-php - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 with: - php-version: '7.4' - tools: composer:v2 - extensions: ldap, mbstring, memcached, xml + php-version: ${{ matrix.php-versions }} + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached-3.2.0, openssl, pcre, posix, spl, xml + tools: composer + ini-values: error_reporting=E_ALL + coverage: none - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v3 + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v4 + + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" - name: Cache composer dependencies uses: actions/cache@v3 with: - path: $COMPOSER_CACHE - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + path: $COMPOSER_CACHE + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req ext-memcached + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req=ext-posix + + - name: Run unit tests + run: vendor/bin/phpunit --no-coverage + + coverage: + name: Code coverage + runs-on: [ubuntu-latest] + needs: [unit-tests-linux] + steps: + - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: - name: build-data + name: coverage-data path: ${{ github.workspace }}/build - name: Codecov uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true - - name: PHP Code Sniffer - continue-on-error: true - run: php vendor/bin/phpcs - - - name: Psalm - continue-on-error: true - run: php vendor/bin/psalm --show-info=true --shepherd --php-version=${{ steps.setup-php.outputs.php-version }} + cleanup: + name: Cleanup artifacts + needs: [unit-tests-linux, coverage] + runs-on: [ubuntu-latest] + if: | + always() && + needs.coverage.result == 'success' || + (needs.unit-tests-linux == 'success' && needs.coverage == 'skipped') - - name: Psalter - continue-on-error: true - run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run --php-version=${{ steps.setup-php.outputs.php-version }} + steps: + - uses: geekyeggo/delete-artifact@v2 + with: + name: coverage-data diff --git a/codecov.yml b/codecov.yml index d01dd7d..dac692c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,16 +1,19 @@ +--- + coverage: status: project: default: target: 0% threshold: 2% - patch: off + patch: false + comment: layout: "diff" behavior: once require_changes: true - require_base: no - require_head: yes + require_base: false + require_head: true branches: null github_checks: diff --git a/composer.json b/composer.json index 97bebed..c3d585d 100644 --- a/composer.json +++ b/composer.json @@ -21,14 +21,15 @@ } }, "require": { - "php": ">=7.4 || ^8.0", + "php": "^8.1", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": "^1.3.2", - "simplesamlphp/simplesamlphp": "^2.0.0-rc2" + "simplesamlphp/composer-module-installer": "^1.3", + "simplesamlphp/simplesamlphp": "^2.1", + "symfony/http-foundation": "^6.4" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" + "simplesamlphp/simplesamlphp-test-framework": "^1.5" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", diff --git a/config-templates/module_authmemcookie.php b/config/module_authmemcookie.php.dist similarity index 100% rename from config-templates/module_authmemcookie.php rename to config/module_authmemcookie.php.dist diff --git a/phpcs.xml b/phpcs.xml index 8b22712..93df8ab 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,13 +4,14 @@ By default it is less stringent about long lines than other coding standards + config src tests - www + diff --git a/psalm-dev.xml b/psalm-dev.xml new file mode 100644 index 0000000..960d692 --- /dev/null +++ b/psalm-dev.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/psalm.xml b/psalm.xml index e79917b..955b74d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,9 +6,8 @@ reportMixedIssues="false" > - + - @@ -28,17 +27,5 @@ - - - - - - - - - - - - diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index d4db2ef..577d46b 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -104,7 +104,9 @@ public function testMemcookie(): void { $sysUtils = new Utils\System(); if ($sysUtils->getOS() === $sysUtils::WINDOWS) { - $this->markTestSkipped('This test can only run on Linux because of the availability of the memcached-extension.'); + $this->markTestSkipped( + 'This test can only run on Linux because of the availability of the memcached-extension.', + ); } $_SERVER['REQUEST_METHOD'] = 'GET'; diff --git a/tools/composer-require-checker.json b/tools/composer-require-checker.json new file mode 100644 index 0000000..eed71aa --- /dev/null +++ b/tools/composer-require-checker.json @@ -0,0 +1,4 @@ +{ + "symbol-whitelist": [ + ] +} From 3d2d4679b26025a83c142e7191df904575f92251 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Jan 2024 22:29:26 +0100 Subject: [PATCH 061/113] Update .gitignore file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ce45e20..9e12716 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ +.phpunit.cache/ .phpunit.result.cache composer.lock composer.phar +phpunit.xml.bak /vendor/ # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control From 837715d8b7860fe16645d2281d1961d655124ee6 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Jan 2024 22:30:19 +0100 Subject: [PATCH 062/113] Remove unused use-statements and order them alphabetically --- composer.json | 3 ++- phpunit.xml | 12 +++++++----- src/Controller/Memcookie.php | 1 - tests/src/Controller/MemcookieTest.php | 1 - 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index c3d585d..bee845c 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,8 @@ "config": { "allow-plugins": { "composer/package-versions-deprecated": true, - "simplesamlphp/composer-module-installer": true + "simplesamlphp/composer-module-installer": true, + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/phpunit.xml b/phpunit.xml index e5ddedb..5caff29 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,6 @@ - - - - ./src - + + @@ -16,4 +13,9 @@ + + + ./src + + diff --git a/src/Controller/Memcookie.php b/src/Controller/Memcookie.php index fe2cfee..c80bff1 100644 --- a/src/Controller/Memcookie.php +++ b/src/Controller/Memcookie.php @@ -12,7 +12,6 @@ use SimpleSAML\Session; use SimpleSAML\Utils; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; /** * Controller class for the memcookie module. diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index 577d46b..0bb9ff6 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -7,7 +7,6 @@ use PHPUnit\Framework\TestCase; use SimpleSAML\Auth; use SimpleSAML\Configuration; -use SimpleSAML\Error; use SimpleSAML\HTTP\RunnableResponse; use SimpleSAML\Module\memcookie\Controller; use SimpleSAML\Session; From 65e62471b8e06eed743f630d0b96a7d9450dd0bc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Jan 2024 00:07:14 +0100 Subject: [PATCH 063/113] Bump download-artifact action --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index df3b7c5..fd94c1f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -291,6 +291,6 @@ jobs: (needs.unit-tests-linux == 'success' && needs.coverage == 'skipped') steps: - - uses: geekyeggo/delete-artifact@v2 + - uses: geekyeggo/delete-artifact@v4 with: name: coverage-data From 2c0371858c38d303243e3913c5f3dfb1f2463b29 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Jan 2024 18:26:35 +0100 Subject: [PATCH 064/113] Bump upload-artifact action --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index fd94c1f..82da739 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -206,7 +206,7 @@ jobs: - name: Save coverage data if: ${{ matrix.php-versions == '8.3' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-data path: ${{ github.workspace }}/build From f51937a6a88a14d06c943323c8b46f0fe3f52ed9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Jan 2024 20:09:08 +0100 Subject: [PATCH 065/113] Bump codespell action --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 507ccff..c46ffcc 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -27,7 +27,7 @@ jobs: ignore_path: .markdownlintignore - name: Perform spell check - uses: codespell-project/actions-codespell@master + uses: codespell-project/actions-codespell@v2 with: path: '**/*.md' check_filenames: true From c88db5096b2b06a4bd9736f80445994d74466e04 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Jan 2024 20:30:52 +0100 Subject: [PATCH 066/113] Bump lock-threads action --- .github/workflows/autolock-conversations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autolock-conversations.yml b/.github/workflows/autolock-conversations.yml index 5d66869..3c7be52 100644 --- a/.github/workflows/autolock-conversations.yml +++ b/.github/workflows/autolock-conversations.yml @@ -18,7 +18,7 @@ jobs: action: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v4 + - uses: dessant/lock-threads@v5 with: issue-inactive-days: '90' pr-inactive-days: '90' From 9007966596db3ca8dc0f56a018c147ef0199f8de Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Jan 2024 21:28:30 +0100 Subject: [PATCH 067/113] Bump github-script action --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c46ffcc..cfc066d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Run docs build if: github.event_name != 'pull_request' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: # Token has to be generated on a user account that controls the docs-repository. # The _only_ scope to select is "Access public repositories", nothing more. From 0b2aa50deaa17a91057f13cbc8f5bd1080d33260 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 19 Jan 2024 23:38:29 +0100 Subject: [PATCH 068/113] Create dependabot.yml --- .github/dependabot.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c293f08 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +--- + +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + groups: + all-actions: + patterns: ["*"] + + - package-ecosystem: "compposer" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + groups: + dev-dependencies: + dependency-type: "development" + update-types: + - "minor" + - "patch" From 87278671f58ea7136a81739d36632768fa82af81 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 14 Feb 2024 22:19:00 +0100 Subject: [PATCH 069/113] Fix typo --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c293f08..0013236 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,7 +15,7 @@ updates: all-actions: patterns: ["*"] - - package-ecosystem: "compposer" # See documentation for possible values + - package-ecosystem: "composer" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "daily" From 7712847d587b7507b8ce568e24fbe5539a3a0696 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:23:25 +0000 Subject: [PATCH 070/113] Bump the all-actions group with 3 updates Bumps the all-actions group with 3 updates: [actions/cache](https://github.com/actions/cache), [actions/download-artifact](https://github.com/actions/download-artifact) and [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `actions/cache` from 3 to 4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) Updates `actions/download-artifact` from 3 to 4 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) Updates `codecov/codecov-action` from 3 to 4 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 82da739..cecd8e1 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -63,7 +63,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -130,7 +130,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -187,7 +187,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -250,7 +250,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -269,13 +269,13 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: coverage-data path: ${{ github.workspace }}/build - name: Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true From 14da7772d8520bca28e2a26c5cfc323b82b268c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:28:30 +0000 Subject: [PATCH 071/113] Bump the all-actions group with 1 update Bumps the all-actions group with 1 update: [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact). Updates `geekyeggo/delete-artifact` from 4 to 5 - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cecd8e1..a4a4039 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -291,6 +291,6 @@ jobs: (needs.unit-tests-linux == 'success' && needs.coverage == 'skipped') steps: - - uses: geekyeggo/delete-artifact@v4 + - uses: geekyeggo/delete-artifact@v5 with: name: coverage-data From 754b22e16f6ddb5db85f021e65b532a05f9e2c40 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 25 Mar 2024 22:06:05 +0100 Subject: [PATCH 072/113] Upgrade superlinter --- .github/workflows/php.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a4a4039..d44d465 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -24,11 +24,12 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: github/super-linter/slim@v5 + uses: super-linter/super-linter/slim@v6 env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LINTER_RULES_PATH: 'tools/linters' LOG_LEVEL: NOTICE VALIDATE_ALL_CODEBASE: true - LINTER_RULES_PATH: 'tools/linters' VALIDATE_CSS: true VALIDATE_JAVASCRIPT_ES: true VALIDATE_JSON: true From ecea7bde27b32c2f5ebe532e57527279a447e489 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 19 May 2024 21:31:40 +0200 Subject: [PATCH 073/113] Initialize http utils --- src/Controller/Memcookie.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controller/Memcookie.php b/src/Controller/Memcookie.php index c80bff1..55ab3dc 100644 --- a/src/Controller/Memcookie.php +++ b/src/Controller/Memcookie.php @@ -56,6 +56,7 @@ public function __construct( ) { $this->config = $config; $this->session = $session; + $this->http_utils = new Utils\HTTP(); } From 3d44650256858f5d099e2ec85391432bbc2086ea Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 14 Jun 2024 22:03:19 +0200 Subject: [PATCH 074/113] Fix cleanup-job --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d44d465..31464ac 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -289,7 +289,7 @@ jobs: if: | always() && needs.coverage.result == 'success' || - (needs.unit-tests-linux == 'success' && needs.coverage == 'skipped') + (needs.unit-tests-linux.result == 'success' && needs.coverage.result == 'skipped') steps: - uses: geekyeggo/delete-artifact@v5 From d459b20f7f6f520b050bff55517af3ca92a3ff5d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 20 Jun 2024 13:21:38 +0200 Subject: [PATCH 075/113] Rename config-directory --- {config => config-templates}/module_authmemcookie.php.dist | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {config => config-templates}/module_authmemcookie.php.dist (100%) diff --git a/config/module_authmemcookie.php.dist b/config-templates/module_authmemcookie.php.dist similarity index 100% rename from config/module_authmemcookie.php.dist rename to config-templates/module_authmemcookie.php.dist From 16c6833d36a71d1aa3781e89e50f671fc3412160 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 9 Jul 2024 19:24:55 +0200 Subject: [PATCH 076/113] Fix composer dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index bee845c..e43748a 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,12 @@ "php": "^8.1", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": "^1.3", - "simplesamlphp/simplesamlphp": "^2.1", - "symfony/http-foundation": "^6.4" + "simplesamlphp/composer-module-installer": "^1.3.0", + "simplesamlphp/simplesamlphp": "^2.1.0", + "symfony/http-foundation": "^6.4.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.5" + "simplesamlphp/simplesamlphp-test-framework": "^1.5.0" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From 3fd75d60ee24131013e3574a171749a47e4a8d0d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 15 Jul 2024 23:49:33 +0200 Subject: [PATCH 077/113] dependabot: second attempt to exclude major updates --- .github/dependabot.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0013236..ee89027 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -18,10 +18,20 @@ updates: - package-ecosystem: "composer" # See documentation for possible values directory: "/" # Location of package manifests schedule: - interval: "daily" + interval: "weekly" + allow: + # Allow both direct and indirect updates for all packages + - dependency-type: "all" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] groups: - dev-dependencies: + production-dependencies: + dependency-type: "production" + exclude-patterns: + - "symfony/*" + development-dependencies: dependency-type: "development" - update-types: - - "minor" - - "patch" + symfony: + patterns: + - "symfony/*" From 382d0768bb27de2731ec361a67358041fae63bbb Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 4 Aug 2024 22:31:21 +0200 Subject: [PATCH 078/113] Allow phpstan/extension-installer plugin --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e43748a..f709356 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ "allow-plugins": { "composer/package-versions-deprecated": true, "simplesamlphp/composer-module-installer": true, - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true } } } From a61d920e90d19a7ab42169cfdf9af9d2c78b808a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 4 Aug 2024 22:37:57 +0200 Subject: [PATCH 079/113] Fix phpcs config --- phpcs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml b/phpcs.xml index 93df8ab..5d9f4ab 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,7 +4,7 @@ By default it is less stringent about long lines than other coding standards - config + config-templates src tests From e71c963d52e5f3af769e93887bfbf34a2bc55d05 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 4 Aug 2024 22:39:15 +0200 Subject: [PATCH 080/113] Add trailing commas --- src/AuthMemCookie.php | 2 +- src/Controller/Memcookie.php | 6 +++--- tests/src/Controller/MemcookieTest.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/AuthMemCookie.php b/src/AuthMemCookie.php index 54390ca..c38e94f 100644 --- a/src/AuthMemCookie.php +++ b/src/AuthMemCookie.php @@ -75,7 +75,7 @@ public function getCookieName(): string $cookieName = $this->config->getOptionalString('cookiename', 'AuthMemCookie'); if (!is_string($cookieName) || strlen($cookieName) === 0) { throw new Exception( - "Configuration option 'cookiename' contains an invalid value. This option should be a string." + "Configuration option 'cookiename' contains an invalid value. This option should be a string.", ); } diff --git a/src/Controller/Memcookie.php b/src/Controller/Memcookie.php index 55ab3dc..0fc2ba4 100644 --- a/src/Controller/Memcookie.php +++ b/src/Controller/Memcookie.php @@ -52,7 +52,7 @@ class Memcookie */ public function __construct( Configuration $config, - Session $session + Session $session, ) { $this->config = $config; $this->session = $session; @@ -125,7 +125,7 @@ public function main(Request $request): RunnableResponse if ($usernameAttr === null || !array_key_exists($usernameAttr, $attributes)) { throw new Error\Exception( "The user doesn't have an attribute named '" . $usernameAttr . - "'. This attribute is expected to contain the username." + "'. This attribute is expected to contain the username.", ); } $authData['UserName'] = $attributes[$usernameAttr]; @@ -136,7 +136,7 @@ public function main(Request $request): RunnableResponse if (!array_key_exists($groupsAttr, $attributes)) { throw new Error\Exception( "The user doesn't have an attribute named '" . $groupsAttr . - "'. This attribute is expected to contain the groups the user is a member of." + "'. This attribute is expected to contain the groups the user is a member of.", ); } $authData['Groups'] = $attributes[$groupsAttr]; diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index 0bb9ff6..8713095 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -49,7 +49,7 @@ protected function setUp(): void 'module.enable' => ['memcookie' => true], ], '[ARRAY]', - 'simplesaml' + 'simplesaml', ); $session = $this->createMock(Session::class); @@ -63,7 +63,7 @@ protected function setUp(): void 'default-sp' => ['saml:SP'], ], '[ARRAY]', - 'simplesaml' + 'simplesaml', ); Configuration::setPreLoadedConfig($this->authsources, 'authsources.php', 'simplesaml'); @@ -89,7 +89,7 @@ public function redirectTrustedURL(string $url, array $parameters = []): void 'memcache.port' => 11211, ], '[ARRAY]', - 'simplesaml' + 'simplesaml', ); Configuration::setPreLoadedConfig($this->module_config, 'module_authmemcookie.php', 'simplesaml'); } @@ -115,7 +115,7 @@ public function testMemcookie(): void $request = Request::create( '/module.php/memcookie/', 'GET', - [] + [], ); $c = new Controller\Memcookie($this->config, $this->session); From 4c7d8fd6dbb48a7d93d5b49500800209a106a978 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 4 Aug 2024 22:48:36 +0200 Subject: [PATCH 081/113] Fix Psalm-config --- psalm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 955b74d..0a923ab 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,7 +6,7 @@ reportMixedIssues="false" > - + From f33e5e4000ee838476f6f4d58681c452646752a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:24:33 +0000 Subject: [PATCH 082/113] Bump super-linter/super-linter from 6 to 7 in the all-actions group Bumps the all-actions group with 1 update: [super-linter/super-linter](https://github.com/super-linter/super-linter). Updates `super-linter/super-linter` from 6 to 7 - [Release notes](https://github.com/super-linter/super-linter/releases) - [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/super-linter/super-linter/compare/v6...v7) --- updated-dependencies: - dependency-name: super-linter/super-linter dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 31464ac..2b8c387 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter/slim@v6 + uses: super-linter/super-linter/slim@v7 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: 'tools/linters' From c6e0fba3f863db2fb8d1d8d9e1cd630530db4c94 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 19 Aug 2024 22:59:00 +0200 Subject: [PATCH 083/113] Stop super-linter from writing logfiles --- .github/workflows/php.yml | 1 + .gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2b8c387..8bb8916 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -26,6 +26,7 @@ jobs: - name: Lint Code Base uses: super-linter/super-linter/slim@v7 env: + SAVE_SUPER_LINTER_OUTPUT: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: 'tools/linters' LOG_LEVEL: NOTICE diff --git a/.gitignore b/.gitignore index 9e12716..0fa63d4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ composer.lock composer.phar phpunit.xml.bak +/super-linter-output/ /vendor/ # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control From a4d2974b532c315381252a6185740fb47d3e401d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 21 Aug 2024 21:28:05 +0200 Subject: [PATCH 084/113] Fix badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d640088..205f46a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SimpleSAMLphp AuthMemCookie module -![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/workflows/CI/badge.svg?branch=master) +![Build Status](https://github.com/simplesamlphp/simplesamlphp-module-memcookie/actions/workflows/php.yml/badge.svg) [![Coverage Status](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/simplesamlphp-module-memcookie) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/simplesamlphp/simplesamlphp-module-memcookie/?branch=master) [![Type Coverage](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie/coverage.svg)](https://shepherd.dev/github/simplesamlphp/simplesamlphp-module-memcookie) From 8312e22ed95755a3eb6c5543403f1a2227f2ee58 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 18 Nov 2024 17:39:26 +0100 Subject: [PATCH 085/113] Allow composer-xmlprovider-installer extension --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f709356..32b19e6 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,8 @@ "composer/package-versions-deprecated": true, "simplesamlphp/composer-module-installer": true, "dealerdirect/phpcodesniffer-composer-installer": true, - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "simplesamlphp/composer-xmlprovider-installer": true } } } From 0aab4be35f6457a0e48f9043075b677c0abe9750 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:40:33 +0000 Subject: [PATCH 086/113] Bump codecov/codecov-action from 4 to 5 in the all-actions group Bumps the all-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 4 to 5 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8bb8916..f75a7c2 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -277,7 +277,7 @@ jobs: path: ${{ github.workspace }}/build - name: Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true From c6b1d279034c2f71a0042ffedcfde951ef46aa98 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 27 May 2025 22:26:41 +0200 Subject: [PATCH 087/113] Replace super-linter with a reusable workflow --- .github/workflows/php.yml | 266 +++++++++--------- composer.json | 6 +- .../module_authmemcookie.php.dist | 0 phpcs.xml | 2 +- psalm-dev.xml | 9 - psalm.xml | 2 +- routing/routes/routes.yml | 10 +- tests/src/Controller/MemcookieTest.php | 5 +- tools/linters/.yaml-lint.yml | 7 + 9 files changed, 153 insertions(+), 154 deletions(-) rename {config-templates => config}/module_authmemcookie.php.dist (100%) create mode 100644 tools/linters/.yaml-lint.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f75a7c2..260dddd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,30 +14,142 @@ on: # yamllint disable-line rule:truthy workflow_dispatch: jobs: + phplinter: + name: 'PHP-Linter' + strategy: + fail-fast: false + matrix: + php-version: ['8.1', '8.2', '8.3', '8.4'] + + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.2 + with: + php-version: ${{ matrix.php-version }} + linter: - name: Linter - runs-on: ['ubuntu-latest'] + name: 'Linter' + strategy: + fail-fast: false + + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.9.2 + with: + enable_eslinter: false + enable_jsonlinter: true + enable_stylelinter: false + enable_yamllinter: true + + unit-tests-linux: + name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" + runs-on: ${{ matrix.operating-system }} + needs: [phplinter, linter] + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.1', '8.2', '8.3', '8.4'] steps: + - name: Setup PHP, with composer and extensions + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ + memcached, openssl, pcre, posix, spl, xml + tools: composer + ini-values: error_reporting=E_ALL + coverage: pcov + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@v4 + + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" + + - name: Cache composer dependencies + uses: actions/cache@v4 with: - fetch-depth: 0 - - - name: Lint Code Base - uses: super-linter/super-linter/slim@v7 - env: - SAVE_SUPER_LINTER_OUTPUT: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LINTER_RULES_PATH: 'tools/linters' - LOG_LEVEL: NOTICE - VALIDATE_ALL_CODEBASE: true - VALIDATE_CSS: true - VALIDATE_JAVASCRIPT_ES: true - VALIDATE_JSON: true - VALIDATE_PHP_BUILTIN: true - VALIDATE_YAML: true - VALIDATE_XML: true - VALIDATE_GITHUB_ACTIONS: true + path: $COMPOSER_CACHE + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Run unit tests with coverage + if: ${{ matrix.php-versions == '8.4' }} + run: vendor/bin/phpunit + + - name: Run unit tests (no coverage) + if: ${{ matrix.php-versions != '8.4' }} + run: vendor/bin/phpunit --no-coverage + + - name: Save coverage data + if: ${{ matrix.php-versions == '8.4' }} + uses: actions/upload-artifact@v4 + with: + name: coverage-data + path: ${{ github.workspace }}/build + + unit-tests-windows: + name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" + runs-on: ${{ matrix.operating-system }} + needs: [phplinter, linter] + strategy: + fail-fast: true + matrix: + operating-system: [windows-latest] + php-versions: ['8.1', '8.2', '8.3', '8.4'] + + steps: + - name: Setup PHP, with composer and extensions + # https://github.com/shivammathur/setup-php + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached-3.3.0, \ + openssl, pcre, posix, spl, xml + tools: composer + ini-values: error_reporting=E_ALL + coverage: none + + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v4 + + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" + + - name: Cache composer dependencies + uses: actions/cache@v4 + with: + path: $COMPOSER_CACHE + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req=ext-posix + + - name: Run unit tests + run: vendor/bin/phpunit --no-coverage quality: name: Quality control @@ -50,7 +162,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the higest supported version, so we can use the newest tools - php-version: '8.3' + php-version: '8.4' tools: composer, composer-require-checker, composer-unused, phpcs, psalm # optional performance gain for psalm: opcache extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ @@ -150,120 +262,6 @@ jobs: - name: Security check for updated dependencies run: composer audit - unit-tests-linux: - name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" - runs-on: ${{ matrix.operating-system }} - needs: [linter, quality, security] - strategy: - fail-fast: false - matrix: - operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3'] - - steps: - - name: Setup PHP, with composer and extensions - # https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ - memcached, openssl, pcre, posix, spl, xml - tools: composer - ini-values: error_reporting=E_ALL - coverage: pcov - - - name: Setup problem matchers for PHP - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: actions/checkout@v4 - - - name: Get composer cache directory - run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - - - name: Cache composer dependencies - uses: actions/cache@v4 - with: - path: $COMPOSER_CACHE - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Run unit tests with coverage - if: ${{ matrix.php-versions == '8.3' }} - run: vendor/bin/phpunit - - - name: Run unit tests (no coverage) - if: ${{ matrix.php-versions != '8.3' }} - run: vendor/bin/phpunit --no-coverage - - - name: Save coverage data - if: ${{ matrix.php-versions == '8.3' }} - uses: actions/upload-artifact@v4 - with: - name: coverage-data - path: ${{ github.workspace }}/build - - unit-tests-windows: - name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}" - runs-on: ${{ matrix.operating-system }} - needs: [linter, quality, security] - strategy: - fail-fast: true - matrix: - operating-system: [windows-latest] - php-versions: ['8.1'] - #php-versions: ['8.1', '8.2', '8.3'] Waiting for memcached-3.2.1 - - steps: - - name: Setup PHP, with composer and extensions - # https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached-3.2.0, openssl, pcre, posix, spl, xml - tools: composer - ini-values: error_reporting=E_ALL - coverage: none - - - name: Setup problem matchers for PHP - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: actions/checkout@v4 - - - name: Get composer cache directory - run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" - - - name: Cache composer dependencies - uses: actions/cache@v4 - with: - path: $COMPOSER_CACHE - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-req=ext-posix - - - name: Run unit tests - run: vendor/bin/phpunit --no-coverage - coverage: name: Code coverage runs-on: [ubuntu-latest] diff --git a/composer.json b/composer.json index 32b19e6..a46064c 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,12 @@ "php": "^8.1", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": "^1.3.0", - "simplesamlphp/simplesamlphp": "^2.1.0", + "simplesamlphp/composer-module-installer": "^1.4.0", + "simplesamlphp/simplesamlphp": "^2.4.0", "symfony/http-foundation": "^6.4.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.5.0" + "simplesamlphp/simplesamlphp-test-framework": "^1.9.2" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", diff --git a/config-templates/module_authmemcookie.php.dist b/config/module_authmemcookie.php.dist similarity index 100% rename from config-templates/module_authmemcookie.php.dist rename to config/module_authmemcookie.php.dist diff --git a/phpcs.xml b/phpcs.xml index 5d9f4ab..93df8ab 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,7 +4,7 @@ By default it is less stringent about long lines than other coding standards - config-templates + config src tests diff --git a/psalm-dev.xml b/psalm-dev.xml index 960d692..078f21a 100644 --- a/psalm-dev.xml +++ b/psalm-dev.xml @@ -16,15 +16,6 @@ - - - - - - - - - diff --git a/psalm.xml b/psalm.xml index 0a923ab..955b74d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,7 +6,7 @@ reportMixedIssues="false" > - + diff --git a/routing/routes/routes.yml b/routing/routes/routes.yml index 2a51241..a61186b 100644 --- a/routing/routes/routes.yml +++ b/routing/routes/routes.yml @@ -1,4 +1,8 @@ +--- + memcookie-main: - path: / - defaults: { _controller: 'SimpleSAML\Module\memcookie\Controller\Memcookie::main' } - methods: [GET] + path: / + defaults: { + _controller: 'SimpleSAML\Module\memcookie\Controller\Memcookie::main' + } + methods: [GET] diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index 8713095..047e084 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -18,7 +18,7 @@ * * @package SimpleSAML\Test */ -class MemcookieTest extends TestCase +final class MemcookieTest extends TestCase { /** @var \SimpleSAML\Configuration */ protected Configuration $authsources; @@ -68,7 +68,7 @@ protected function setUp(): void Configuration::setPreLoadedConfig($this->authsources, 'authsources.php', 'simplesaml'); $this->http_utils = new class () extends Utils\HTTP { - public function setCookie(string $name, ?string $value, array $params = null, bool $throw = true): void + public function setCookie(string $name, ?string $value, ?array $params = null, bool $throw = true): void { // stub } @@ -132,7 +132,6 @@ public function getAttributes(): array } }); - /** @var \SimpleSAML\HTTP\RunnableResponse $response */ $response = $c->main($request); $this->assertInstanceOf(RunnableResponse::class, $response); diff --git a/tools/linters/.yaml-lint.yml b/tools/linters/.yaml-lint.yml new file mode 100644 index 0000000..630095a --- /dev/null +++ b/tools/linters/.yaml-lint.yml @@ -0,0 +1,7 @@ +--- + +extends: default + +rules: + line-length: + max: 120 From 87f59d995efc353f8a9e3877e0fc8ae55f3511d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:04:08 +0000 Subject: [PATCH 088/113] Bump simplesamlphp/simplesamlphp-test-framework in the all-actions group Bumps the all-actions group with 1 update: [simplesamlphp/simplesamlphp-test-framework](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework` from 1.9.2 to 1.9.3 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.9.2...v1.9.3) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework dependency-version: 1.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 260dddd..818f34c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.2 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.3 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.9.2 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.9.3 with: enable_eslinter: false enable_jsonlinter: true From fded358eda30e547d5dda1b44cf3ffbd2a23e828 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:05:05 +0000 Subject: [PATCH 089/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/download-artifact` from 4 to 5 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/documentation.yml | 2 +- .github/workflows/php.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index cfc066d..3ff53ea 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Lint markdown files uses: nosborn/github-action-markdown-cli@v3 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 818f34c..fbe053e 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -70,7 +70,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -133,7 +133,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" @@ -171,7 +171,7 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -238,7 +238,7 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -267,9 +267,9 @@ jobs: runs-on: [ubuntu-latest] needs: [unit-tests-linux] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: name: coverage-data path: ${{ github.workspace }}/build From 7ff4e7faff9e4e4b6c9081bcffef62d815307fc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 08:08:26 +0000 Subject: [PATCH 090/113] Bump simplesamlphp/simplesamlphp-test-framework in the all-actions group Bumps the all-actions group with 1 update: [simplesamlphp/simplesamlphp-test-framework](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework` from 1.9.3 to 1.10.0 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.9.3...v1.10.0) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index fbe053e..e5333ec 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.9.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.0 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.9.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.0 with: enable_eslinter: false enable_jsonlinter: true From d88a9ad05f53a00af66935a7911e05eb2cd702d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:24:28 +0000 Subject: [PATCH 091/113] Bump actions/github-script from 7 to 8 in the all-actions group Bumps the all-actions group with 1 update: [actions/github-script](https://github.com/actions/github-script). Updates `actions/github-script` from 7 to 8 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3ff53ea..8fbac93 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Run docs build if: github.event_name != 'pull_request' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: # Token has to be generated on a user account that controls the docs-repository. # The _only_ scope to select is "Access public repositories", nothing more. From c1c5657b7f9229fd36f5282ef8531a8806cabe9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 15:10:28 +0000 Subject: [PATCH 092/113] Bump simplesamlphp/simplesamlphp-test-framework in the all-actions group Bumps the all-actions group with 1 update: [simplesamlphp/simplesamlphp-test-framework](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework` from 1.10.0 to 1.10.2 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.0...v1.10.2) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework dependency-version: 1.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e5333ec..5aeee9d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.2 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.10.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.2 with: enable_eslinter: false enable_jsonlinter: true From 61cdd92ec1064e6d3bcc2a805b6513cc76c48a49 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 21 Oct 2025 18:59:10 +0200 Subject: [PATCH 093/113] Install zip-extension for Windows-build --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e5333ec..a7d47db 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -117,7 +117,7 @@ jobs: with: php-version: ${{ matrix.php-versions }} extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached-3.3.0, \ - openssl, pcre, posix, spl, xml + openssl, pcre, posix, spl, xml, zip tools: composer ini-values: error_reporting=E_ALL coverage: none From 15d762cef39ecbf91ac09e93fce5d82497862b84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:08:27 +0000 Subject: [PATCH 094/113] Bump the all-actions group with 3 updates Bumps the all-actions group with 3 updates: [simplesamlphp/simplesamlphp-test-framework](https://github.com/simplesamlphp/simplesamlphp-test-framework), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `simplesamlphp/simplesamlphp-test-framework` from 1.10.2 to 1.10.3 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.2...v1.10.3) Updates `actions/upload-artifact` from 4 to 5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) Updates `actions/download-artifact` from 5 to 6 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework dependency-version: 1.10.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f4fb8aa..e9a6dbc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.2 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.3 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.10.2 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.3 with: enable_eslinter: false enable_jsonlinter: true @@ -95,7 +95,7 @@ jobs: - name: Save coverage data if: ${{ matrix.php-versions == '8.4' }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: coverage-data path: ${{ github.workspace }}/build @@ -269,7 +269,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v6 with: name: coverage-data path: ${{ github.workspace }}/build From 57a7eee958b1c99fc4c43eceb46701c8e7124c7a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 28 Oct 2025 20:37:37 +0100 Subject: [PATCH 095/113] Bump minimum PHP version to 8.2 and start testing on PHP 8.5 --- .github/workflows/php.yml | 16 ++++++++-------- composer.json | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e9a6dbc..46d96a3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ['8.2', '8.3', '8.4', '8.5'] uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.3 with: @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -86,15 +86,15 @@ jobs: run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Run unit tests with coverage - if: ${{ matrix.php-versions == '8.4' }} + if: ${{ matrix.php-versions == '8.5' }} run: vendor/bin/phpunit - name: Run unit tests (no coverage) - if: ${{ matrix.php-versions != '8.4' }} + if: ${{ matrix.php-versions != '8.5' }} run: vendor/bin/phpunit --no-coverage - name: Save coverage data - if: ${{ matrix.php-versions == '8.4' }} + if: ${{ matrix.php-versions == '8.5' }} uses: actions/upload-artifact@v5 with: name: coverage-data @@ -108,7 +108,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -162,7 +162,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the higest supported version, so we can use the newest tools - php-version: '8.4' + php-version: '8.5' tools: composer, composer-require-checker, composer-unused, phpcs, psalm # optional performance gain for psalm: opcache extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ @@ -229,7 +229,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.1' + php-version: '8.2' extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ memcached, openssl, pcre, posix, spl, xml tools: composer diff --git a/composer.json b/composer.json index a46064c..d0ccba1 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,15 @@ } }, "require": { - "php": "^8.1", + "php": "^8.2", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": "^1.4.0", + "simplesamlphp/composer-module-installer": "^1.2.0", "simplesamlphp/simplesamlphp": "^2.4.0", "symfony/http-foundation": "^6.4.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.9.2" + "simplesamlphp/simplesamlphp-test-framework": "^1.10.3" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From 14e014d9b2ee644fd1b251e8d0458a85ba109999 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 28 Oct 2025 20:37:51 +0100 Subject: [PATCH 096/113] Use local phpcs-version --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 46d96a3..9355f25 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -163,7 +163,7 @@ jobs: with: # Should be the higest supported version, so we can use the newest tools php-version: '8.5' - tools: composer, composer-require-checker, composer-unused, phpcs, psalm + tools: composer, composer-require-checker, composer-unused, psalm # optional performance gain for psalm: opcache extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ memcached, opcache, openssl, pcre, posix, spl, xml @@ -196,7 +196,7 @@ jobs: run: composer-unused - name: PHP Code Sniffer - run: phpcs + run: vendor/bin/phpcs - name: Psalm continue-on-error: true From 35e8eb2ab4ae320f5b73f79eb84f7cd697bfac11 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 28 Oct 2025 20:56:42 +0100 Subject: [PATCH 097/113] Replace Psalm with PHPStan --- .gitattributes | 6 +++-- .github/workflows/php.yml | 27 +++++----------------- phpstan-dev.neon | 4 ++++ phpstan.neon | 4 ++++ psalm-dev.xml | 23 ------------------- psalm.xml | 31 -------------------------- src/AuthMemCookie.php | 4 +++- src/Controller/Memcookie.php | 2 ++ tests/src/Controller/MemcookieTest.php | 9 ++++++-- 9 files changed, 30 insertions(+), 80 deletions(-) create mode 100644 phpstan-dev.neon create mode 100644 phpstan.neon delete mode 100644 psalm-dev.xml delete mode 100644 psalm.xml diff --git a/.gitattributes b/.gitattributes index 3b911a4..77eb073 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,8 +5,10 @@ codecov.yml export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -psalm.xml export-ignore -psalm-dev.xml export-ignore +phpstan.neon export-ignore +phpstan-dev.neon export-ignore +phpstan-baseline.neon export-ignore +phpstan-baseline-dev.neon export-ignore phpcs.xml export-ignore phpunit.xml export-ignore .php_cs.dist export-ignore diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9355f25..4d98e98 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -163,10 +163,9 @@ jobs: with: # Should be the higest supported version, so we can use the newest tools php-version: '8.5' - tools: composer, composer-require-checker, composer-unused, psalm - # optional performance gain for psalm: opcache + tools: composer, composer-require-checker, composer-unused extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ - memcached, opcache, openssl, pcre, posix, spl, xml + memcached, openssl, pcre, posix, spl, xml - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -198,27 +197,13 @@ jobs: - name: PHP Code Sniffer run: vendor/bin/phpcs - - name: Psalm - continue-on-error: true - run: | - psalm -c psalm.xml \ - --show-info=true \ - --shepherd \ - --php-version=${{ steps.setup-php.outputs.php-version }} - - - name: Psalm (testsuite) + - name: PHPStan run: | - psalm -c psalm-dev.xml \ - --show-info=true \ - --shepherd \ - --php-version=${{ steps.setup-php.outputs.php-version }} + vendor/bin/phpstan analyze -c phpstan.neon --debug - - name: Psalter + - name: PHPStan (testsuite) run: | - psalm --alter \ - --issues=UnnecessaryVarAnnotation \ - --dry-run \ - --php-version=${{ steps.setup-php.outputs.php-version }} + vendor/bin/phpstan analyze -c phpstan-dev.neon --debug security: name: Security checks diff --git a/phpstan-dev.neon b/phpstan-dev.neon new file mode 100644 index 0000000..4d29b8b --- /dev/null +++ b/phpstan-dev.neon @@ -0,0 +1,4 @@ +parameters: + level: 9 + paths: + - tests diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..a7c64bd --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: 8 + paths: + - src diff --git a/psalm-dev.xml b/psalm-dev.xml deleted file mode 100644 index 078f21a..0000000 --- a/psalm-dev.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 955b74d..0000000 --- a/psalm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AuthMemCookie.php b/src/AuthMemCookie.php index c38e94f..467bdb9 100644 --- a/src/AuthMemCookie.php +++ b/src/AuthMemCookie.php @@ -9,6 +9,8 @@ use SimpleSAML\Configuration; use SimpleSAML\Utils; +use function strlen; + /** * This is a helper class for the Auth MemCookie module. * It handles the configuration, and implements the logout handler. @@ -73,7 +75,7 @@ public function getAuthSource(): string public function getCookieName(): string { $cookieName = $this->config->getOptionalString('cookiename', 'AuthMemCookie'); - if (!is_string($cookieName) || strlen($cookieName) === 0) { + if (strlen($cookieName) === 0) { throw new Exception( "Configuration option 'cookiename' contains an invalid value. This option should be a string.", ); diff --git a/src/Controller/Memcookie.php b/src/Controller/Memcookie.php index 0fc2ba4..6a05cec 100644 --- a/src/Controller/Memcookie.php +++ b/src/Controller/Memcookie.php @@ -104,6 +104,8 @@ public function main(Request $request): RunnableResponse $sourceId = $amc_cf->getAuthSource(); $simple = $this->auth_simple; + + /** @var \SimpleSAML\Auth\Simple $s */ $s = new $simple($sourceId); // check if the user is authorized. We attempt to authenticate the user if not diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index 047e084..a795909 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -27,7 +27,7 @@ final class MemcookieTest extends TestCase protected Configuration $config; /** @var \SimpleSAML\Utils\HTTP */ - protected Utils\Http $http_utils; + protected Utils\HTTP $http_utils; /** @var \SimpleSAML\Configuration */ protected Configuration $module_config; @@ -54,7 +54,6 @@ protected function setUp(): void $session = $this->createMock(Session::class); $session->method('getData')->willReturn(['default-sp' => []]); - /** @var \SimpleSAML\Session $session */ $this->session = $session; @@ -68,11 +67,14 @@ protected function setUp(): void Configuration::setPreLoadedConfig($this->authsources, 'authsources.php', 'simplesaml'); $this->http_utils = new class () extends Utils\HTTP { + /** @param array $params */ public function setCookie(string $name, ?string $value, ?array $params = null, bool $throw = true): void { // stub } + + /** @param array $parameters */ public function redirectTrustedURL(string $url, array $parameters = []): void { // stub @@ -121,11 +123,14 @@ public function testMemcookie(): void $c = new Controller\Memcookie($this->config, $this->session); $c->setHttpUtils($this->http_utils); $c->setAuthSimple(new class ('admin') extends Auth\Simple { + /** @param array $params */ public function requireAuth(array $params = []): void { // stub } + + /** @return array */ public function getAttributes(): array { return ['uid' => ['dduck']]; From adb0ca21a881d8b8adcfcb64bf418eb7ba258c9a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 28 Oct 2025 20:57:59 +0100 Subject: [PATCH 098/113] Adopt SSP coding-style --- src/AuthMemCookie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AuthMemCookie.php b/src/AuthMemCookie.php index 467bdb9..593ec0f 100644 --- a/src/AuthMemCookie.php +++ b/src/AuthMemCookie.php @@ -20,7 +20,7 @@ class AuthMemCookie { /** - * @var AuthMemCookie|null This is the singleton instance of this class. + * @var \SimpleSAML\Module\memcookie\AuthMemCookie|null This is the singleton instance of this class. */ private static ?AuthMemCookie $instance = null; From c0fe163dbacbfa0a25c275c907a3961b87dfbcc5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 28 Oct 2025 21:06:25 +0100 Subject: [PATCH 099/113] Bump pecl memcached for windows build --- .github/workflows/php.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4d98e98..a04bfe2 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -116,8 +116,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached-3.3.0, \ - openssl, pcre, posix, spl, xml, zip + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached, openssl, pcre, spl, xml, zip tools: composer ini-values: error_reporting=E_ALL coverage: none From 32fd559a6b4dc732e44674f44f3e07d4cc4efc2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:30:43 +0000 Subject: [PATCH 100/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.10.3 to 1.10.4 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.3...v1.10.4) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.10.3 to 1.10.4 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.3...v1.10.4) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.10.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.10.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a04bfe2..13f7356 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.4 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.10.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.4 with: enable_eslinter: false enable_jsonlinter: true From 1bc26fdfc41ca32888a9eff7ca9fdb26ae5285c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:53:21 +0000 Subject: [PATCH 101/113] Bump the all-actions group with 3 updates Bumps the all-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.10.4 to 1.10.5 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.4...v1.10.5) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.10.4 to 1.10.5 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.4...v1.10.5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.10.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.10.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/documentation.yml | 2 +- .github/workflows/php.yml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8fbac93..8479227 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Lint markdown files uses: nosborn/github-action-markdown-cli@v3 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 13f7356..04a01b3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.4 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.5 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.10.4 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.5 with: enable_eslinter: false enable_jsonlinter: true @@ -70,7 +70,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -132,7 +132,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" @@ -169,7 +169,7 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -222,7 +222,7 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Get composer cache directory run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" @@ -251,7 +251,7 @@ jobs: runs-on: [ubuntu-latest] needs: [unit-tests-linux] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/download-artifact@v6 with: From 0b9997cdc7d0987d9b9879ff06163b746c850778 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:58:59 +0000 Subject: [PATCH 102/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.10.5 to 1.10.6 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.5...v1.10.6) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.10.5 to 1.10.6 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.5...v1.10.6) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 04a01b3..9787363 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.5 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6 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.10.5 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6 with: enable_eslinter: false enable_jsonlinter: true From adcf8688a7eab806cad59025253bb3d2a229fe98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:10:46 +0000 Subject: [PATCH 103/113] Bump the all-actions group with 4 updates Bumps the all-actions group with 4 updates: [dessant/lock-threads](https://github.com/dessant/lock-threads), [actions/cache](https://github.com/actions/cache), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `dessant/lock-threads` from 5 to 6 - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v5...v6) Updates `actions/cache` from 4 to 5 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) Updates `actions/upload-artifact` from 5 to 6 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) Updates `actions/download-artifact` from 6 to 7 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/autolock-conversations.yml | 2 +- .github/workflows/php.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autolock-conversations.yml b/.github/workflows/autolock-conversations.yml index 3c7be52..66797ba 100644 --- a/.github/workflows/autolock-conversations.yml +++ b/.github/workflows/autolock-conversations.yml @@ -18,7 +18,7 @@ jobs: action: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v5 + - uses: dessant/lock-threads@v6 with: issue-inactive-days: '90' pr-inactive-days: '90' diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9787363..568245a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -76,7 +76,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -95,7 +95,7 @@ jobs: - name: Save coverage data if: ${{ matrix.php-versions == '8.5' }} - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: coverage-data path: ${{ github.workspace }}/build @@ -138,7 +138,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -175,7 +175,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -228,7 +228,7 @@ jobs: run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" - name: Cache composer dependencies - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: $COMPOSER_CACHE key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -253,7 +253,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v7 with: name: coverage-data path: ${{ github.workspace }}/build From 2b07d61a9817bd7fddce3ccb199a93eb1f0df7a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:08:19 +0000 Subject: [PATCH 104/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.10.6 to 1.11.0 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.6...v1.11.0) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.10.6 to 1.11.0 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.6...v1.11.0) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 568245a..8bb005c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0 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.10.6 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0 with: enable_eslinter: false enable_jsonlinter: true From d41489f45d65bcac01fa7aca6f18f939ab1f84e1 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 20 Feb 2026 22:10:10 +0100 Subject: [PATCH 105/113] Fix CI cache --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8bb005c..b6ec0fc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -78,7 +78,7 @@ jobs: - name: Cache composer dependencies uses: actions/cache@v5 with: - path: $COMPOSER_CACHE + path: ${{ env.COMPOSER_CACHE }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -140,7 +140,7 @@ jobs: - name: Cache composer dependencies uses: actions/cache@v5 with: - path: $COMPOSER_CACHE + path: ${{ env.COMPOSER_CACHE }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -177,7 +177,7 @@ jobs: - name: Cache composer dependencies uses: actions/cache@v5 with: - path: $COMPOSER_CACHE + path: ${{ env.COMPOSER_CACHE }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- @@ -230,7 +230,7 @@ jobs: - name: Cache composer dependencies uses: actions/cache@v5 with: - path: $COMPOSER_CACHE + path: ${{ env.COMPOSER_CACHE }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- From 8c6c4812364793d7651167a08fe6f9cd50d66a5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:55:47 +0000 Subject: [PATCH 106/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 6 to 7 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) Updates `actions/download-artifact` from 7 to 8 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b6ec0fc..a4a9455 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -95,7 +95,7 @@ jobs: - name: Save coverage data if: ${{ matrix.php-versions == '8.5' }} - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: coverage-data path: ${{ github.workspace }}/build @@ -253,7 +253,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: actions/download-artifact@v7 + - uses: actions/download-artifact@v8 with: name: coverage-data path: ${{ github.workspace }}/build From 39f8642f09ffe3388ff98390563be5f5f32142a9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 6 Mar 2026 21:21:02 +0100 Subject: [PATCH 107/113] Bump actions & dependencies & PHP minimum version --- .github/workflows/php.yml | 21 +++++++++++---------- composer.json | 10 +++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a4a9455..82fb3f0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,9 +19,9 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2', '8.3', '8.4', '8.5'] + php-version: ['8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.1 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.11.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.1 with: enable_eslinter: false enable_jsonlinter: true @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.2', '8.3', '8.4', '8.5'] + php-versions: ['8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -54,7 +54,7 @@ jobs: with: php-version: ${{ matrix.php-versions }} extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ - memcached, openssl, pcre, posix, spl, xml + memcached, openssl, pcre, posix, sodium, spl, xml tools: composer ini-values: error_reporting=E_ALL coverage: pcov @@ -108,7 +108,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.2', '8.3', '8.4', '8.5'] + php-versions: ['8.3', '8.4', '8.5'] steps: - name: Setup PHP, with composer and extensions @@ -116,7 +116,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached, openssl, pcre, spl, xml, zip + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, + memcached, openssl, pcre, sodium, spl, xml, zip tools: composer ini-values: error_reporting=E_ALL coverage: none @@ -164,7 +165,7 @@ jobs: php-version: '8.5' tools: composer, composer-require-checker, composer-unused extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ - memcached, openssl, pcre, posix, spl, xml + memcached, openssl, pcre, posix, sodium, spl, xml - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -213,9 +214,9 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.2' + php-version: '8.3' extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, \ - memcached, openssl, pcre, posix, spl, xml + memcached, openssl, pcre, posix, sodium, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index d0ccba1..20610ec 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,15 @@ } }, "require": { - "php": "^8.2", + "php": "^8.3", "ext-memcached": "*", - "simplesamlphp/composer-module-installer": "^1.2.0", - "simplesamlphp/simplesamlphp": "^2.4.0", - "symfony/http-foundation": "^6.4.0" + "simplesamlphp/composer-module-installer": "^1.7", + "simplesamlphp/simplesamlphp": "^2.5@dev", + "symfony/http-foundation": "^7.4" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.10.3" + "simplesamlphp/simplesamlphp-test-framework": "^1.11" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp-module-memcookie/issues", From fb457f7bc2b81d10c77f4050c551ac1b8619e220 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 6 Mar 2026 21:24:43 +0100 Subject: [PATCH 108/113] Fix CI --- .github/workflows/php.yml | 4 ++-- tests/src/Controller/MemcookieTest.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 82fb3f0..2244502 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -116,8 +116,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, - memcached, openssl, pcre, sodium, spl, xml, zip + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, memcached,\ + openssl, pcre, sodium, spl, xml, zip tools: composer ini-values: error_reporting=E_ALL coverage: none diff --git a/tests/src/Controller/MemcookieTest.php b/tests/src/Controller/MemcookieTest.php index a795909..56d479c 100644 --- a/tests/src/Controller/MemcookieTest.php +++ b/tests/src/Controller/MemcookieTest.php @@ -7,7 +7,6 @@ use PHPUnit\Framework\TestCase; use SimpleSAML\Auth; use SimpleSAML\Configuration; -use SimpleSAML\HTTP\RunnableResponse; use SimpleSAML\Module\memcookie\Controller; use SimpleSAML\Session; use SimpleSAML\Utils; @@ -139,7 +138,6 @@ public function getAttributes(): array $response = $c->main($request); - $this->assertInstanceOf(RunnableResponse::class, $response); $this->assertTrue($response->isSuccessful()); } } From ee84ec7aa1ce577f744a6df2f54d90ccd83c88ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 15:44:09 +0000 Subject: [PATCH 109/113] Bump the all-actions group with 3 updates Bumps the all-actions group with 3 updates: [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework), [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact). Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.11.1 to 1.11.3 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.11.1...v1.11.3) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.11.1 to 1.11.3 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.11.1...v1.11.3) Updates `geekyeggo/delete-artifact` from 5 to 6 - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.11.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.11.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: geekyeggo/delete-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2244502..9379f4c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.1 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.3 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.11.1 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.3 with: enable_eslinter: false enable_jsonlinter: true @@ -276,6 +276,6 @@ jobs: (needs.unit-tests-linux.result == 'success' && needs.coverage.result == 'skipped') steps: - - uses: geekyeggo/delete-artifact@v5 + - uses: geekyeggo/delete-artifact@v6 with: name: coverage-data From 48bef6e1b431d18c0824f952f9114c85766411c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:43:28 +0000 Subject: [PATCH 110/113] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework) and [simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml` from 1.11.3 to 1.11.5 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.11.3...v1.11.5) Updates `simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml` from 1.11.3 to 1.11.5 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.11.3...v1.11.5) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml dependency-version: 1.11.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml dependency-version: 1.11.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9379f4c..9292d99 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.3', '8.4', '8.5'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.5 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.11.3 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.5 with: enable_eslinter: false enable_jsonlinter: true From 8ec3c82604a5ed60306f58a78000a3bc45265ed5 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 2 Apr 2026 21:36:37 +0200 Subject: [PATCH 111/113] Use composer.json for cache key --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9292d99..42aa002 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -79,7 +79,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ env.COMPOSER_CACHE }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies @@ -142,7 +142,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ env.COMPOSER_CACHE }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies @@ -179,7 +179,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ env.COMPOSER_CACHE }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Validate composer.json and composer.lock @@ -232,7 +232,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ env.COMPOSER_CACHE }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies From da06f22cf5d9ba65a7352c4d4c94c6e3248fce23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 15:15:17 +0000 Subject: [PATCH 112/113] Bump codecov/codecov-action from 5 to 6 in the all-actions group Bumps the all-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 5 to 6 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 42aa002..8173315 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -260,7 +260,7 @@ jobs: path: ${{ github.workspace }}/build - name: Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true From f1430b217796c02ca9773d666b817b14a1d5ba53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 16:35:36 +0000 Subject: [PATCH 113/113] Bump actions/github-script from 8 to 9 in the all-actions group Bumps the all-actions group with 1 update: [actions/github-script](https://github.com/actions/github-script). Updates `actions/github-script` from 8 to 9 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v8...v9) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '9' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8479227..9fa884a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Run docs build if: github.event_name != 'pull_request' - uses: actions/github-script@v8 + uses: actions/github-script@v9 with: # Token has to be generated on a user account that controls the docs-repository. # The _only_ scope to select is "Access public repositories", nothing more.