Merge pull request #1474 from jonnybarnes/develop

MTM Fix scope checks
This commit is contained in:
Jonny Barnes 2024-07-13 15:20:46 +01:00 committed by GitHub
commit b7d7db60e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 120 additions and 111 deletions

View file

@ -2,6 +2,4 @@
namespace App\Exceptions; namespace App\Exceptions;
class InternetArchiveException extends \Exception class InternetArchiveException extends \Exception {}
{
}

View file

@ -67,7 +67,12 @@ class MicropubController extends Controller
$this->logMicropubRequest($request->all()); $this->logMicropubRequest($request->all());
if (($request->input('h') === 'entry') || ($request->input('type.0') === 'h-entry')) { if (($request->input('h') === 'entry') || ($request->input('type.0') === 'h-entry')) {
if (stripos($tokenData->claims()->get('scope'), 'create') === false) { $scopes = $tokenData->claims()->get('scope');
if (is_string($scopes)) {
$scopes = explode(' ', $scopes);
}
if (! in_array('create', $scopes)) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();
@ -81,7 +86,11 @@ class MicropubController extends Controller
} }
if ($request->input('h') === 'card' || $request->input('type.0') === 'h-card') { if ($request->input('h') === 'card' || $request->input('type.0') === 'h-card') {
if (stripos($tokenData->claims()->get('scope'), 'create') === false) { $scopes = $tokenData->claims()->get('scope');
if (is_string($scopes)) {
$scopes = explode(' ', $scopes);
}
if (! in_array('create', $scopes)) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();
@ -95,7 +104,11 @@ class MicropubController extends Controller
} }
if ($request->input('action') === 'update') { if ($request->input('action') === 'update') {
if (stripos($tokenData->claims()->get('scope'), 'update') === false) { $scopes = $tokenData->claims()->get('scope');
if (is_string($scopes)) {
$scopes = explode(' ', $scopes);
}
if (! in_array('update', $scopes)) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();

View file

@ -17,7 +17,6 @@ use Illuminate\Http\Response;
use Illuminate\Http\UploadedFile; use Illuminate\Http\UploadedFile;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Intervention\Image\ImageManager; use Intervention\Image\ImageManager;
use Lcobucci\JWT\Token\InvalidTokenStructure; use Lcobucci\JWT\Token\InvalidTokenStructure;
use Lcobucci\JWT\Validation\RequiredConstraintsViolated; use Lcobucci\JWT\Validation\RequiredConstraintsViolated;
@ -51,7 +50,11 @@ class MicropubMediaController extends Controller
return $micropubResponses->tokenHasNoScopeResponse(); return $micropubResponses->tokenHasNoScopeResponse();
} }
if (Str::contains($tokenData->claims()->get('scope'), 'create') === false) { $scopes = $tokenData->claims()->get('scope');
if (is_string($scopes)) {
$scopes = explode(' ', $scopes);
}
if (! in_array('create', $scopes)) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();
@ -119,7 +122,11 @@ class MicropubMediaController extends Controller
return $micropubResponses->tokenHasNoScopeResponse(); return $micropubResponses->tokenHasNoScopeResponse();
} }
if (Str::contains($tokenData->claims()->get('scope'), 'create') === false) { $scopes = $tokenData->claims()->get('scope');
if (is_string($scopes)) {
$scopes = explode(' ', $scopes);
}
if (! in_array('create', $scopes)) {
$micropubResponses = new MicropubResponses(); $micropubResponses = new MicropubResponses();
return $micropubResponses->insufficientScopeResponse(); return $micropubResponses->insufficientScopeResponse();

View file

@ -24,8 +24,7 @@ class DownloadWebMention implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected string $source protected string $source
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -25,8 +25,7 @@ class ProcessBookmark implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Bookmark $bookmark protected Bookmark $bookmark
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -30,8 +30,7 @@ class ProcessLike implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Like $like protected Like $like
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -25,8 +25,7 @@ class ProcessMedia implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected string $filename protected string $filename
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -30,8 +30,7 @@ class ProcessWebMention implements ShouldQueue
public function __construct( public function __construct(
protected Note $note, protected Note $note,
protected string $source protected string $source
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -25,8 +25,7 @@ class SaveProfileImage implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected array $microformats protected array $microformats
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -23,8 +23,7 @@ class SaveScreenshot implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Bookmark $bookmark protected Bookmark $bookmark
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -27,8 +27,7 @@ class SendWebMentions implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Note $note protected Note $note
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -22,8 +22,7 @@ class SyndicateNoteToBluesky implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Note $note protected Note $note
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

View file

@ -22,8 +22,7 @@ class SyndicateNoteToMastodon implements ShouldQueue
*/ */
public function __construct( public function __construct(
protected Note $note protected Note $note
) { ) {}
}
/** /**
* Execute the job. * Execute the job.

101
composer.lock generated
View file

@ -585,16 +585,16 @@
}, },
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",
"version": "v3.0.2", "version": "v3.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dflydev/dflydev-dot-access-data.git", "url": "https://github.com/dflydev/dflydev-dot-access-data.git",
"reference": "f41715465d65213d644d3141a6a93081be5d3549" "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f",
"reference": "f41715465d65213d644d3141a6a93081be5d3549", "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -654,9 +654,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3"
}, },
"time": "2022-10-27T11:44:00+00:00" "time": "2024-07-08T12:26:09+00:00"
}, },
{ {
"name": "doctrine/deprecations", "name": "doctrine/deprecations",
@ -1999,16 +1999,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v11.13.0", "version": "v11.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "92deaa4f037ff100e36809443811301819a8cf84" "reference": "ba85f1c019bed59b3c736c9c4502805efd0ba84b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/92deaa4f037ff100e36809443811301819a8cf84", "url": "https://api.github.com/repos/laravel/framework/zipball/ba85f1c019bed59b3c736c9c4502805efd0ba84b",
"reference": "92deaa4f037ff100e36809443811301819a8cf84", "reference": "ba85f1c019bed59b3c736c9c4502805efd0ba84b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2061,6 +2061,7 @@
}, },
"provide": { "provide": {
"psr/container-implementation": "1.1|2.0", "psr/container-implementation": "1.1|2.0",
"psr/log-implementation": "1.0|2.0|3.0",
"psr/simple-cache-implementation": "1.0|2.0|3.0" "psr/simple-cache-implementation": "1.0|2.0|3.0"
}, },
"replace": { "replace": {
@ -2113,7 +2114,7 @@
"nyholm/psr7": "^1.2", "nyholm/psr7": "^1.2",
"orchestra/testbench-core": "^9.1.5", "orchestra/testbench-core": "^9.1.5",
"pda/pheanstalk": "^5.0", "pda/pheanstalk": "^5.0",
"phpstan/phpstan": "^1.4.7", "phpstan/phpstan": "^1.11.5",
"phpunit/phpunit": "^10.5|^11.0", "phpunit/phpunit": "^10.5|^11.0",
"predis/predis": "^2.0.2", "predis/predis": "^2.0.2",
"resend/resend-php": "^0.10.0", "resend/resend-php": "^0.10.0",
@ -2200,7 +2201,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2024-06-27T09:04:50+00:00" "time": "2024-07-09T15:38:12+00:00"
}, },
{ {
"name": "laravel/horizon", "name": "laravel/horizon",
@ -2405,16 +2406,16 @@
}, },
{ {
"name": "laravel/scout", "name": "laravel/scout",
"version": "v10.9.0", "version": "v10.10.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/scout.git", "url": "https://github.com/laravel/scout.git",
"reference": "7bac13a61f1670b4314a65a13b8b12c6575270c8" "reference": "b8f429f0be3a023ec182839a9b58d4aa5f903bbb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/scout/zipball/7bac13a61f1670b4314a65a13b8b12c6575270c8", "url": "https://api.github.com/repos/laravel/scout/zipball/b8f429f0be3a023ec182839a9b58d4aa5f903bbb",
"reference": "7bac13a61f1670b4314a65a13b8b12c6575270c8", "reference": "b8f429f0be3a023ec182839a9b58d4aa5f903bbb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2479,7 +2480,7 @@
"issues": "https://github.com/laravel/scout/issues", "issues": "https://github.com/laravel/scout/issues",
"source": "https://github.com/laravel/scout" "source": "https://github.com/laravel/scout"
}, },
"time": "2024-05-07T14:16:56+00:00" "time": "2024-07-02T18:13:16+00:00"
}, },
{ {
"name": "laravel/serializable-closure", "name": "laravel/serializable-closure",
@ -7903,16 +7904,16 @@
}, },
{ {
"name": "symfony/serializer", "name": "symfony/serializer",
"version": "v7.1.1", "version": "v7.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/serializer.git", "url": "https://github.com/symfony/serializer.git",
"reference": "74817ee48e37cce1a1b33c66ffdb750e7e048c3c" "reference": "d2077674aaaff02a95f290de512aa358947e6bbe"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/serializer/zipball/74817ee48e37cce1a1b33c66ffdb750e7e048c3c", "url": "https://api.github.com/repos/symfony/serializer/zipball/d2077674aaaff02a95f290de512aa358947e6bbe",
"reference": "74817ee48e37cce1a1b33c66ffdb750e7e048c3c", "reference": "d2077674aaaff02a95f290de512aa358947e6bbe",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7980,7 +7981,7 @@
"description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/serializer/tree/v7.1.1" "source": "https://github.com/symfony/serializer/tree/v7.1.2"
}, },
"funding": [ "funding": [
{ {
@ -7996,7 +7997,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T14:57:53+00:00" "time": "2024-06-28T07:42:43+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@ -10242,16 +10243,16 @@
}, },
{ {
"name": "laravel/pint", "name": "laravel/pint",
"version": "v1.15.0", "version": "v1.16.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/pint.git", "url": "https://github.com/laravel/pint.git",
"reference": "c52de679b3ac01207016c179d7ce173e4be128c4" "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/c52de679b3ac01207016c179d7ce173e4be128c4", "url": "https://api.github.com/repos/laravel/pint/zipball/51f1ba679a6afe0315621ad143d788bd7ded0eca",
"reference": "c52de679b3ac01207016c179d7ce173e4be128c4", "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10262,13 +10263,13 @@
"php": "^8.1.0" "php": "^8.1.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^3.49.0", "friendsofphp/php-cs-fixer": "^3.59.3",
"illuminate/view": "^10.43.0", "illuminate/view": "^10.48.12",
"larastan/larastan": "^2.8.1", "larastan/larastan": "^2.9.7",
"laravel-zero/framework": "^10.3.0", "laravel-zero/framework": "^10.4.0",
"mockery/mockery": "^1.6.7", "mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^1.15.1", "nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.33.6" "pestphp/pest": "^2.34.8"
}, },
"bin": [ "bin": [
"builds/pint" "builds/pint"
@ -10304,20 +10305,20 @@
"issues": "https://github.com/laravel/pint/issues", "issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint" "source": "https://github.com/laravel/pint"
}, },
"time": "2024-03-26T16:40:24+00:00" "time": "2024-07-09T15:58:08+00:00"
}, },
{ {
"name": "laravel/sail", "name": "laravel/sail",
"version": "v1.29.3", "version": "v1.30.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/sail.git", "url": "https://github.com/laravel/sail.git",
"reference": "e35b3ffe1b9ea598246d7e99197ee8799f6dc2e5" "reference": "f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/e35b3ffe1b9ea598246d7e99197ee8799f6dc2e5", "url": "https://api.github.com/repos/laravel/sail/zipball/f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887",
"reference": "e35b3ffe1b9ea598246d7e99197ee8799f6dc2e5", "reference": "f5a9699a1001e15de1aa5e7cb5c9f50a3f63f887",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -10367,7 +10368,7 @@
"issues": "https://github.com/laravel/sail/issues", "issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail" "source": "https://github.com/laravel/sail"
}, },
"time": "2024-06-12T16:24:41+00:00" "time": "2024-07-05T16:01:51+00:00"
}, },
{ {
"name": "maximebf/debugbar", "name": "maximebf/debugbar",
@ -13099,16 +13100,16 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v7.1.1", "version": "v7.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "802e87002f919296c9f606457d9fa327a0b3d6b2" "reference": "92a91985250c251de9b947a14bb2c9390b1a562c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2", "url": "https://api.github.com/repos/symfony/filesystem/zipball/92a91985250c251de9b947a14bb2c9390b1a562c",
"reference": "802e87002f919296c9f606457d9fa327a0b3d6b2", "reference": "92a91985250c251de9b947a14bb2c9390b1a562c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13145,7 +13146,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v7.1.1" "source": "https://github.com/symfony/filesystem/tree/v7.1.2"
}, },
"funding": [ "funding": [
{ {
@ -13161,7 +13162,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T14:57:53+00:00" "time": "2024-06-28T10:03:55+00:00"
}, },
{ {
"name": "symfony/polyfill-iconv", "name": "symfony/polyfill-iconv",
@ -13428,16 +13429,16 @@
}, },
{ {
"name": "vimeo/psalm", "name": "vimeo/psalm",
"version": "5.24.0", "version": "5.25.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vimeo/psalm.git", "url": "https://github.com/vimeo/psalm.git",
"reference": "462c80e31c34e58cc4f750c656be3927e80e550e" "reference": "01a8eb06b9e9cc6cfb6a320bf9fb14331919d505"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/462c80e31c34e58cc4f750c656be3927e80e550e", "url": "https://api.github.com/repos/vimeo/psalm/zipball/01a8eb06b9e9cc6cfb6a320bf9fb14331919d505",
"reference": "462c80e31c34e58cc4f750c656be3927e80e550e", "reference": "01a8eb06b9e9cc6cfb6a320bf9fb14331919d505",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -13534,7 +13535,7 @@
"issues": "https://github.com/vimeo/psalm/issues", "issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm" "source": "https://github.com/vimeo/psalm"
}, },
"time": "2024-05-01T19:32:08+00:00" "time": "2024-06-16T15:08:35+00:00"
}, },
{ {
"name": "zbateson/mail-mime-parser", "name": "zbateson/mail-mime-parser",

View file

@ -26,7 +26,7 @@ services:
- pgsql - pgsql
- redis - redis
pgsql: pgsql:
image: 'postgres:14' image: 'postgres:16'
ports: ports:
- '${FORWARD_DB_PORT:-5432}:5432' - '${FORWARD_DB_PORT:-5432}:5432'
environment: environment:

52
package-lock.json generated
View file

@ -13,10 +13,10 @@
"@zachleat/snow-fall": "^1.0.2" "@zachleat/snow-fall": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.4.0", "@eslint/js": "^9.6.0",
"@stylistic/eslint-plugin": "^2.3.0", "@stylistic/eslint-plugin": "^2.3.0",
"eslint": "^9.5.0", "eslint": "^9.6.0",
"globals": "^15.6.0", "globals": "^15.8.0",
"stylelint": "^16.6.1", "stylelint": "^16.6.1",
"stylelint-config-standard": "^36.0.1" "stylelint-config-standard": "^36.0.1"
} }
@ -338,14 +338,14 @@
} }
}, },
"node_modules/@eslint/config-array": { "node_modules/@eslint/config-array": {
"version": "0.16.0", "version": "0.17.0",
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.0.tgz",
"integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", "integrity": "sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint/object-schema": "^2.1.4", "@eslint/object-schema": "^2.1.4",
"debug": "^4.3.1", "debug": "^4.3.1",
"minimatch": "^3.0.5" "minimatch": "^3.1.2"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -387,9 +387,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "9.5.0", "version": "9.6.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.6.0.tgz",
"integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", "integrity": "sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -745,9 +745,9 @@
"integrity": "sha512-nyNeliowryq+roSMktyV3o14DduSuU4BvBzruVSPV6e8U8Eid2zNzSj1AzCQByPId7Q4MrIP2QWL2UHeHGfmcA==" "integrity": "sha512-nyNeliowryq+roSMktyV3o14DduSuU4BvBzruVSPV6e8U8Eid2zNzSj1AzCQByPId7Q4MrIP2QWL2UHeHGfmcA=="
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.11.3", "version": "8.12.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==",
"dev": true, "dev": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
@ -1058,16 +1058,16 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "9.5.0", "version": "9.6.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.6.0.tgz",
"integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", "integrity": "sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1", "@eslint-community/regexpp": "^4.6.1",
"@eslint/config-array": "^0.16.0", "@eslint/config-array": "^0.17.0",
"@eslint/eslintrc": "^3.1.0", "@eslint/eslintrc": "^3.1.0",
"@eslint/js": "9.5.0", "@eslint/js": "9.6.0",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@humanwhocodes/retry": "^0.3.0", "@humanwhocodes/retry": "^0.3.0",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
@ -1078,7 +1078,7 @@
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"eslint-scope": "^8.0.1", "eslint-scope": "^8.0.1",
"eslint-visitor-keys": "^4.0.0", "eslint-visitor-keys": "^4.0.0",
"espree": "^10.0.1", "espree": "^10.1.0",
"esquery": "^1.5.0", "esquery": "^1.5.0",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
@ -1149,12 +1149,12 @@
} }
}, },
"node_modules/espree": { "node_modules/espree": {
"version": "10.0.1", "version": "10.1.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz",
"integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"acorn": "^8.11.3", "acorn": "^8.12.0",
"acorn-jsx": "^5.3.2", "acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^4.0.0" "eslint-visitor-keys": "^4.0.0"
}, },
@ -1393,9 +1393,9 @@
} }
}, },
"node_modules/globals": { "node_modules/globals": {
"version": "15.6.0", "version": "15.8.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-15.6.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-15.8.0.tgz",
"integrity": "sha512-UzcJi88Hw//CurUIRa9Jxb0vgOCcuD/MNjwmXp633cyaRKkCWACkoqHCtfZv43b1kqXGg/fpOa8bwgacCeXsVg==", "integrity": "sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"

View file

@ -6,10 +6,10 @@
"repository": "https://github.com/jonnybarnes/jonnybarnes.uk", "repository": "https://github.com/jonnybarnes/jonnybarnes.uk",
"license": "CC0-1.0", "license": "CC0-1.0",
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.4.0", "@eslint/js": "^9.6.0",
"@stylistic/eslint-plugin": "^2.3.0", "@stylistic/eslint-plugin": "^2.3.0",
"eslint": "^9.5.0", "eslint": "^9.6.0",
"globals": "^15.6.0", "globals": "^15.8.0",
"stylelint": "^16.6.1", "stylelint": "^16.6.1",
"stylelint-config-standard": "^36.0.1" "stylelint-config-standard": "^36.0.1"
}, },

View file

@ -14,8 +14,8 @@ trait TestToken
return $config->builder() return $config->builder()
->issuedAt(new DateTimeImmutable()) ->issuedAt(new DateTimeImmutable())
->withClaim('client_id', 'https://quill.p3k.io') ->withClaim('client_id', 'https://quill.p3k.io')
->withClaim('me', 'https://jonnybarnes.localhost') ->withClaim('me', 'http://jonnybarnes.localhost')
->withClaim('scope', 'create update') ->withClaim('scope', ['create', 'update'])
->getToken($config->signer(), $config->signingKey()) ->getToken($config->signer(), $config->signingKey())
->toString(); ->toString();
} }