From 21c0259f969ec93d5557aa45c8c525292b445444 Mon Sep 17 00:00:00 2001 From: Philippe Logel Date: Wed, 13 Mar 2024 18:52:56 +0000 Subject: [PATCH] return to tuupola/slim-jwt-auth --- src/api/index.php | 2 +- src/composer.json | 2 +- src/composer.lock | 275 +++++++++++++++++++++++++++++++++++++++------- src/v2/index.php | 2 +- 4 files changed, 237 insertions(+), 44 deletions(-) diff --git a/src/api/index.php b/src/api/index.php index 9d2176f46..b3be96837 100644 --- a/src/api/index.php +++ b/src/api/index.php @@ -45,7 +45,7 @@ $app->add( new VersionMiddleware() ); -$app->add(new JWTMiddleware([ +$app->add(new Tuupola\Middleware\JwtAuthentication([ "secret" => SessionUser::getUser()->getJwtSecretForApi(), "secure" => SessionUser::getUser()->isSecure(), "path" => "/api", diff --git a/src/composer.json b/src/composer.json index f0acb9226..653ba1213 100644 --- a/src/composer.json +++ b/src/composer.json @@ -58,7 +58,7 @@ "php-di/php-di": "^6.3", "tecnickcom/tcpdf": "^6.4", "robthree/twofactorauth": "^1.8", - "firebase/php-jwt": "^6.4" + "tuupola/slim-jwt-auth": "^3.8" }, "autoload": { "classmap": [ diff --git a/src/composer.lock b/src/composer.lock index 422145e53..866c573c2 100644 --- a/src/composer.lock +++ b/src/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9b733c2eecb2659496ac913762d12068", + "content-hash": "0bc3b6dbaf0062dd6361bac0ddc78e1a", "packages": [ { "name": "authorizenet/authorizenet", @@ -742,31 +742,25 @@ }, { "name": "firebase/php-jwt", - "version": "v6.10.0", + "version": "v5.5.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" + "reference": "83b609028194aa042ea33b5af2d41a7427de80e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/83b609028194aa042ea33b5af2d41a7427de80e6", + "reference": "83b609028194aa042ea33b5af2d41a7427de80e6", "shasum": "" }, "require": { - "php": "^7.4||^8.0" + "php": ">=5.3.0" }, "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" + "phpunit/phpunit": ">=4.8 <=9" }, "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" }, "type": "library", @@ -799,9 +793,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" + "source": "https://github.com/firebase/php-jwt/tree/v5.5.1" }, - "time": "2023-12-01T16:26:39+00:00" + "time": "2021-11-08T20:18:51+00:00" }, { "name": "geocoder-php/bing-maps-provider", @@ -2804,21 +2798,21 @@ }, { "name": "php-http/curl-client", - "version": "2.3.1", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/php-http/curl-client.git", - "reference": "085570be588f7cbdc4601e78886eea5b7051ad71" + "reference": "0b869922458b1cde9137374545ed4fff7ac83623" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/curl-client/zipball/085570be588f7cbdc4601e78886eea5b7051ad71", - "reference": "085570be588f7cbdc4601e78886eea5b7051ad71", + "url": "https://api.github.com/repos/php-http/curl-client/zipball/0b869922458b1cde9137374545ed4fff7ac83623", + "reference": "0b869922458b1cde9137374545ed4fff7ac83623", "shasum": "" }, "require": { "ext-curl": "*", - "php": "^7.1 || ^8.0", + "php": "^7.4 || ^8.0", "php-http/discovery": "^1.6", "php-http/httplug": "^2.0", "php-http/message": "^1.2", @@ -2832,7 +2826,7 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^2.0", "laminas/laminas-diactoros": "^2.0", "php-http/client-integration-tests": "^3.0", "php-http/message-factory": "^1.1", @@ -2863,9 +2857,9 @@ ], "support": { "issues": "https://github.com/php-http/curl-client/issues", - "source": "https://github.com/php-http/curl-client/tree/2.3.1" + "source": "https://github.com/php-http/curl-client/tree/2.3.2" }, - "time": "2023-11-03T15:32:00+00:00" + "time": "2024-03-03T08:21:07+00:00" }, { "name": "php-http/discovery", @@ -4951,16 +4945,16 @@ }, { "name": "slim/slim", - "version": "4.12.0", + "version": "4.13.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "e9e99c2b24398b967841c6c4c3048622cc7e2b18" + "reference": "038fd5713d5a41636fdff0e8dcceedecdd17fc17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/e9e99c2b24398b967841c6c4c3048622cc7e2b18", - "reference": "e9e99c2b24398b967841c6c4c3048622cc7e2b18", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/038fd5713d5a41636fdff0e8dcceedecdd17fc17", + "reference": "038fd5713d5a41636fdff0e8dcceedecdd17fc17", "shasum": "" }, "require": { @@ -4969,7 +4963,7 @@ "php": "^7.4 || ^8.0", "psr/container": "^1.0 || ^2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.1", + "psr/http-message": "^1.1 || ^2.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", "psr/log": "^1.1 || ^2.0 || ^3.0" @@ -4977,19 +4971,19 @@ "require-dev": { "adriansuter/php-autoload-override": "^1.4", "ext-simplexml": "*", - "guzzlehttp/psr7": "^2.5", + "guzzlehttp/psr7": "^2.6", "httpsoft/http-message": "^1.1", "httpsoft/http-server-request": "^1.1", - "laminas/laminas-diactoros": "^2.17", + "laminas/laminas-diactoros": "^2.17 || ^3", "nyholm/psr7": "^1.8", - "nyholm/psr7-server": "^1.0", - "phpspec/prophecy": "^1.17", - "phpspec/prophecy-phpunit": "^2.0", + "nyholm/psr7-server": "^1.1", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.1", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.6", "slim/http": "^1.3", "slim/psr7": "^1.6", - "squizlabs/php_codesniffer": "^3.7" + "squizlabs/php_codesniffer": "^3.9" }, "suggest": { "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", @@ -5062,7 +5056,7 @@ "type": "tidelift" } ], - "time": "2023-07-23T04:54:29+00:00" + "time": "2024-03-03T21:25:30+00:00" }, { "name": "stella-maris/clock", @@ -6937,16 +6931,16 @@ }, { "name": "symfony/routing", - "version": "v5.4.35", + "version": "v5.4.37", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "86c5a06a61ddaf17efa1403542e3d7146af96203" + "reference": "48ae43e443693ddb4e574f7c12f0d17ce287694e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/86c5a06a61ddaf17efa1403542e3d7146af96203", - "reference": "86c5a06a61ddaf17efa1403542e3d7146af96203", + "url": "https://api.github.com/repos/symfony/routing/zipball/48ae43e443693ddb4e574f7c12f0d17ce287694e", + "reference": "48ae43e443693ddb4e574f7c12f0d17ce287694e", "shasum": "" }, "require": { @@ -7007,7 +7001,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.35" + "source": "https://github.com/symfony/routing/tree/v5.4.37" }, "funding": [ { @@ -7023,7 +7017,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:10:15+00:00" + "time": "2024-02-27T09:52:32+00:00" }, { "name": "symfony/service-contracts", @@ -7780,6 +7774,205 @@ ], "time": "2023-09-06T15:09:26+00:00" }, + { + "name": "tuupola/callable-handler", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/callable-handler.git", + "reference": "0bc7b88630ca753de9aba8f411046856f5ca6f8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/callable-handler/zipball/0bc7b88630ca753de9aba8f411046856f5ca6f8c", + "reference": "0bc7b88630ca753de9aba8f411046856f5ca6f8c", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0", + "psr/http-server-middleware": "^1.0" + }, + "require-dev": { + "overtrue/phplint": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "squizlabs/php_codesniffer": "^3.2", + "tuupola/http-factory": "^0.4.0|^1.0", + "zendframework/zend-diactoros": "^1.6.0|^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "Compatibility layer for PSR-7 double pass and PSR-15 middlewares.", + "homepage": "https://github.com/tuupola/callable-handler", + "keywords": [ + "middleware", + "psr-15", + "psr-7" + ], + "support": { + "issues": "https://github.com/tuupola/callable-handler/issues", + "source": "https://github.com/tuupola/callable-handler/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/tuupola", + "type": "github" + } + ], + "time": "2020-09-09T08:31:54+00:00" + }, + { + "name": "tuupola/http-factory", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/http-factory.git", + "reference": "ae3f8fbdd31cf2f1bbe920b38963c5e4d1e9c454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/http-factory/zipball/ae3f8fbdd31cf2f1bbe920b38963c5e4d1e9c454", + "reference": "ae3f8fbdd31cf2f1bbe920b38963c5e4d1e9c454", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0", + "psr/http-factory": "^1.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9.0", + "overtrue/phplint": "^3.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tuupola\\Http\\Factory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "Lightweight autodiscovering PSR-17 HTTP factories", + "homepage": "https://github.com/tuupola/http-factory", + "keywords": [ + "http", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/tuupola/http-factory/issues", + "source": "https://github.com/tuupola/http-factory/tree/1.4.0" + }, + "funding": [ + { + "url": "https://github.com/tuupola", + "type": "github" + } + ], + "time": "2021-09-14T12:46:25+00:00" + }, + { + "name": "tuupola/slim-jwt-auth", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/tuupola/slim-jwt-auth.git", + "reference": "7829d4482034e9eb5e051f3a1619db0c704ba7e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tuupola/slim-jwt-auth/zipball/7829d4482034e9eb5e051f3a1619db0c704ba7e7", + "reference": "7829d4482034e9eb5e051f3a1619db0c704ba7e7", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^3.0|^4.0|^5.0", + "php": "^7.4|^8.0", + "psr/http-message": "^1.0|^2.0", + "psr/http-server-middleware": "^1.0", + "psr/log": "^1.0|^2.0|^3.0", + "tuupola/callable-handler": "^1.0", + "tuupola/http-factory": "^1.3" + }, + "require-dev": { + "equip/dispatch": "^2.0", + "laminas/laminas-diactoros": "^2.0|^3.0", + "overtrue/phplint": "^1.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^7.0|^8.5.30|^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Tuupola\\Middleware\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mika Tuupola", + "email": "tuupola@appelsiini.net", + "homepage": "https://appelsiini.net/", + "role": "Developer" + } + ], + "description": "PSR-7 and PSR-15 JWT Authentication Middleware", + "homepage": "https://github.com/tuupola/slim-jwt-auth", + "keywords": [ + "auth", + "json", + "jwt", + "middleware", + "psr-15", + "psr-7" + ], + "support": { + "issues": "https://github.com/tuupola/slim-jwt-auth/issues", + "source": "https://github.com/tuupola/slim-jwt-auth/tree/3.8.0" + }, + "time": "2023-10-20T09:51:26+00:00" + }, { "name": "verot/class.upload.php", "version": "dev-master", diff --git a/src/v2/index.php b/src/v2/index.php index c8bd87444..67e1dccf5 100644 --- a/src/v2/index.php +++ b/src/v2/index.php @@ -52,7 +52,7 @@ $app->add(new VersionMiddleware()); -$app->add(new JWTMiddleware([ +$app->add(new Tuupola\Middleware\JwtAuthentication([ "secret" => SessionUser::getUser()->getJwtSecretForApi(), "secure" => SessionUser::getUser()->isSecure(), "path" => "/api",