From 6942fc1d32df72d5b928f527dac98441e1d78982 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 28 Nov 2020 18:21:29 +0000 Subject: [PATCH] Initial php8 work - switch to GD for image work - fix issues around jwt --- app/Http/Controllers/MicropubController.php | 24 +- .../Controllers/MicropubMediaController.php | 14 +- app/Providers/AppServiceProvider.php | 15 + app/Services/TokenService.php | 40 +- composer.json | 2 +- composer.lock | 550 +++++++++--------- config/image.php | 2 +- tests/Feature/MicropubControllerTest.php | 7 +- tests/TestToken.php | 53 +- 9 files changed, 370 insertions(+), 337 deletions(-) diff --git a/app/Http/Controllers/MicropubController.php b/app/Http/Controllers/MicropubController.php index 1f6ea4d4..50fba921 100644 --- a/app/Http/Controllers/MicropubController.php +++ b/app/Http/Controllers/MicropubController.php @@ -10,6 +10,8 @@ use App\Models\Place; use App\Services\Micropub\{HCardService, HEntryService, UpdateService}; use App\Services\TokenService; use Illuminate\Http\JsonResponse; +use Lcobucci\JWT\Token\InvalidTokenStructure; +use Lcobucci\JWT\Validation\RequiredConstraintsViolated; use Monolog\Handler\StreamHandler; use Monolog\Logger; @@ -43,13 +45,13 @@ class MicropubController extends Controller { try { $tokenData = $this->tokenService->validateToken(request()->input('access_token')); - } catch (InvalidTokenException $e) { + } catch (RequiredConstraintsViolated | InvalidTokenStructure) { $micropubResponses = new MicropubResponses(); return $micropubResponses->invalidTokenResponse(); } - if ($tokenData->hasClaim('scope') === false) { + if ($tokenData->claims()->has('scope') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->tokenHasNoScopeResponse(); @@ -58,7 +60,7 @@ class MicropubController extends Controller $this->logMicropubRequest(request()->all()); if ((request()->input('h') == 'entry') || (request()->input('type.0') == 'h-entry')) { - if (stristr($tokenData->getClaim('scope'), 'create') === false) { + if (stristr($tokenData->claims()->get('scope'), 'create') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->insufficientScopeResponse(); @@ -72,7 +74,7 @@ class MicropubController extends Controller } if (request()->input('h') == 'card' || request()->input('type.0') == 'h-card') { - if (stristr($tokenData->getClaim('scope'), 'create') === false) { + if (stristr($tokenData->claims()->get('scope'), 'create') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->insufficientScopeResponse(); @@ -86,7 +88,7 @@ class MicropubController extends Controller } if (request()->input('action') == 'update') { - if (stristr($tokenData->getClaim('scope'), 'update') === false) { + if (stristr($tokenData->claims()->get('scope'), 'update') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->insufficientScopeResponse(); @@ -115,7 +117,7 @@ class MicropubController extends Controller { try { $tokenData = $this->tokenService->validateToken(request()->input('access_token')); - } catch (InvalidTokenException $e) { + } catch (RequiredConstraintsViolated | InvalidTokenStructure) { $micropubResponses = new MicropubResponses(); return $micropubResponses->invalidTokenResponse(); @@ -156,9 +158,9 @@ class MicropubController extends Controller return response()->json([ 'response' => 'token', 'token' => [ - 'me' => $tokenData->getClaim('me'), - 'scope' => $tokenData->getClaim('scope'), - 'client_id' => $tokenData->getClaim('client_id'), + 'me' => $tokenData->claims()->get('me'), + 'scope' => $tokenData->claims()->get('scope'), + 'client_id' => $tokenData->claims()->get('client_id'), ], ]); } @@ -167,13 +169,13 @@ class MicropubController extends Controller * Determine the client id from the access token sent with the request. * * @return string - * @throws InvalidTokenException + * @throws RequiredConstraintsViolated */ private function getClientId(): string { return resolve(TokenService::class) ->validateToken(request()->input('access_token')) - ->getClaim('client_id'); + ->claims()->get('client_id'); } /** diff --git a/app/Http/Controllers/MicropubMediaController.php b/app/Http/Controllers/MicropubMediaController.php index 22df7575..d24c2c99 100644 --- a/app/Http/Controllers/MicropubMediaController.php +++ b/app/Http/Controllers/MicropubMediaController.php @@ -21,6 +21,8 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Intervention\Image\Exception\NotReadableException; use Intervention\Image\ImageManager; +use Lcobucci\JWT\Token\InvalidTokenStructure; +use Lcobucci\JWT\Validation\RequiredConstraintsViolated; use Ramsey\Uuid\Uuid; class MicropubMediaController extends Controller @@ -36,19 +38,19 @@ class MicropubMediaController extends Controller { try { $tokenData = $this->tokenService->validateToken(request()->input('access_token')); - } catch (InvalidTokenException $e) { + } catch (RequiredConstraintsViolated | InvalidTokenStructure) { $micropubResponses = new MicropubResponses(); return $micropubResponses->invalidTokenResponse(); } - if ($tokenData->hasClaim('scope') === false) { + if ($tokenData->claims()->has('scope') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->tokenHasNoScopeResponse(); } - if (Str::contains($tokenData->getClaim('scope'), 'create') === false) { + if (Str::contains($tokenData->claims()->get('scope'), 'create') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->insufficientScopeResponse(); @@ -103,19 +105,19 @@ class MicropubMediaController extends Controller { try { $tokenData = $this->tokenService->validateToken(request()->input('access_token')); - } catch (InvalidTokenException $e) { + } catch (RequiredConstraintsViolated | InvalidTokenStructure) { $micropubResponses = new MicropubResponses(); return $micropubResponses->invalidTokenResponse(); } - if ($tokenData->hasClaim('scope') === false) { + if ($tokenData->claims()->has('scope') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->tokenHasNoScopeResponse(); } - if (Str::contains($tokenData->getClaim('scope'), 'create') === false) { + if (Str::contains($tokenData->claims()->get('scope'), 'create') === false) { $micropubResponses = new MicropubResponses(); return $micropubResponses->insufficientScopeResponse(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b0337f0d..73269ee7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -11,6 +11,10 @@ use Illuminate\Support\Collection; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; use Laravel\Dusk\DuskServiceProvider; +use Lcobucci\JWT\Configuration; +use Lcobucci\JWT\Signer\Hmac\Sha256; +use Lcobucci\JWT\Signer\Key\InMemory; +use Lcobucci\JWT\Validation\Constraint\SignedWith; class AppServiceProvider extends ServiceProvider { @@ -73,6 +77,17 @@ class AppServiceProvider extends ServiceProvider ] ); }); + + // Configure JWT builder + $this->app->bind('Lcobucci\JWT\Configuration', function () { + $key = InMemory::plainText('testing'); + + $config = Configuration::forSymmetricSigner(new Sha256(), $key); + + $config->setValidationConstraints(new SignedWith(new Sha256(), $key)); + + return $config; + }); } /** diff --git a/app/Services/TokenService.php b/app/Services/TokenService.php index 09954067..056f547a 100644 --- a/app/Services/TokenService.php +++ b/app/Services/TokenService.php @@ -6,8 +6,8 @@ namespace App\Services; use App\Exceptions\InvalidTokenException; use App\Jobs\AddClientToDatabase; -use Lcobucci\JWT\Signer\Hmac\Sha256; -use Lcobucci\JWT\{Builder, Parser, Token}; +use DateTimeImmutable; +use Lcobucci\JWT\{Configuration, Token}; class TokenService { @@ -19,17 +19,19 @@ class TokenService */ public function getNewToken(array $data): string { - $signer = new Sha256(); - $token = (new Builder())->set('me', $data['me']) - ->set('client_id', $data['client_id']) - ->set('scope', $data['scope']) - ->set('date_issued', time()) - ->set('nonce', bin2hex(random_bytes(8))) - ->sign($signer, config('app.key')) - ->getToken(); + $config = resolve(Configuration::class); + + $token = $config->builder() + ->issuedAt(new DateTimeImmutable()) + ->withClaim('client_id', $data['client_id']) + ->withClaim('me', $data['me']) + ->withClaim('scope', $data['scope']) + ->withClaim('nonce', bin2hex(random_bytes(8))) + ->getToken($config->signer(), $config->signingKey()); + dispatch(new AddClientToDatabase($data['client_id'])); - return (string) $token; + return $token->toString(); } /** @@ -40,15 +42,13 @@ class TokenService */ public function validateToken(string $bearerToken): Token { - $signer = new Sha256(); - try { - $token = (new Parser())->parse((string) $bearerToken); - } catch (\InvalidArgumentException $e) { - throw new InvalidTokenException('Token could not be parsed'); - } - if (! $token->verify($signer, config('app.key'))) { - throw new InvalidTokenException('Token failed validation'); - } + $config = resolve('Lcobucci\JWT\Configuration'); + + $token = $config->parser()->parse($bearerToken); + + $constraints = $config->validationConstraints(); + + $config->validator()->assert($token, ...$constraints); return $token; } diff --git a/composer.json b/composer.json index 74d89ad1..3c28eee4 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ ], "license": "CC0-1.0", "require": { - "php": "^7.4", + "php": "^8.0", "ext-intl": "*", "ext-json": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 4fd0b1a1..8bd2174d 100644 --- a/composer.lock +++ b/composer.lock @@ -64,16 +64,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.158.22", + "version": "3.164.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "0aae6d7d0e9fc40ace69ed7f7785d7ddab4dabd0" + "reference": "39ecf57d828eb50ab23fd70255a68b8996392ac9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0aae6d7d0e9fc40ace69ed7f7785d7ddab4dabd0", - "reference": "0aae6d7d0e9fc40ace69ed7f7785d7ddab4dabd0", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/39ecf57d828eb50ab23fd70255a68b8996392ac9", + "reference": "39ecf57d828eb50ab23fd70255a68b8996392ac9", "shasum": "" }, "require": { @@ -148,9 +148,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.158.22" + "source": "https://github.com/aws/aws-sdk-php/tree/3.164.0" }, - "time": "2020-11-06T19:13:12+00:00" + "time": "2020-11-24T19:18:22+00:00" }, { "name": "brick/math", @@ -704,26 +704,29 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.0.2", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926" + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/48212cdc0a79051d50d7fc2f0645c5a321caf926", - "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0", + "webmozart/assert": "^1.7.0" }, "replace": { "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpstan/phpstan": "^0.11|^0.12", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12.7", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", @@ -750,7 +753,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.0.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0" }, "funding": [ { @@ -758,20 +761,20 @@ "type": "github" } ], - "time": "2020-10-13T01:26:01+00:00" + "time": "2020-11-24T19:55:57+00:00" }, { "name": "egulias/email-validator", - "version": "2.1.23", + "version": "2.1.24", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df" + "reference": "ca90a3291eee1538cd48ff25163240695bd95448" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df", - "reference": "5fa792ad1853ae2bc60528dd3e5cbf4542d3c1df", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ca90a3291eee1538cd48ff25163240695bd95448", + "reference": "ca90a3291eee1538cd48ff25163240695bd95448", "shasum": "" }, "require": { @@ -818,9 +821,15 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/2.1.23" + "source": "https://github.com/egulias/EmailValidator/tree/2.1.24" }, - "time": "2020-10-31T20:37:35+00:00" + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2020-11-14T15:56:27+00:00" }, { "name": "fideloper/proxy", @@ -1257,16 +1266,16 @@ }, { "name": "indieauth/client", - "version": "0.5.2", + "version": "0.6.0", "source": { "type": "git", "url": "https://github.com/indieweb/indieauth-client-php.git", - "reference": "22d40430b3a93e48c52ca71da718241293e9feac" + "reference": "e85549dd3ea2070f20a964a9b9686f31be9d5382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/indieweb/indieauth-client-php/zipball/22d40430b3a93e48c52ca71da718241293e9feac", - "reference": "22d40430b3a93e48c52ca71da718241293e9feac", + "url": "https://api.github.com/repos/indieweb/indieauth-client-php/zipball/e85549dd3ea2070f20a964a9b9686f31be9d5382", + "reference": "e85549dd3ea2070f20a964a9b9686f31be9d5382", "shasum": "" }, "require": { @@ -1297,9 +1306,9 @@ "description": "IndieAuth Client Library", "support": { "issues": "https://github.com/indieweb/indieauth-client-php/issues", - "source": "https://github.com/indieweb/indieauth-client-php/tree/master" + "source": "https://github.com/indieweb/indieauth-client-php/tree/0.6.0" }, - "time": "2019-05-12T20:24:13+00:00" + "time": "2020-11-25T16:09:18+00:00" }, { "name": "indieweb/link-rel-parser", @@ -1641,16 +1650,16 @@ }, { "name": "laravel/framework", - "version": "v8.13.0", + "version": "v8.16.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "37a0abd4f3dbc51e2256296b45f8be72c8fe2196" + "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/37a0abd4f3dbc51e2256296b45f8be72c8fe2196", - "reference": "37a0abd4f3dbc51e2256296b45f8be72c8fe2196", + "url": "https://api.github.com/repos/laravel/framework/zipball/f7dfc22e6c42e9ed4dda14c05814349af6943206", + "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206", "shasum": "" }, "require": { @@ -1723,8 +1732,8 @@ "illuminate/view": "self.version" }, "require-dev": { - "aws/aws-sdk-php": "^3.0", - "doctrine/dbal": "^2.6", + "aws/aws-sdk-php": "^3.155", + "doctrine/dbal": "^2.6|^3.0", "filp/whoops": "^2.8", "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", @@ -1736,8 +1745,8 @@ "symfony/cache": "^5.1" }, "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-memcached": "Required to use the memcache cache driver.", @@ -1804,20 +1813,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2020-11-03T14:13:19+00:00" + "time": "2020-11-25T15:01:02+00:00" }, { "name": "laravel/horizon", - "version": "v5.4.0", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "d08d10ee12f53b7ba2cbb938eb23857e93fe51d3" + "reference": "66743f65a55a71f52b5308de1a09fe5fd8453bcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/d08d10ee12f53b7ba2cbb938eb23857e93fe51d3", - "reference": "d08d10ee12f53b7ba2cbb938eb23857e93fe51d3", + "url": "https://api.github.com/repos/laravel/horizon/zipball/66743f65a55a71f52b5308de1a09fe5fd8453bcb", + "reference": "66743f65a55a71f52b5308de1a09fe5fd8453bcb", "shasum": "" }, "require": { @@ -1879,9 +1888,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.4.0" + "source": "https://github.com/laravel/horizon/tree/v5.5.0" }, - "time": "2020-11-03T16:55:40+00:00" + "time": "2020-11-24T17:09:52+00:00" }, { "name": "laravel/scout", @@ -2087,16 +2096,16 @@ }, { "name": "lcobucci/jwt", - "version": "3.3.3", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "c1123697f6a2ec29162b82f170dd4a491f524773" + "reference": "958a9873a63b0244a72f6e354ccc86019ee674a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c1123697f6a2ec29162b82f170dd4a491f524773", - "reference": "c1123697f6a2ec29162b82f170dd4a491f524773", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/958a9873a63b0244a72f6e354ccc86019ee674a5", + "reference": "958a9873a63b0244a72f6e354ccc86019ee674a5", "shasum": "" }, "require": { @@ -2111,6 +2120,9 @@ "phpunit/phpunit": "^5.7 || ^7.3", "squizlabs/php_codesniffer": "~2.3" }, + "suggest": { + "lcobucci/clock": "*" + }, "type": "library", "extra": { "branch-alias": { @@ -2120,7 +2132,12 @@ "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" - } + }, + "files": [ + "compat/class-aliases.php", + "compat/json-exception-polyfill.php", + "compat/lcobucci-clock-polyfill.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2140,7 +2157,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/3.3.3" + "source": "https://github.com/lcobucci/jwt/tree/3.4.1" }, "funding": [ { @@ -2152,7 +2169,7 @@ "type": "patreon" } ], - "time": "2020-08-20T13:22:28+00:00" + "time": "2020-11-27T01:17:14+00:00" }, { "name": "league/commonmark", @@ -2403,28 +2420,28 @@ }, { "name": "league/glide", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/thephpleague/glide.git", - "reference": "8759b8edfe953c8e6aceb45b3647fb7ae5349a0c" + "reference": "ae5e26700573cb678919d28e425a8b87bc71c546" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/glide/zipball/8759b8edfe953c8e6aceb45b3647fb7ae5349a0c", - "reference": "8759b8edfe953c8e6aceb45b3647fb7ae5349a0c", + "url": "https://api.github.com/repos/thephpleague/glide/zipball/ae5e26700573cb678919d28e425a8b87bc71c546", + "reference": "ae5e26700573cb678919d28e425a8b87bc71c546", "shasum": "" }, "require": { "intervention/image": "^2.4", "league/flysystem": "^1.0", - "php": "^7.2", + "php": "^7.2|^8.0", "psr/http-message": "^1.0" }, "require-dev": { - "mockery/mockery": "^1.2", - "phpunit/php-token-stream": "^3.1", - "phpunit/phpunit": "^8.5" + "mockery/mockery": "^1.3.3", + "phpunit/php-token-stream": "^3.1|^4.0", + "phpunit/phpunit": "^8.5|^9.0" }, "type": "library", "extra": { @@ -2462,9 +2479,9 @@ ], "support": { "issues": "https://github.com/thephpleague/glide/issues", - "source": "https://github.com/thephpleague/glide/tree/1.6.0" + "source": "https://github.com/thephpleague/glide/tree/1.7.0" }, - "time": "2020-07-07T12:23:45+00:00" + "time": "2020-11-05T17:34:03+00:00" }, { "name": "league/mime-type-detection", @@ -3940,16 +3957,16 @@ }, { "name": "scrivo/highlight.php", - "version": "v9.18.1.4", + "version": "v9.18.1.5", "source": { "type": "git", "url": "https://github.com/scrivo/highlight.php.git", - "reference": "ee8007a215a27cb9c078e0328fb5de901d74ef9b" + "reference": "fa75a865928a4a5d49e5e77faca6bd2f2410baaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/ee8007a215a27cb9c078e0328fb5de901d74ef9b", - "reference": "ee8007a215a27cb9c078e0328fb5de901d74ef9b", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/fa75a865928a4a5d49e5e77faca6bd2f2410baaf", + "reference": "fa75a865928a4a5d49e5e77faca6bd2f2410baaf", "shasum": "" }, "require": { @@ -4015,7 +4032,7 @@ "type": "github" } ], - "time": "2020-11-01T04:06:53+00:00" + "time": "2020-11-22T06:07:40+00:00" }, { "name": "sensiolabs/security-checker", @@ -4071,27 +4088,27 @@ }, { "name": "spatie/browsershot", - "version": "3.40.1", + "version": "3.41.0", "source": { "type": "git", "url": "https://github.com/spatie/browsershot.git", - "reference": "7793556fdacaff56fcc45b0e45bb9f0f72a50803" + "reference": "2cc87d4dad788b372549cf856c773a7e5a8fcace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/7793556fdacaff56fcc45b0e45bb9f0f72a50803", - "reference": "7793556fdacaff56fcc45b0e45bb9f0f72a50803", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/2cc87d4dad788b372549cf856c773a7e5a8fcace", + "reference": "2cc87d4dad788b372549cf856c773a7e5a8fcace", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.4|^8.0", "spatie/image": "^1.5.3", "spatie/temporary-directory": "^1.1", - "symfony/process": "^4.2|^5.0" + "symfony/process": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^6.1|^7.5", - "spatie/phpunit-snapshot-assertions": "^1.0" + "phpunit/phpunit": "^9.0", + "spatie/phpunit-snapshot-assertions": "^4.2.3" }, "type": "library", "autoload": { @@ -4125,7 +4142,7 @@ ], "support": { "issues": "https://github.com/spatie/browsershot/issues", - "source": "https://github.com/spatie/browsershot/tree/3.40.1" + "source": "https://github.com/spatie/browsershot/tree/3.41.0" }, "funding": [ { @@ -4133,7 +4150,7 @@ "type": "github" } ], - "time": "2020-11-06T09:19:20+00:00" + "time": "2020-11-18T08:51:42+00:00" }, { "name": "spatie/commonmark-highlighter", @@ -4191,31 +4208,30 @@ }, { "name": "spatie/image", - "version": "1.7.6", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "74535b5fd67ace75840c00c408666660843e755e" + "reference": "65d615c1f604e479764f25525291d696041dfcea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/74535b5fd67ace75840c00c408666660843e755e", - "reference": "74535b5fd67ace75840c00c408666660843e755e", + "url": "https://api.github.com/repos/spatie/image/zipball/65d615c1f604e479764f25525291d696041dfcea", + "reference": "65d615c1f604e479764f25525291d696041dfcea", "shasum": "" }, "require": { "ext-exif": "*", "ext-mbstring": "*", - "league/glide": "^1.4", - "php": "^7.0", - "spatie/image-optimizer": "^1.0", - "spatie/temporary-directory": "^1.0.0", + "league/glide": "^1.6", + "php": "^7.2|^8.0", + "spatie/image-optimizer": "^1.1", + "spatie/temporary-directory": "^1.0", "symfony/process": "^3.0|^4.0|^5.0" }, "require-dev": { - "larapack/dd": "^1.1", - "phpunit/phpunit": "^6.0|^7.0", - "symfony/var-dumper": "^3.2|^5.0" + "phpunit/phpunit": "^8.0|^9.0", + "symfony/var-dumper": "^4.0|^5.0" }, "type": "library", "autoload": { @@ -4243,32 +4259,42 @@ ], "support": { "issues": "https://github.com/spatie/image/issues", - "source": "https://github.com/spatie/image/tree/master" + "source": "https://github.com/spatie/image/tree/1.10.0" }, - "time": "2020-01-26T18:56:44+00:00" + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2020-11-27T14:44:09+00:00" }, { "name": "spatie/image-optimizer", - "version": "1.2.1", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/spatie/image-optimizer.git", - "reference": "9c1d470e34b28b715d25edb539dd6c899461527c" + "reference": "b622d0cf29f57d7735d49f2b62471e6b788cb291" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/9c1d470e34b28b715d25edb539dd6c899461527c", - "reference": "9c1d470e34b28b715d25edb539dd6c899461527c", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/b622d0cf29f57d7735d49f2b62471e6b788cb291", + "reference": "b622d0cf29f57d7735d49f2b62471e6b788cb291", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2", + "php": "^7.2|^8.0", "psr/log": "^1.0", "symfony/process": "^4.2|^5.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^8.0|^9.0", "symfony/var-dumper": "^4.2|^5.0" }, "type": "library", @@ -4297,29 +4323,29 @@ ], "support": { "issues": "https://github.com/spatie/image-optimizer/issues", - "source": "https://github.com/spatie/image-optimizer/tree/master" + "source": "https://github.com/spatie/image-optimizer/tree/1.3.1" }, - "time": "2019-11-25T12:29:24+00:00" + "time": "2020-11-20T11:36:11+00:00" }, { "name": "spatie/temporary-directory", - "version": "1.2.4", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/spatie/temporary-directory.git", - "reference": "8efe8e61e0ca943d84341f10e51ef3a9606af932" + "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/8efe8e61e0ca943d84341f10e51ef3a9606af932", - "reference": "8efe8e61e0ca943d84341f10e51ef3a9606af932", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/f517729b3793bca58f847c5fd383ec16f03ffec6", + "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.2|^8.0" }, "require-dev": { - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0|^9.0" }, "type": "library", "autoload": { @@ -4342,14 +4368,15 @@ "description": "Easily create, use and destroy temporary directories", "homepage": "https://github.com/spatie/temporary-directory", "keywords": [ + "php", "spatie", "temporary-directory" ], "support": { "issues": "https://github.com/spatie/temporary-directory/issues", - "source": "https://github.com/spatie/temporary-directory/tree/master" + "source": "https://github.com/spatie/temporary-directory/tree/1.3.0" }, - "time": "2020-09-07T20:41:15+00:00" + "time": "2020-11-09T15:54:21+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -6839,23 +6866,23 @@ }, { "name": "voku/portable-ascii", - "version": "1.5.3", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "25bcbf01678930251fd572891447d9e318a6e2b8" + "reference": "80953678b19901e5165c56752d087fc11526017c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/25bcbf01678930251fd572891447d9e318a6e2b8", - "reference": "25bcbf01678930251fd572891447d9e318a6e2b8", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", + "reference": "80953678b19901e5165c56752d087fc11526017c", "shasum": "" }, "require": { "php": ">=7.0.0" }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0" + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" }, "suggest": { "ext-intl": "Use Intl for transliterator_transliterate() support" @@ -6885,7 +6912,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/master" + "source": "https://github.com/voku/portable-ascii/tree/1.5.6" }, "funding": [ { @@ -6909,7 +6936,60 @@ "type": "tidelift" } ], - "time": "2020-07-22T23:32:04+00:00" + "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, + "time": "2020-07-08T17:02:28+00:00" } ], "packages-dev": [ @@ -7432,16 +7512,16 @@ }, { "name": "composer/composer", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d5789bd8e2d852a6b98fe944ca2ff82e921eb43d" + "reference": "cbee637510037f293e641857b2a6223d0ea8008d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d5789bd8e2d852a6b98fe944ca2ff82e921eb43d", - "reference": "d5789bd8e2d852a6b98fe944ca2ff82e921eb43d", + "url": "https://api.github.com/repos/composer/composer/zipball/cbee637510037f293e641857b2a6223d0ea8008d", + "reference": "cbee637510037f293e641857b2a6223d0ea8008d", "shasum": "" }, "require": { @@ -7509,7 +7589,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.0.6" + "source": "https://github.com/composer/composer/tree/2.0.7" }, "funding": [ { @@ -7525,20 +7605,20 @@ "type": "tidelift" } ], - "time": "2020-11-07T10:21:17+00:00" + "time": "2020-11-13T16:31:06+00:00" }, { "name": "composer/package-versions-deprecated", - "version": "1.11.99", + "version": "1.11.99.1", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855" + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", - "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", "shasum": "" }, "require": { @@ -7582,7 +7662,7 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/master" + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" }, "funding": [ { @@ -7598,27 +7678,27 @@ "type": "tidelift" } ], - "time": "2020-08-25T05:50:16+00:00" + "time": "2020-11-11T10:22:58+00:00" }, { "name": "composer/semver", - "version": "3.2.2", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.19", + "phpstan/phpstan": "^0.12.54", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -7663,7 +7743,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.2" + "source": "https://github.com/composer/semver/tree/3.2.4" }, "funding": [ { @@ -7679,7 +7759,7 @@ "type": "tidelift" } ], - "time": "2020-10-14T08:51:15+00:00" + "time": "2020-11-13T08:59:24+00:00" }, { "name": "composer/spdx-licenses", @@ -7762,16 +7842,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.4", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + "reference": "f28d44c286812c714741478d968104c5e604a1d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", + "reference": "f28d44c286812c714741478d968104c5e604a1d4", "shasum": "" }, "require": { @@ -7805,7 +7885,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" + "source": "https://github.com/composer/xdebug-handler/tree/1.4.5" }, "funding": [ { @@ -7821,7 +7901,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:39:10+00:00" + "time": "2020-11-13T08:04:11+00:00" }, { "name": "doctrine/cache", @@ -7925,16 +8005,16 @@ }, { "name": "doctrine/dbal", - "version": "2.12.0", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "c6d37b4c42aaa3c3ee175f05eca68056f4185646" + "reference": "adce7a954a1c2f14f85e94aed90c8489af204086" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/c6d37b4c42aaa3c3ee175f05eca68056f4185646", - "reference": "c6d37b4c42aaa3c3ee175f05eca68056f4185646", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/adce7a954a1c2f14f85e94aed90c8489af204086", + "reference": "adce7a954a1c2f14f85e94aed90c8489af204086", "shasum": "" }, "require": { @@ -8016,7 +8096,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.12.0" + "source": "https://github.com/doctrine/dbal/tree/2.12.1" }, "funding": [ { @@ -8032,7 +8112,7 @@ "type": "tidelift" } ], - "time": "2020-10-22T17:26:24+00:00" + "time": "2020-11-14T20:26:58+00:00" }, { "name": "doctrine/event-manager", @@ -8130,36 +8210,31 @@ }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -8173,7 +8248,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -8184,7 +8259,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.3.x" + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" }, "funding": [ { @@ -8200,7 +8275,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T17:27:14+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "facade/flare-client-php", @@ -8269,16 +8344,16 @@ }, { "name": "facade/ignition", - "version": "2.5.0", + "version": "2.5.2", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "81698c5e32837c74abf9bb764ff0c1b3e001afb3" + "reference": "08668034beb185fa2ac6f09b1034eaa440952ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/81698c5e32837c74abf9bb764ff0c1b3e001afb3", - "reference": "81698c5e32837c74abf9bb764ff0c1b3e001afb3", + "url": "https://api.github.com/repos/facade/ignition/zipball/08668034beb185fa2ac6f09b1034eaa440952ace", + "reference": "08668034beb185fa2ac6f09b1034eaa440952ace", "shasum": "" }, "require": { @@ -8342,7 +8417,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2020-10-27T13:02:22+00:00" + "time": "2020-11-17T09:18:51+00:00" }, { "name": "facade/ignition-contracts", @@ -8741,16 +8816,16 @@ }, { "name": "laravel/dusk", - "version": "v6.8.0", + "version": "v6.9.1", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "3dd0f1fc383a7fb93e4e0f02d83f9507d9a80a15" + "reference": "13b22f13f4f18f9524e523ec5f06bbb3b2b3fdd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/3dd0f1fc383a7fb93e4e0f02d83f9507d9a80a15", - "reference": "3dd0f1fc383a7fb93e4e0f02d83f9507d9a80a15", + "url": "https://api.github.com/repos/laravel/dusk/zipball/13b22f13f4f18f9524e523ec5f06bbb3b2b3fdd9", + "reference": "13b22f13f4f18f9524e523ec5f06bbb3b2b3fdd9", "shasum": "" }, "require": { @@ -8759,8 +8834,8 @@ "illuminate/console": "^6.0|^7.0|^8.0", "illuminate/support": "^6.0|^7.0|^8.0", "nesbot/carbon": "^2.0", - "php": "^7.2", - "php-webdriver/webdriver": "^1.8.1", + "php": "^7.2|^8.0", + "php-webdriver/webdriver": "^1.9.0", "symfony/console": "^4.3|^5.0", "symfony/finder": "^4.3|^5.0", "symfony/process": "^4.3|^5.0", @@ -8807,9 +8882,9 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.8.0" + "source": "https://github.com/laravel/dusk/tree/v6.9.1" }, - "time": "2020-10-06T15:32:20+00:00" + "time": "2020-11-24T16:48:27+00:00" }, { "name": "maximebf/debugbar", @@ -8950,16 +9025,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -8996,7 +9071,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" }, "funding": [ { @@ -9004,7 +9079,7 @@ "type": "tidelift" } ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "netresearch/jsonmapper", @@ -9311,23 +9386,23 @@ }, { "name": "php-webdriver/webdriver", - "version": "1.8.3", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "fb0fc4cb01c70a7790a5fcc91d461b88c83174a2" + "reference": "e3633154554605274cc9d59837f55a7427d72003" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/fb0fc4cb01c70a7790a5fcc91d461b88c83174a2", - "reference": "fb0fc4cb01c70a7790a5fcc91d461b88c83174a2", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/e3633154554605274cc9d59837f55a7427d72003", + "reference": "e3633154554605274cc9d59837f55a7427d72003", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", "ext-zip": "*", - "php": "^5.6 || ~7.0", + "php": "^5.6 || ~7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.12", "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0" }, @@ -9337,12 +9412,10 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", "ondram/ci-detector": "^2.1 || ^3.5", - "php-coveralls/php-coveralls": "^2.0", - "php-mock/php-mock-phpunit": "^1.1", + "php-coveralls/php-coveralls": "^2.4", + "php-mock/php-mock-phpunit": "^1.1 || ^2.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpunit/phpunit": "^5.7", - "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", - "sminnee/phpunit-mock-objects": "^3.4", + "phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", "squizlabs/php_codesniffer": "^3.5", "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0" }, @@ -9378,9 +9451,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.8.3" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.9.0" }, - "time": "2020-10-06T19:10:04+00:00" + "time": "2020-11-19T15:21:05+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9609,16 +9682,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.3", + "version": "9.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41" + "reference": "0a7f0acf9269c190fd982b5c04423feae986b6e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b20e2055f7c29b56cb3870b3de7cc463d7add41", - "reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0a7f0acf9269c190fd982b5c04423feae986b6e0", + "reference": "0a7f0acf9269c190fd982b5c04423feae986b6e0", "shasum": "" }, "require": { @@ -9674,7 +9747,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.3" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.4" }, "funding": [ { @@ -9682,7 +9755,7 @@ "type": "github" } ], - "time": "2020-10-30T10:46:41+00:00" + "time": "2020-11-27T06:15:15+00:00" }, { "name": "phpunit/php-file-iterator", @@ -9927,16 +10000,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.4.2", + "version": "9.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa" + "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", - "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", + "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", "shasum": "" }, "require": { @@ -10014,7 +10087,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.3" }, "funding": [ { @@ -10026,7 +10099,7 @@ "type": "github" } ], - "time": "2020-10-19T09:23:29+00:00" + "time": "2020-11-10T12:53:30+00:00" }, { "name": "react/promise", @@ -11044,16 +11117,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", "shasum": "" }, "require": { @@ -11091,7 +11164,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/master" + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" }, "funding": [ { @@ -11103,7 +11176,7 @@ "type": "tidelift" } ], - "time": "2020-08-25T06:56:57+00:00" + "time": "2020-11-11T09:19:24+00:00" }, { "name": "seld/phar-utils", @@ -11336,16 +11409,16 @@ }, { "name": "vimeo/psalm", - "version": "4.1.1", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "16bfbd9224698bd738c665f33039fade2a1a3977" + "reference": "ea9cb72143b77e7520c52fa37290bd8d8bc88fd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/16bfbd9224698bd738c665f33039fade2a1a3977", - "reference": "16bfbd9224698bd738c665f33039fade2a1a3977", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/ea9cb72143b77e7520c52fa37290bd8d8bc88fd9", + "reference": "ea9cb72143b77e7520c52fa37290bd8d8bc88fd9", "shasum": "" }, "require": { @@ -11435,62 +11508,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.1.1" + "source": "https://github.com/vimeo/psalm/tree/4.2.1" }, - "time": "2020-11-02T05:54:12+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2020-11-20T14:56:53+00:00" }, { "name": "webmozart/path-util", diff --git a/config/image.php b/config/image.php index 32ab36a8..67983819 100644 --- a/config/image.php +++ b/config/image.php @@ -15,6 +15,6 @@ return [ | */ - 'driver' => 'imagick', + 'driver' => 'gd', ]; diff --git a/tests/Feature/MicropubControllerTest.php b/tests/Feature/MicropubControllerTest.php index e1bbed3d..6a4941e8 100644 --- a/tests/Feature/MicropubControllerTest.php +++ b/tests/Feature/MicropubControllerTest.php @@ -5,19 +5,16 @@ namespace Tests\Feature; use Carbon\Carbon; use Tests\TestCase; use Tests\TestToken; -use App\Jobs\ProcessMedia; use App\Jobs\SendWebMentions; use App\Models\{Media, Place}; -use Illuminate\Http\UploadedFile; use App\Jobs\SyndicateNoteToTwitter; use Illuminate\Support\Facades\Queue; -use Illuminate\Support\Facades\Storage; -use MStaack\LaravelPostgis\Geometries\Point; use Illuminate\Foundation\Testing\DatabaseTransactions; class MicropubControllerTest extends TestCase { - use DatabaseTransactions, TestToken; + use DatabaseTransactions; + use TestToken; /** * Test a GET request for the micropub endpoint without a token gives a diff --git a/tests/TestToken.php b/tests/TestToken.php index b34db254..1e9e7c42 100644 --- a/tests/TestToken.php +++ b/tests/TestToken.php @@ -2,50 +2,47 @@ namespace Tests; -use Lcobucci\JWT\Builder; -use Lcobucci\JWT\Signer\Hmac\Sha256; +use DateTimeImmutable; +use Lcobucci\JWT\Configuration; trait TestToken { public function getToken() { - $signer = new Sha256(); - $token = (new Builder()) - ->set('client_id', 'https://quill.p3k.io') - ->set('me', 'https://jonnybarnes.localhost') - ->set('scope', 'create update') - ->set('issued_at', time()) - ->sign($signer, env('APP_KEY')) - ->getToken(); + $config = $this->app->make(Configuration::class); - return $token; + return $config->builder() + ->issuedAt(new DateTimeImmutable()) + ->withClaim('client_id', 'https://quill.p3k.io') + ->withClaim('me', 'https://jonnybarnes.localhost') + ->withClaim('scope', 'create update') + ->getToken($config->signer(), $config->signingKey()) + ->toString(); } public function getTokenWithIncorrectScope() { - $signer = new Sha256(); - $token = (new Builder()) - ->set('client_id', 'https://quill.p3k.io') - ->set('me', 'https://jonnybarnes.localhost') - ->set('scope', 'view') //error here - ->set('issued_at', time()) - ->sign($signer, env('APP_KEY')) - ->getToken(); + $config = $this->app->make(Configuration::class); - return $token; + return $config->builder() + ->issuedAt(new DateTimeImmutable()) + ->withClaim('client_id', 'https://quill.p3k.io') + ->withClaim('me', 'https://jonnybarnes.localhost') + ->withClaim('scope', 'view') + ->getToken($config->signer(), $config->signingKey()) + ->toString(); } public function getTokenWithNoScope() { - $signer = new Sha256(); - $token = (new Builder()) - ->set('client_id', 'https://quill.p3k.io') - ->set('me', 'https://jonnybarnes.localhost') - ->set('issued_at', time()) - ->sign($signer, env('APP_KEY')) - ->getToken(); + $config = $this->app->make(Configuration::class); - return $token; + return $config->builder() + ->issuedAt(new DateTimeImmutable()) + ->withClaim('client_id', 'https://quill.p3k.io') + ->withClaim('me', 'https://jonnybarnes.localhost') + ->getToken($config->signer(), $config->signingKey()) + ->toString(); } public function getInvalidToken()