From c1acde022d3d3fbbeb8f6772da00d7b115b15a5c Mon Sep 17 00:00:00 2001 From: Dovid Levine Date: Sat, 8 Jul 2023 02:19:21 +0300 Subject: [PATCH] chore: update deps (#82) * chore: update Composer dependencies * chore: update WP test versions * chore: stan and lint * chore: update changelog * ci: set MariaDB to v10 * chore: update changelog --- .github/workflows/code-quality.yml | 2 +- .github/workflows/schema-linter.yml | 2 +- .github/workflows/upload-schema-artifact.yml | 2 +- .phpcs.xml.dist | 4 + CHANGELOG.md | 3 + bin/run-docker.sh | 12 +- composer.lock | 194 +++++++++--------- docker-compose.yml | 6 +- phpstan.neon.dist | 4 +- readme.txt | 2 +- src/Admin/Settings.php | 2 +- .../ProviderConfig/OAuth2/OAuth2Config.php | 2 +- .../firebase/php-jwt/src/CachedKeySet.php | 10 + vendor-prefixed/firebase/php-jwt/src/JWK.php | 32 ++- vendor-prefixed/firebase/php-jwt/src/JWT.php | 30 ++- vendor/composer/installed.json | 14 +- vendor/composer/installed.php | 18 +- 17 files changed, 202 insertions(+), 137 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 1d33732e..537d47d2 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -17,7 +17,7 @@ jobs: services: mariadb: - image: mariadb + image: mariadb:10 ports: - 3306:3306 env: diff --git a/.github/workflows/schema-linter.yml b/.github/workflows/schema-linter.yml index c9ef669d..ec263818 100644 --- a/.github/workflows/schema-linter.yml +++ b/.github/workflows/schema-linter.yml @@ -15,7 +15,7 @@ jobs: name: Lint WPGraphQL Schema services: mariadb: - image: mariadb + image: mariadb:10 ports: - 3306:3306 env: diff --git a/.github/workflows/upload-schema-artifact.yml b/.github/workflows/upload-schema-artifact.yml index 359381e5..ab685780 100644 --- a/.github/workflows/upload-schema-artifact.yml +++ b/.github/workflows/upload-schema-artifact.yml @@ -11,7 +11,7 @@ jobs: services: mariadb: - image: mariadb + image: mariadb:10 ports: - 3306:3306 env: diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 4f763f61..d0235fac 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -22,8 +22,12 @@ + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 46ab86e5..830421e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to a modified version of [Semantic Versioning](./README.md#updating-and-versioning). ## Unreleased +- chore: Update Composer deps. +- chore: Cleanup PHPCS and PHPStan configurations. +- ci: Set MariaDB to v10.x in GitHub Actions. ## [0.1.2] - 2023-6-05 diff --git a/bin/run-docker.sh b/bin/run-docker.sh index d2f0f932..47127d3e 100644 --- a/bin/run-docker.sh +++ b/bin/run-docker.sh @@ -16,11 +16,11 @@ print_usage_instructions() { echo " composer build-app" echo " composer run-app" echo "" - echo " WP_VERSION=5.9 PHP_VERSION=8.0 composer build-app" - echo " WP_VERSION=5.9 PHP_VERSION=8.0 composer run-app" + echo " WP_VERSION=6.2 PHP_VERSION=8.1 composer build-app" + echo " WP_VERSION=6.2 PHP_VERSION=8.1 composer run-app" echo "" - echo " WP_VERSION=5.9 PHP_VERSION=8.0 bin/run-docker.sh build -a" - echo " WP_VERSION=5.9 PHP_VERSION=8.0 bin/run-docker.sh run -a" + echo " WP_VERSION=6.2 PHP_VERSION=8.1 bin/run-docker.sh build -a" + echo " WP_VERSION=6.2 PHP_VERSION=8.1 bin/run-docker.sh run -a" exit 1 } @@ -29,8 +29,8 @@ if [ $# -eq 0 ]; then fi TAG=${TAG-latest} -WP_VERSION=${WP_VERSION-6.0} -PHP_VERSION=${PHP_VERSION-8.0} +WP_VERSION=${WP_VERSION-6.2} +PHP_VERSION=${PHP_VERSION-8.1} BUILD_NO_CACHE=${BUILD_NO_CACHE-} diff --git a/composer.lock b/composer.lock index 90fb1f09..db726389 100644 --- a/composer.lock +++ b/composer.lock @@ -66,16 +66,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.5.0", + "version": "v6.8.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2" + "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", + "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", "shasum": "" }, "require": { @@ -123,9 +123,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.5.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" }, - "time": "2023-05-12T15:47:07+00:00" + "time": "2023-06-20T16:45:35+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1281,16 +1281,16 @@ }, { "name": "axepress/wp-graphql-cs", - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "source": { "type": "git", "url": "https://github.com/AxeWP/WPGraphQL-Coding-Standards.git", - "reference": "03f0f3cfa997a0f32311113e146bcba8ea90b1c5" + "reference": "e45e4d5eb627c6a7add20c2ebf8d337febdf499d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AxeWP/WPGraphQL-Coding-Standards/zipball/03f0f3cfa997a0f32311113e146bcba8ea90b1c5", - "reference": "03f0f3cfa997a0f32311113e146bcba8ea90b1c5", + "url": "https://api.github.com/repos/AxeWP/WPGraphQL-Coding-Standards/zipball/e45e4d5eb627c6a7add20c2ebf8d337febdf499d", + "reference": "e45e4d5eb627c6a7add20c2ebf8d337febdf499d", "shasum": "" }, "require": { @@ -1306,7 +1306,7 @@ "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + "phpunit/phpunit": "^8.5 || ^9" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -1337,20 +1337,20 @@ "issues": "https://github.com/AxeWP/WPGraphQL-Coding-Standards/issues", "source": "https://github.com/AxeWP/WPGraphQL-Coding-Standards" }, - "time": "2023-06-05T09:07:08+00:00" + "time": "2023-06-17T14:52:55+00:00" }, { "name": "axepress/wp-graphql-stubs", - "version": "v1.14.3", + "version": "v1.14.6", "source": { "type": "git", "url": "https://github.com/AxeWP/wp-graphql-stubs.git", - "reference": "84399dce808db09a876fd79013db56af5d8da4da" + "reference": "9de2d036497a470354ac541196806eb426c67740" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/84399dce808db09a876fd79013db56af5d8da4da", - "reference": "84399dce808db09a876fd79013db56af5d8da4da", + "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/9de2d036497a470354ac541196806eb426c67740", + "reference": "9de2d036497a470354ac541196806eb426c67740", "shasum": "" }, "require": { @@ -1381,7 +1381,7 @@ ], "support": { "issues": "https://github.com/AxeWP/wp-graphql-stubs/issues", - "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.14.3" + "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.14.6" }, "funding": [ { @@ -1389,7 +1389,7 @@ "type": "github" } ], - "time": "2023-04-28T12:31:19+00:00" + "time": "2023-07-02T01:57:05+00:00" }, { "name": "behat/gherkin", @@ -2229,16 +2229,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", + "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", "shasum": "" }, "require": { @@ -2285,7 +2285,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.5" + "source": "https://github.com/composer/ca-bundle/tree/1.3.6" }, "funding": [ { @@ -2301,7 +2301,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-06-06T12:02:59+00:00" }, { "name": "composer/composer", @@ -2889,28 +2889,28 @@ }, { "name": "doctrine/inflector", - "version": "2.0.6", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" + "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/f9301a5b2fb1216b2b08f02ba04dc45423db6bff", + "reference": "f9301a5b2fb1216b2b08f02ba04dc45423db6bff", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -2960,7 +2960,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" + "source": "https://github.com/doctrine/inflector/tree/2.0.8" }, "funding": [ { @@ -2976,7 +2976,7 @@ "type": "tidelift" } ], - "time": "2022-10-20T09:10:12+00:00" + "time": "2023-06-16T13:40:37+00:00" }, { "name": "doctrine/instantiator", @@ -3866,22 +3866,22 @@ }, { "name": "mockery/mockery", - "version": "1.6.0", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "bac1765cb52bbd3364a870e920cb69cd859ee302" + "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/bac1765cb52bbd3364a870e920cb69cd859ee302", - "reference": "bac1765cb52bbd3364a870e920cb69cd859ee302", + "url": "https://api.github.com/repos/mockery/mockery/zipball/13a7fa2642c76c58fa2806ef7f565344c817a191", + "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" + "php": "^7.4 || ^8.0" }, "conflict": { "phpunit/phpunit": "<8.0" @@ -3894,7 +3894,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-main": "1.6.x-dev" } }, "autoload": { @@ -3938,9 +3938,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.6.0" + "source": "https://github.com/mockery/mockery/tree/1.6.2" }, - "time": "2023-05-03T12:55:29+00:00" + "time": "2023-06-07T09:07:52+00:00" }, { "name": "mustache/mustache", @@ -4098,16 +4098,16 @@ }, { "name": "nesbot/carbon", - "version": "2.67.0", + "version": "2.68.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "c1001b3bc75039b07f38a79db5237c4c529e04c8" + "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/c1001b3bc75039b07f38a79db5237c4c529e04c8", - "reference": "c1001b3bc75039b07f38a79db5237c4c529e04c8", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4f991ed2a403c85efbc4f23eb4030063fdbe01da", + "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da", "shasum": "" }, "require": { @@ -4196,20 +4196,20 @@ "type": "tidelift" } ], - "time": "2023-05-25T22:09:47+00:00" + "time": "2023-06-20T18:29:04+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -4250,9 +4250,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-05-19T20:20:00+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phar-io/manifest", @@ -4450,16 +4450,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v7.7.2", + "version": "v7.8.2", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "55edb87032a1c5a21f5539312b93941217d2eeec" + "reference": "185d4281e97aa37d193334e5b8da007652f9d391" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/55edb87032a1c5a21f5539312b93941217d2eeec", - "reference": "55edb87032a1c5a21f5539312b93941217d2eeec", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/185d4281e97aa37d193334e5b8da007652f9d391", + "reference": "185d4281e97aa37d193334e5b8da007652f9d391", "shasum": "" }, "require": { @@ -4488,9 +4488,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.7.2" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.8.2" }, - "time": "2023-06-01T02:36:24+00:00" + "time": "2023-07-03T21:07:37+00:00" }, { "name": "php-stubs/wordpress-stubs", @@ -4823,22 +4823,24 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.20.4", + "version": "1.22.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", + "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.5", @@ -4862,22 +4864,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" }, - "time": "2023-05-02T09:19:37+00:00" + "time": "2023-06-29T20:46:06+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.16", + "version": "1.10.25", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "352bdbb960bb523e3d71b834862589f910921c23" + "reference": "578f4e70d117f9a90699324c555922800ac38d8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/352bdbb960bb523e3d71b834862589f910921c23", - "reference": "352bdbb960bb523e3d71b834862589f910921c23", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/578f4e70d117f9a90699324c555922800ac38d8c", + "reference": "578f4e70d117f9a90699324c555922800ac38d8c", "shasum": "" }, "require": { @@ -4926,7 +4928,7 @@ "type": "tidelift" } ], - "time": "2023-06-05T08:21:46+00:00" + "time": "2023-07-06T12:11:37+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5248,16 +5250,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "9.6.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a9aceaf20a682aeacf28d582654a1670d8826778", + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778", "shasum": "" }, "require": { @@ -5331,7 +5333,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.9" }, "funding": [ { @@ -5347,7 +5349,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-06-11T06:13:56+00:00" }, { "name": "psr/container", @@ -6756,32 +6758,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.12.1", + "version": "8.13.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7" + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/a13c15e20f2d307a1ca8dec5313ec462a4466470", + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.20.0 <1.21.0", + "phpstan/phpdoc-parser": "^1.22.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.15", + "phpstan/phpstan": "1.10.21", "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.3.11", + "phpstan/phpstan-phpunit": "1.3.13", "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.1.3" + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.2" }, "type": "phpcodesniffer-standard", "extra": { @@ -6805,7 +6807,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.12.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.1" }, "funding": [ { @@ -6817,7 +6819,7 @@ "type": "tidelift" } ], - "time": "2023-05-15T21:42:25+00:00" + "time": "2023-06-25T12:52:34+00:00" }, { "name": "softcreatr/jsonpath", @@ -7263,16 +7265,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4a286c916b74ecfb6e2caf1aa31d3fe2a34b7e08" + "reference": "d2aefa5a7acc5511422792931d14d1be96fe9fea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4a286c916b74ecfb6e2caf1aa31d3fe2a34b7e08", - "reference": "4a286c916b74ecfb6e2caf1aa31d3fe2a34b7e08", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d2aefa5a7acc5511422792931d14d1be96fe9fea", + "reference": "d2aefa5a7acc5511422792931d14d1be96fe9fea", "shasum": "" }, "require": { @@ -7318,7 +7320,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.23" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.25" }, "funding": [ { @@ -7334,7 +7336,7 @@ "type": "tidelift" } ], - "time": "2023-04-08T21:20:19+00:00" + "time": "2023-06-05T08:05:41+00:00" }, { "name": "symfony/event-dispatcher", @@ -7502,16 +7504,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -7546,7 +7548,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -7562,7 +7564,7 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/finder", diff --git a/docker-compose.yml b/docker-compose.yml index 8299636d..6c8946eb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: app: depends_on: - app_db - image: wp-graphql-headless-login:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.0} + image: wp-graphql-headless-login:latest-wp${WP_VERSION-6.2}-php${PHP_VERSION-8.1} volumes: - '.:/var/www/html/wp-content/plugins/wp-graphql-headless-login' - './.log/app:/var/log/apache2' @@ -19,7 +19,7 @@ services: local: app_db: - image: mariadb:10.2 + image: mariadb:10 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: wordpress @@ -34,7 +34,7 @@ services: testing: depends_on: - app_db - image: wp-graphql-headless-login-testing:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.0} + image: wp-graphql-headless-login-testing:latest-wp${WP_VERSION-6.2}-php${PHP_VERSION-8.1} volumes: - '.:/var/www/html/wp-content/plugins/wp-graphql-headless-login' - './.log/testing:/var/log/apache2' diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6bf2940d..eaacbe14 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,7 +1,7 @@ parameters: level: 8 - inferPrivatePropertyTypeFromConstructor: true checkMissingIterableValueType: false + treatPhpDocTypesAsCertain: false bootstrapFiles: - phpstan/constants.php paths: @@ -17,6 +17,6 @@ parameters: - ../wp-graphql/tests scanFiles: - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php + - vendor/axepress/wp-graphql-stubs/wp-graphql-stubs.php scanDirectories: - - ../wp-graphql - ../wp-graphql-woocommerce/includes diff --git a/readme.txt b/readme.txt index 1024f815..8b47ed3e 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: axepress, justlevine Tags: GraphQL, Gatsby, Headless, WPGraphQL, React, Rest, SSO, Social Login, OAuth, OAuth2, SAML, Authentication, JWT, Login, OpenID Requires at least: 5.6 -Tested up to: 6.2 +Tested up to: 6.2.2 Requires PHP: 7.4 Requires WPGraphQL: 1.12.0 Stable tag: 0.1.2 diff --git a/src/Admin/Settings.php b/src/Admin/Settings.php index 3fcb6627..98b98677 100644 --- a/src/Admin/Settings.php +++ b/src/Admin/Settings.php @@ -123,7 +123,7 @@ private static function register_asset_js( string $handle, string $asset_name ): throw new Error( __( 'You need to run `npm start` or `npm run build` for Headless Login for WPGraphQL to work.', 'wp-graphql-headless-login' ) ); } - $script_asset = require_once $script_asset_path; + $script_asset = require_once $script_asset_path; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable $js = 'build/' . $asset_name . '.js'; wp_register_script( diff --git a/src/Auth/ProviderConfig/OAuth2/OAuth2Config.php b/src/Auth/ProviderConfig/OAuth2/OAuth2Config.php index 4aa14aef..c8afbb0d 100644 --- a/src/Auth/ProviderConfig/OAuth2/OAuth2Config.php +++ b/src/Auth/ProviderConfig/OAuth2/OAuth2Config.php @@ -270,7 +270,7 @@ public static function default_login_options_fields(): array { } /** - * R{@inheritDoc} + * {@inheritDoc} */ protected static function login_options_schema(): array { return [ diff --git a/vendor-prefixed/firebase/php-jwt/src/CachedKeySet.php b/vendor-prefixed/firebase/php-jwt/src/CachedKeySet.php index 34fa9460..8004f923 100644 --- a/vendor-prefixed/firebase/php-jwt/src/CachedKeySet.php +++ b/vendor-prefixed/firebase/php-jwt/src/CachedKeySet.php @@ -184,6 +184,16 @@ private function keyIdExists(string $keyId): bool } $request = $this->httpFactory->createRequest('GET', $this->jwksUri); $jwksResponse = $this->httpClient->sendRequest($request); + if ($jwksResponse->getStatusCode() !== 200) { + throw new UnexpectedValueException( + sprintf('HTTP Error: %d %s for URI "%s"', + $jwksResponse->getStatusCode(), + $jwksResponse->getReasonPhrase(), + $this->jwksUri, + ), + $jwksResponse->getStatusCode() + ); + } $this->keySet = $this->formatJwksForCache((string) $jwksResponse->getBody()); if (!isset($this->keySet[$keyId])) { diff --git a/vendor-prefixed/firebase/php-jwt/src/JWK.php b/vendor-prefixed/firebase/php-jwt/src/JWK.php index 0ac62215..c2fa4e58 100644 --- a/vendor-prefixed/firebase/php-jwt/src/JWK.php +++ b/vendor-prefixed/firebase/php-jwt/src/JWK.php @@ -33,10 +33,16 @@ class JWK private const EC_CURVES = [ 'P-256' => '1.2.840.10045.3.1.7', // Len: 64 'secp256k1' => '1.3.132.0.10', // Len: 64 - // 'P-384' => '1.3.132.0.34', // Len: 96 (not yet supported) + 'P-384' => '1.3.132.0.34', // Len: 96 // 'P-521' => '1.3.132.0.35', // Len: 132 (not supported) ]; + // For keys with "kty" equal to "OKP" (Octet Key Pair), the "crv" parameter must contain the key subtype. + // This library supports the following subtypes: + private const OKP_SUBTYPES = [ + 'Ed25519' => true, // RFC 8037 + ]; + /** * Parse a set of JWK keys * @@ -151,8 +157,28 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key $publicKey = self::createPemFromCrvAndXYCoordinates($jwk['crv'], $jwk['x'], $jwk['y']); return new Key($publicKey, $jwk['alg']); + case 'OKP': + if (isset($jwk['d'])) { + // The key is actually a private key + throw new UnexpectedValueException('Key data must be for a public key'); + } + + if (!isset($jwk['crv'])) { + throw new UnexpectedValueException('crv not set'); + } + + if (empty(self::OKP_SUBTYPES[$jwk['crv']])) { + throw new DomainException('Unrecognised or unsupported OKP key subtype'); + } + + if (empty($jwk['x'])) { + throw new UnexpectedValueException('x not set'); + } + + // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. + $publicKey = JWT::convertBase64urlToBase64($jwk['x']); + return new Key($publicKey, $jwk['alg']); default: - // Currently only RSA is supported break; } @@ -162,7 +188,7 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key /** * Converts the EC JWK values to pem format. * - * @param string $crv The EC curve (only P-256 is supported) + * @param string $crv The EC curve (only P-256 & P-384 is supported) * @param string $x The EC x-coordinate * @param string $y The EC y-coordinate * diff --git a/vendor-prefixed/firebase/php-jwt/src/JWT.php b/vendor-prefixed/firebase/php-jwt/src/JWT.php index c462fe73..6a5f474a 100644 --- a/vendor-prefixed/firebase/php-jwt/src/JWT.php +++ b/vendor-prefixed/firebase/php-jwt/src/JWT.php @@ -84,6 +84,7 @@ class JWT * Supported algorithms are 'ES384','ES256', * 'HS256', 'HS384', 'HS512', 'RS256', 'RS384' * and 'RS512'. + * @param stdClass $headers Optional. Populates stdClass with headers. * * @return stdClass The JWT's payload as a PHP object * @@ -100,7 +101,8 @@ class JWT */ public static function decode( string $jwt, - $keyOrKeyArray + $keyOrKeyArray, + stdClass &$headers = null ): stdClass { // Validate JWT $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp; @@ -117,6 +119,9 @@ public static function decode( if (null === ($header = static::jsonDecode($headerRaw))) { throw new UnexpectedValueException('Invalid header encoding'); } + if ($headers !== null) { + $headers = $header; + } $payloadRaw = static::urlsafeB64Decode($bodyb64); if (null === ($payload = static::jsonDecode($payloadRaw))) { throw new UnexpectedValueException('Invalid claims encoding'); @@ -162,7 +167,7 @@ public static function decode( // Check that this token has been created before 'now'. This prevents // using tokens that have been created for later use (and haven't // correctly used the nbf claim). - if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { + if (!isset($payload->nbf) && isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { throw new BeforeValidException( 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat) ); @@ -221,7 +226,7 @@ public static function encode( * * @param string $msg The message to sign * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key. - * @param string $alg Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', + * @param string $alg Supported algorithms are 'EdDSA', 'ES384', 'ES256', 'ES256K', 'HS256', * 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' * * @return string An encrypted message @@ -284,7 +289,7 @@ public static function sign( * * @param string $msg The original message (header and body) * @param string $signature The original signature - * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For Ed*, ES*, HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey * @param string $alg The algorithm * * @return bool @@ -405,13 +410,28 @@ public static function jsonEncode(array $input): string * @throws InvalidArgumentException invalid base64 characters */ public static function urlsafeB64Decode(string $input): string + { + return \base64_decode(self::convertBase64UrlToBase64($input)); + } + + /** + * Convert a string in the base64url (URL-safe Base64) encoding to standard base64. + * + * @param string $input A Base64 encoded string with URL-safe characters (-_ and no padding) + * + * @return string A Base64 encoded string with standard characters (+/) and padding (=), when + * needed. + * + * @see https://www.rfc-editor.org/rfc/rfc4648 + */ + public static function convertBase64UrlToBase64(string $input): string { $remainder = \strlen($input) % 4; if ($remainder) { $padlen = 4 - $remainder; $input .= \str_repeat('=', $padlen); } - return \base64_decode(\strtr($input, '-_', '+/')); + return \strtr($input, '-_', '+/'); } /** diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 0e2670c9..ce8814c4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -63,17 +63,17 @@ }, { "name": "firebase/php-jwt", - "version": "v6.5.0", - "version_normalized": "6.5.0.0", + "version": "v6.8.0", + "version_normalized": "6.8.0.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2" + "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", + "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", "shasum": "" }, "require": { @@ -91,7 +91,7 @@ "ext-sodium": "Support EdDSA (Ed25519) signatures", "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" }, - "time": "2023-05-12T15:47:07+00:00", + "time": "2023-06-20T16:45:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -123,7 +123,7 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.5.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" }, "install-path": "../firebase/php-jwt" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index ef86f5a1..36c6de26 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'axepress/wp-graphql-headless-login', - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'reference' => '1e26d5967be0dc76e5d2161eb73772c9af7a7690', + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => 'ec1069f141c5ce68db0a5c36b6d24432ddb4fbef', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'axepress/wp-graphql-headless-login' => array( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'reference' => '1e26d5967be0dc76e5d2161eb73772c9af7a7690', + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => 'ec1069f141c5ce68db0a5c36b6d24432ddb4fbef', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -29,9 +29,9 @@ 'dev_requirement' => false, ), 'firebase/php-jwt' => array( - 'pretty_version' => 'v6.5.0', - 'version' => '6.5.0.0', - 'reference' => 'e94e7353302b0c11ec3cfff7180cd0b1743975d2', + 'pretty_version' => 'v6.8.0', + 'version' => '6.8.0.0', + 'reference' => '48b0210c51718d682e53210c24d25c5a10a2299b', 'type' => 'library', 'install_path' => __DIR__ . '/../firebase/php-jwt', 'aliases' => array(),