Phase 8 Mobil: REST-API, Web-Push, installierbare App (0.25.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m54s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m54s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m50s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m38s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m56s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 7m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m54s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m54s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m50s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m38s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m56s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 7m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
232dc5c59c
commit
f11a3e24b3
201 changed files with 3604 additions and 427 deletions
29
vendor/composer/autoload_classmap.php
vendored
29
vendor/composer/autoload_classmap.php
vendored
|
|
@ -66,6 +66,10 @@ return array(
|
|||
'App\\Filament\\Resources\\Users\\Tables\\UsersTable' => $baseDir . '/app/Filament/Resources/Users/Tables/UsersTable.php',
|
||||
'App\\Filament\\Resources\\Users\\UserResource' => $baseDir . '/app/Filament/Resources/Users/UserResource.php',
|
||||
'App\\Http\\Controllers\\Admin\\UpdateController' => $baseDir . '/app/Http/Controllers/Admin/UpdateController.php',
|
||||
'App\\Http\\Controllers\\Api\\AuthController' => $baseDir . '/app/Http/Controllers/Api/AuthController.php',
|
||||
'App\\Http\\Controllers\\Api\\NotificationController' => $baseDir . '/app/Http/Controllers/Api/NotificationController.php',
|
||||
'App\\Http\\Controllers\\Api\\PeopleController' => $baseDir . '/app/Http/Controllers/Api/PeopleController.php',
|
||||
'App\\Http\\Controllers\\Api\\SearchController' => $baseDir . '/app/Http/Controllers/Api/SearchController.php',
|
||||
'App\\Http\\Controllers\\AppearanceController' => $baseDir . '/app/Http/Controllers/AppearanceController.php',
|
||||
'App\\Http\\Controllers\\Auth\\IdentityLoginController' => $baseDir . '/app/Http/Controllers/Auth/IdentityLoginController.php',
|
||||
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
|
||||
|
|
@ -79,6 +83,7 @@ return array(
|
|||
'App\\Http\\Controllers\\PeopleController' => $baseDir . '/app/Http/Controllers/PeopleController.php',
|
||||
'App\\Http\\Controllers\\PluginAssetController' => $baseDir . '/app/Http/Controllers/PluginAssetController.php',
|
||||
'App\\Http\\Controllers\\ProfileController' => $baseDir . '/app/Http/Controllers/ProfileController.php',
|
||||
'App\\Http\\Controllers\\PushController' => $baseDir . '/app/Http/Controllers/PushController.php',
|
||||
'App\\Http\\Controllers\\SearchController' => $baseDir . '/app/Http/Controllers/SearchController.php',
|
||||
'App\\Http\\Middleware\\EnsureNotInMaintenance' => $baseDir . '/app/Http/Middleware/EnsureNotInMaintenance.php',
|
||||
'App\\Http\\Middleware\\EnsurePluginAccess' => $baseDir . '/app/Http/Middleware/EnsurePluginAccess.php',
|
||||
|
|
@ -147,6 +152,10 @@ return array(
|
|||
'App\\Providers\\Filament\\AdminPanelProvider' => $baseDir . '/app/Providers/Filament/AdminPanelProvider.php',
|
||||
'App\\Providers\\FortifyServiceProvider' => $baseDir . '/app/Providers/FortifyServiceProvider.php',
|
||||
'App\\Providers\\PluginServiceProvider' => $baseDir . '/app/Providers/PluginServiceProvider.php',
|
||||
'App\\Push\\PushSubscription' => $baseDir . '/app/Push/PushSubscription.php',
|
||||
'App\\Push\\SendWebPush' => $baseDir . '/app/Push/SendWebPush.php',
|
||||
'App\\Push\\WebPush' => $baseDir . '/app/Push/WebPush.php',
|
||||
'App\\Push\\WebPushChannel' => $baseDir . '/app/Push/WebPushChannel.php',
|
||||
'App\\Search\\GlobalSearch' => $baseDir . '/app/Search/GlobalSearch.php',
|
||||
'App\\Support\\Abilities' => $baseDir . '/app/Support/Abilities.php',
|
||||
'App\\Support\\Audit' => $baseDir . '/app/Support/Audit.php',
|
||||
|
|
@ -4472,6 +4481,26 @@ return array(
|
|||
'Laravel\\Prompts\\Themes\\Default\\TextareaPromptRenderer' => $vendorDir . '/laravel/prompts/src/Themes/Default/TextareaPromptRenderer.php',
|
||||
'Laravel\\Prompts\\Themes\\Default\\TitleRenderer' => $vendorDir . '/laravel/prompts/src/Themes/Default/TitleRenderer.php',
|
||||
'Laravel\\Prompts\\Title' => $vendorDir . '/laravel/prompts/src/Title.php',
|
||||
'Laravel\\Sanctum\\Console\\Commands\\PruneExpired' => $vendorDir . '/laravel/sanctum/src/Console/Commands/PruneExpired.php',
|
||||
'Laravel\\Sanctum\\Contracts\\HasAbilities' => $vendorDir . '/laravel/sanctum/src/Contracts/HasAbilities.php',
|
||||
'Laravel\\Sanctum\\Contracts\\HasApiTokens' => $vendorDir . '/laravel/sanctum/src/Contracts/HasApiTokens.php',
|
||||
'Laravel\\Sanctum\\Events\\TokenAuthenticated' => $vendorDir . '/laravel/sanctum/src/Events/TokenAuthenticated.php',
|
||||
'Laravel\\Sanctum\\Exceptions\\MissingAbilityException' => $vendorDir . '/laravel/sanctum/src/Exceptions/MissingAbilityException.php',
|
||||
'Laravel\\Sanctum\\Exceptions\\MissingScopeException' => $vendorDir . '/laravel/sanctum/src/Exceptions/MissingScopeException.php',
|
||||
'Laravel\\Sanctum\\Guard' => $vendorDir . '/laravel/sanctum/src/Guard.php',
|
||||
'Laravel\\Sanctum\\HasApiTokens' => $vendorDir . '/laravel/sanctum/src/HasApiTokens.php',
|
||||
'Laravel\\Sanctum\\Http\\Controllers\\CsrfCookieController' => $vendorDir . '/laravel/sanctum/src/Http/Controllers/CsrfCookieController.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\AuthenticateSession' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/AuthenticateSession.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckAbilities' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/CheckAbilities.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckForAnyAbility' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/CheckForAnyAbility.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckForAnyScope' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/CheckForAnyScope.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckScopes' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/CheckScopes.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful' => $vendorDir . '/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php',
|
||||
'Laravel\\Sanctum\\NewAccessToken' => $vendorDir . '/laravel/sanctum/src/NewAccessToken.php',
|
||||
'Laravel\\Sanctum\\PersonalAccessToken' => $vendorDir . '/laravel/sanctum/src/PersonalAccessToken.php',
|
||||
'Laravel\\Sanctum\\Sanctum' => $vendorDir . '/laravel/sanctum/src/Sanctum.php',
|
||||
'Laravel\\Sanctum\\SanctumServiceProvider' => $vendorDir . '/laravel/sanctum/src/SanctumServiceProvider.php',
|
||||
'Laravel\\Sanctum\\TransientToken' => $vendorDir . '/laravel/sanctum/src/TransientToken.php',
|
||||
'Laravel\\SerializableClosure\\Contracts\\Serializable' => $vendorDir . '/laravel/serializable-closure/src/Contracts/Serializable.php',
|
||||
'Laravel\\SerializableClosure\\Contracts\\Signer' => $vendorDir . '/laravel/serializable-closure/src/Contracts/Signer.php',
|
||||
'Laravel\\SerializableClosure\\Exceptions\\InvalidSignatureException' => $vendorDir . '/laravel/serializable-closure/src/Exceptions/InvalidSignatureException.php',
|
||||
|
|
|
|||
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
|
|
@ -88,6 +88,7 @@ return array(
|
|||
'League\\Config\\' => array($vendorDir . '/league/config/src'),
|
||||
'League\\CommonMark\\' => array($vendorDir . '/league/commonmark/src'),
|
||||
'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'),
|
||||
'Laravel\\Sanctum\\' => array($vendorDir . '/laravel/sanctum/src'),
|
||||
'Laravel\\Prompts\\' => array($vendorDir . '/laravel/prompts/src'),
|
||||
'Laravel\\Passkeys\\' => array($vendorDir . '/laravel/passkeys/src'),
|
||||
'Laravel\\Fortify\\' => array($vendorDir . '/laravel/fortify/src'),
|
||||
|
|
|
|||
34
vendor/composer/autoload_static.php
vendored
34
vendor/composer/autoload_static.php
vendored
|
|
@ -170,6 +170,7 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
'League\\Config\\' => 14,
|
||||
'League\\CommonMark\\' => 18,
|
||||
'Laravel\\SerializableClosure\\' => 28,
|
||||
'Laravel\\Sanctum\\' => 16,
|
||||
'Laravel\\Prompts\\' => 16,
|
||||
'Laravel\\Passkeys\\' => 17,
|
||||
'Laravel\\Fortify\\' => 16,
|
||||
|
|
@ -584,6 +585,10 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/serializable-closure/src',
|
||||
),
|
||||
'Laravel\\Sanctum\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/sanctum/src',
|
||||
),
|
||||
'Laravel\\Prompts\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/laravel/prompts/src',
|
||||
|
|
@ -863,6 +868,10 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
'App\\Filament\\Resources\\Users\\Tables\\UsersTable' => __DIR__ . '/../..' . '/app/Filament/Resources/Users/Tables/UsersTable.php',
|
||||
'App\\Filament\\Resources\\Users\\UserResource' => __DIR__ . '/../..' . '/app/Filament/Resources/Users/UserResource.php',
|
||||
'App\\Http\\Controllers\\Admin\\UpdateController' => __DIR__ . '/../..' . '/app/Http/Controllers/Admin/UpdateController.php',
|
||||
'App\\Http\\Controllers\\Api\\AuthController' => __DIR__ . '/../..' . '/app/Http/Controllers/Api/AuthController.php',
|
||||
'App\\Http\\Controllers\\Api\\NotificationController' => __DIR__ . '/../..' . '/app/Http/Controllers/Api/NotificationController.php',
|
||||
'App\\Http\\Controllers\\Api\\PeopleController' => __DIR__ . '/../..' . '/app/Http/Controllers/Api/PeopleController.php',
|
||||
'App\\Http\\Controllers\\Api\\SearchController' => __DIR__ . '/../..' . '/app/Http/Controllers/Api/SearchController.php',
|
||||
'App\\Http\\Controllers\\AppearanceController' => __DIR__ . '/../..' . '/app/Http/Controllers/AppearanceController.php',
|
||||
'App\\Http\\Controllers\\Auth\\IdentityLoginController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/IdentityLoginController.php',
|
||||
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
|
||||
|
|
@ -876,6 +885,7 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
'App\\Http\\Controllers\\PeopleController' => __DIR__ . '/../..' . '/app/Http/Controllers/PeopleController.php',
|
||||
'App\\Http\\Controllers\\PluginAssetController' => __DIR__ . '/../..' . '/app/Http/Controllers/PluginAssetController.php',
|
||||
'App\\Http\\Controllers\\ProfileController' => __DIR__ . '/../..' . '/app/Http/Controllers/ProfileController.php',
|
||||
'App\\Http\\Controllers\\PushController' => __DIR__ . '/../..' . '/app/Http/Controllers/PushController.php',
|
||||
'App\\Http\\Controllers\\SearchController' => __DIR__ . '/../..' . '/app/Http/Controllers/SearchController.php',
|
||||
'App\\Http\\Middleware\\EnsureNotInMaintenance' => __DIR__ . '/../..' . '/app/Http/Middleware/EnsureNotInMaintenance.php',
|
||||
'App\\Http\\Middleware\\EnsurePluginAccess' => __DIR__ . '/../..' . '/app/Http/Middleware/EnsurePluginAccess.php',
|
||||
|
|
@ -944,6 +954,10 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
'App\\Providers\\Filament\\AdminPanelProvider' => __DIR__ . '/../..' . '/app/Providers/Filament/AdminPanelProvider.php',
|
||||
'App\\Providers\\FortifyServiceProvider' => __DIR__ . '/../..' . '/app/Providers/FortifyServiceProvider.php',
|
||||
'App\\Providers\\PluginServiceProvider' => __DIR__ . '/../..' . '/app/Providers/PluginServiceProvider.php',
|
||||
'App\\Push\\PushSubscription' => __DIR__ . '/../..' . '/app/Push/PushSubscription.php',
|
||||
'App\\Push\\SendWebPush' => __DIR__ . '/../..' . '/app/Push/SendWebPush.php',
|
||||
'App\\Push\\WebPush' => __DIR__ . '/../..' . '/app/Push/WebPush.php',
|
||||
'App\\Push\\WebPushChannel' => __DIR__ . '/../..' . '/app/Push/WebPushChannel.php',
|
||||
'App\\Search\\GlobalSearch' => __DIR__ . '/../..' . '/app/Search/GlobalSearch.php',
|
||||
'App\\Support\\Abilities' => __DIR__ . '/../..' . '/app/Support/Abilities.php',
|
||||
'App\\Support\\Audit' => __DIR__ . '/../..' . '/app/Support/Audit.php',
|
||||
|
|
@ -5269,6 +5283,26 @@ class ComposerStaticInit7be5f0fc2523def46ad071c4f7cbcb0e
|
|||
'Laravel\\Prompts\\Themes\\Default\\TextareaPromptRenderer' => __DIR__ . '/..' . '/laravel/prompts/src/Themes/Default/TextareaPromptRenderer.php',
|
||||
'Laravel\\Prompts\\Themes\\Default\\TitleRenderer' => __DIR__ . '/..' . '/laravel/prompts/src/Themes/Default/TitleRenderer.php',
|
||||
'Laravel\\Prompts\\Title' => __DIR__ . '/..' . '/laravel/prompts/src/Title.php',
|
||||
'Laravel\\Sanctum\\Console\\Commands\\PruneExpired' => __DIR__ . '/..' . '/laravel/sanctum/src/Console/Commands/PruneExpired.php',
|
||||
'Laravel\\Sanctum\\Contracts\\HasAbilities' => __DIR__ . '/..' . '/laravel/sanctum/src/Contracts/HasAbilities.php',
|
||||
'Laravel\\Sanctum\\Contracts\\HasApiTokens' => __DIR__ . '/..' . '/laravel/sanctum/src/Contracts/HasApiTokens.php',
|
||||
'Laravel\\Sanctum\\Events\\TokenAuthenticated' => __DIR__ . '/..' . '/laravel/sanctum/src/Events/TokenAuthenticated.php',
|
||||
'Laravel\\Sanctum\\Exceptions\\MissingAbilityException' => __DIR__ . '/..' . '/laravel/sanctum/src/Exceptions/MissingAbilityException.php',
|
||||
'Laravel\\Sanctum\\Exceptions\\MissingScopeException' => __DIR__ . '/..' . '/laravel/sanctum/src/Exceptions/MissingScopeException.php',
|
||||
'Laravel\\Sanctum\\Guard' => __DIR__ . '/..' . '/laravel/sanctum/src/Guard.php',
|
||||
'Laravel\\Sanctum\\HasApiTokens' => __DIR__ . '/..' . '/laravel/sanctum/src/HasApiTokens.php',
|
||||
'Laravel\\Sanctum\\Http\\Controllers\\CsrfCookieController' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Controllers/CsrfCookieController.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\AuthenticateSession' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/AuthenticateSession.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckAbilities' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/CheckAbilities.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckForAnyAbility' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/CheckForAnyAbility.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckForAnyScope' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/CheckForAnyScope.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\CheckScopes' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/CheckScopes.php',
|
||||
'Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful' => __DIR__ . '/..' . '/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php',
|
||||
'Laravel\\Sanctum\\NewAccessToken' => __DIR__ . '/..' . '/laravel/sanctum/src/NewAccessToken.php',
|
||||
'Laravel\\Sanctum\\PersonalAccessToken' => __DIR__ . '/..' . '/laravel/sanctum/src/PersonalAccessToken.php',
|
||||
'Laravel\\Sanctum\\Sanctum' => __DIR__ . '/..' . '/laravel/sanctum/src/Sanctum.php',
|
||||
'Laravel\\Sanctum\\SanctumServiceProvider' => __DIR__ . '/..' . '/laravel/sanctum/src/SanctumServiceProvider.php',
|
||||
'Laravel\\Sanctum\\TransientToken' => __DIR__ . '/..' . '/laravel/sanctum/src/TransientToken.php',
|
||||
'Laravel\\SerializableClosure\\Contracts\\Serializable' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Contracts/Serializable.php',
|
||||
'Laravel\\SerializableClosure\\Contracts\\Signer' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Contracts/Signer.php',
|
||||
'Laravel\\SerializableClosure\\Exceptions\\InvalidSignatureException' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Exceptions/InvalidSignatureException.php',
|
||||
|
|
|
|||
66
vendor/composer/installed.json
vendored
66
vendor/composer/installed.json
vendored
|
|
@ -3077,6 +3077,72 @@
|
|||
},
|
||||
"install-path": "../laravel/prompts"
|
||||
},
|
||||
{
|
||||
"name": "laravel/sanctum",
|
||||
"version": "v4.3.3",
|
||||
"version_normalized": "4.3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sanctum.git",
|
||||
"reference": "fee27a573d1a013af3721d86153a65e0b11927e6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sanctum/zipball/fee27a573d1a013af3721d86153a65e0b11927e6",
|
||||
"reference": "fee27a573d1a013af3721d86153a65e0b11927e6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"illuminate/console": "^11.0|^12.0|^13.0",
|
||||
"illuminate/contracts": "^11.0|^12.0|^13.0",
|
||||
"illuminate/database": "^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^11.0|^12.0|^13.0",
|
||||
"php": "^8.2",
|
||||
"symfony/console": "^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench": "^9.15|^10.8|^11.0",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"time": "2026-06-23T18:26:55+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Sanctum\\SanctumServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Sanctum\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
|
||||
"keywords": [
|
||||
"auth",
|
||||
"laravel",
|
||||
"sanctum"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/sanctum/issues",
|
||||
"source": "https://github.com/laravel/sanctum"
|
||||
},
|
||||
"install-path": "../laravel/sanctum"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v2.1.0",
|
||||
|
|
|
|||
13
vendor/composer/installed.php
vendored
13
vendor/composer/installed.php
vendored
|
|
@ -3,7 +3,7 @@
|
|||
'name' => 'inhaus/inhaus',
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '93cb6b348b1277f0b85a1b5af06a246a38fdaf78',
|
||||
'reference' => '232dc5c59ccca97b734046ebd29c4a85ca0148ec',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
|
@ -550,7 +550,7 @@
|
|||
'inhaus/inhaus' => array(
|
||||
'pretty_version' => 'dev-main',
|
||||
'version' => 'dev-main',
|
||||
'reference' => '93cb6b348b1277f0b85a1b5af06a246a38fdaf78',
|
||||
'reference' => '232dc5c59ccca97b734046ebd29c4a85ca0148ec',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
|
@ -619,6 +619,15 @@
|
|||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'laravel/sanctum' => array(
|
||||
'pretty_version' => 'v4.3.3',
|
||||
'version' => '4.3.3.0',
|
||||
'reference' => 'fee27a573d1a013af3721d86153a65e0b11927e6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../laravel/sanctum',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'laravel/serializable-closure' => array(
|
||||
'pretty_version' => 'v2.1.0',
|
||||
'version' => '2.1.0.0',
|
||||
|
|
|
|||
21
vendor/laravel/sanctum/LICENSE.md
vendored
Normal file
21
vendor/laravel/sanctum/LICENSE.md
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Taylor Otwell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
32
vendor/laravel/sanctum/README.md
vendored
Normal file
32
vendor/laravel/sanctum/README.md
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<p align="center"><img width="307" height="63" src="/art/logo.svg" alt="Logo Laravel Sanctum"></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/sanctum/actions"><img src="https://github.com/laravel/sanctum/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/sanctum"><img src="https://img.shields.io/packagist/dt/laravel/sanctum" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/sanctum"><img src="https://img.shields.io/packagist/v/laravel/sanctum" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/sanctum"><img src="https://img.shields.io/packagist/l/laravel/sanctum" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## Introduction
|
||||
|
||||
Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation for Sanctum can be found on the [Laravel website](https://laravel.com/docs/sanctum).
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to Sanctum! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
Please review [our security policy](https://github.com/laravel/sanctum/security/policy) on how to report security vulnerabilities.
|
||||
|
||||
## License
|
||||
|
||||
Laravel Sanctum is open-sourced software licensed under the [MIT license](LICENSE.md).
|
||||
31
vendor/laravel/sanctum/UPGRADE.md
vendored
Normal file
31
vendor/laravel/sanctum/UPGRADE.md
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Upgrade Guide
|
||||
|
||||
## Upgrading To 4.0 From 3.x
|
||||
|
||||
### Minimum PHP Version
|
||||
|
||||
PHP 8.2 is now the minimum required version.
|
||||
|
||||
### Minimum Laravel Version
|
||||
|
||||
Laravel 11.0 is now the minimum required version.
|
||||
|
||||
### Migration Changes
|
||||
|
||||
Sanctum 4.0 no longer automatically loads migrations from its own migrations directory. Instead, you should run the following command to publish Sanctum's migrations to your application:
|
||||
|
||||
```bash
|
||||
php artisan vendor:publish --tag=sanctum-migrations
|
||||
```
|
||||
|
||||
### Configuration Changes
|
||||
|
||||
In your application's `config/sanctum.php` configuration file, you should update the references to the `authenticate_session`, `encrypt_cookies`, and `validate_csrf_token` middleware to the following:
|
||||
|
||||
```php
|
||||
'middleware' => [
|
||||
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
|
||||
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
|
||||
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
|
||||
],
|
||||
```
|
||||
54
vendor/laravel/sanctum/composer.json
vendored
Normal file
54
vendor/laravel/sanctum/composer.json
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"name": "laravel/sanctum",
|
||||
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
|
||||
"keywords": ["laravel", "sanctum", "auth"],
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/sanctum/issues",
|
||||
"source": "https://github.com/laravel/sanctum"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"ext-json": "*",
|
||||
"illuminate/console": "^11.0|^12.0|^13.0",
|
||||
"illuminate/contracts": "^11.0|^12.0|^13.0",
|
||||
"illuminate/database": "^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^11.0|^12.0|^13.0",
|
||||
"symfony/console": "^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench": "^9.15|^10.8|^11.0",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Sanctum\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Laravel\\Sanctum\\Tests\\": "tests/",
|
||||
"Workbench\\App\\": "workbench/app/",
|
||||
"Workbench\\Database\\Factories\\": "workbench/database/factories/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Sanctum\\SanctumServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
87
vendor/laravel/sanctum/config/sanctum.php
vendored
Normal file
87
vendor/laravel/sanctum/config/sanctum.php
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken;
|
||||
use Laravel\Sanctum\Http\Middleware\AuthenticateSession;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Stateful Domains
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Requests from the following domains / hosts will receive stateful API
|
||||
| authentication cookies. Typically, these should include your local
|
||||
| and production domains which access your API via a frontend SPA.
|
||||
|
|
||||
*/
|
||||
|
||||
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
Sanctum::currentApplicationUrlWithPort(),
|
||||
// Sanctum::currentRequestHost(),
|
||||
))),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array contains the authentication guards that will be checked when
|
||||
| Sanctum is trying to authenticate a request. If none of these guards
|
||||
| are able to authenticate the request, Sanctum will use the bearer
|
||||
| token that's present on an incoming request for authentication.
|
||||
|
|
||||
*/
|
||||
|
||||
'guard' => ['web'],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expiration Minutes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value controls the number of minutes until an issued token will be
|
||||
| considered expired. This will override any values set in the token's
|
||||
| "expires_at" attribute, but first-party sessions are not affected.
|
||||
|
|
||||
*/
|
||||
|
||||
'expiration' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Token Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Sanctum can prefix new tokens in order to take advantage of numerous
|
||||
| security scanning initiatives maintained by open source platforms
|
||||
| that notify developers if they commit tokens into repositories.
|
||||
|
|
||||
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
||||
|
|
||||
*/
|
||||
|
||||
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When authenticating your first-party SPA with Sanctum you may need to
|
||||
| customize some of the middleware Sanctum uses while processing the
|
||||
| request. You may change the middleware listed below as required.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'authenticate_session' => AuthenticateSession::class,
|
||||
'encrypt_cookies' => EncryptCookies::class,
|
||||
'validate_csrf_token' => ValidateCsrfToken::class,
|
||||
],
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('tokenable');
|
||||
$table->text('name');
|
||||
$table->string('token', 64)->unique();
|
||||
$table->text('abilities')->nullable();
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamp('expires_at')->nullable()->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
};
|
||||
55
vendor/laravel/sanctum/src/Console/Commands/PruneExpired.php
vendored
Normal file
55
vendor/laravel/sanctum/src/Console/Commands/PruneExpired.php
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
|
||||
#[AsCommand(name: 'sanctum:prune-expired')]
|
||||
class PruneExpired extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'sanctum:prune-expired {--hours=24 : The number of hours to retain expired Sanctum tokens}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Prune tokens expired for more than specified number of hours';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$model = Sanctum::$personalAccessTokenModel;
|
||||
|
||||
$hours = $this->option('hours');
|
||||
|
||||
$this->components->task(
|
||||
'Pruning tokens with expired expires_at timestamps',
|
||||
fn () => $model::where('expires_at', '<', now()->subHours($hours))->delete()
|
||||
);
|
||||
|
||||
if ($expiration = config('sanctum.expiration')) {
|
||||
$this->components->task(
|
||||
'Pruning tokens with expired expiration value based on configuration file',
|
||||
fn () => $model::where('created_at', '<', now()->subMinutes($expiration + ($hours * 60)))->delete()
|
||||
);
|
||||
} else {
|
||||
$this->components->warn('Expiration value not specified in configuration file.');
|
||||
}
|
||||
|
||||
$this->components->info("Tokens expired for more than [$hours hours] pruned successfully.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
22
vendor/laravel/sanctum/src/Contracts/HasAbilities.php
vendored
Normal file
22
vendor/laravel/sanctum/src/Contracts/HasAbilities.php
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Contracts;
|
||||
|
||||
interface HasAbilities
|
||||
{
|
||||
/**
|
||||
* Determine if the token has a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function can($ability);
|
||||
|
||||
/**
|
||||
* Determine if the token is missing a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function cant($ability);
|
||||
}
|
||||
48
vendor/laravel/sanctum/src/Contracts/HasApiTokens.php
vendored
Normal file
48
vendor/laravel/sanctum/src/Contracts/HasApiTokens.php
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Contracts;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
interface HasApiTokens
|
||||
{
|
||||
/**
|
||||
* Get the access tokens that belong to model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
*/
|
||||
public function tokens();
|
||||
|
||||
/**
|
||||
* Determine if the current API token has a given scope.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function tokenCan(string $ability);
|
||||
|
||||
/**
|
||||
* Create a new personal access token for the user.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $abilities
|
||||
* @param \DateTimeInterface|null $expiresAt
|
||||
* @return \Laravel\Sanctum\NewAccessToken
|
||||
*/
|
||||
public function createToken(string $name, array $abilities = ['*'], ?DateTimeInterface $expiresAt = null);
|
||||
|
||||
/**
|
||||
* Get the access token currently associated with the user.
|
||||
*
|
||||
* @return \Laravel\Sanctum\Contracts\HasAbilities
|
||||
*/
|
||||
public function currentAccessToken();
|
||||
|
||||
/**
|
||||
* Set the current access token for the user.
|
||||
*
|
||||
* @param \Laravel\Sanctum\Contracts\HasAbilities $accessToken
|
||||
* @return \Laravel\Sanctum\Contracts\HasApiTokens
|
||||
*/
|
||||
public function withAccessToken($accessToken);
|
||||
}
|
||||
15
vendor/laravel/sanctum/src/Events/TokenAuthenticated.php
vendored
Normal file
15
vendor/laravel/sanctum/src/Events/TokenAuthenticated.php
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Events;
|
||||
|
||||
class TokenAuthenticated
|
||||
{
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param \Laravel\Sanctum\PersonalAccessToken $token The personal access token that was authenticated.
|
||||
*/
|
||||
public function __construct(public $token)
|
||||
{
|
||||
}
|
||||
}
|
||||
32
vendor/laravel/sanctum/src/Exceptions/MissingAbilityException.php
vendored
Normal file
32
vendor/laravel/sanctum/src/Exceptions/MissingAbilityException.php
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Exceptions;
|
||||
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class MissingAbilityException extends AuthorizationException
|
||||
{
|
||||
/**
|
||||
* Create a new missing scope exception.
|
||||
*
|
||||
* @param array|string $abilities The abilities that the user did not have.
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct(protected $abilities = [], $message = 'Invalid ability provided.')
|
||||
{
|
||||
parent::__construct($message);
|
||||
|
||||
$this->abilities = Arr::wrap($abilities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the abilities that the user did not have.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function abilities()
|
||||
{
|
||||
return $this->abilities;
|
||||
}
|
||||
}
|
||||
36
vendor/laravel/sanctum/src/Exceptions/MissingScopeException.php
vendored
Normal file
36
vendor/laravel/sanctum/src/Exceptions/MissingScopeException.php
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Exceptions;
|
||||
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see \Laravel\Sanctum\Exceptions\MissingAbilityException
|
||||
*/
|
||||
class MissingScopeException extends AuthorizationException
|
||||
{
|
||||
/**
|
||||
* Create a new missing scope exception.
|
||||
*
|
||||
* @param array|string $scopes The scopes that the user did not have.
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct(protected $scopes = [], $message = 'Invalid scope(s) provided.')
|
||||
{
|
||||
parent::__construct($message);
|
||||
|
||||
$this->scopes = Arr::wrap($scopes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the scopes that the user did not have.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function scopes()
|
||||
{
|
||||
return $this->scopes;
|
||||
}
|
||||
}
|
||||
174
vendor/laravel/sanctum/src/Guard.php
vendored
Normal file
174
vendor/laravel/sanctum/src/Guard.php
vendored
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Illuminate\Contracts\Auth\Factory as AuthFactory;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Laravel\Sanctum\Events\TokenAuthenticated;
|
||||
|
||||
class Guard
|
||||
{
|
||||
/**
|
||||
* Create a new guard instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Factory $auth The authentication factory implementation.
|
||||
* @param int $expiration The number of minutes tokens should be allowed to remain valid.
|
||||
* @param string $provider The provider name.
|
||||
* @param bool $trackLastUsedAt Whether to track the last used timestamp.
|
||||
*/
|
||||
public function __construct(protected AuthFactory $auth, protected $expiration = null, protected $provider = null, protected $trackLastUsedAt = true)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the authenticated user for the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
foreach (Arr::wrap(config('sanctum.guard', 'web')) as $guard) {
|
||||
if ($user = $this->auth->guard($guard)->user()) {
|
||||
return $this->supportsTokens($user)
|
||||
? $user->withAccessToken(new TransientToken)
|
||||
: $user;
|
||||
}
|
||||
}
|
||||
|
||||
if ($token = $this->getTokenFromRequest($request)) {
|
||||
$model = Sanctum::$personalAccessTokenModel;
|
||||
|
||||
$accessToken = $model::findToken($token);
|
||||
|
||||
if (! $this->isValidAccessToken($accessToken) ||
|
||||
! $this->supportsTokens($accessToken->tokenable)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tokenable = $accessToken->tokenable->withAccessToken(
|
||||
$accessToken
|
||||
);
|
||||
|
||||
event(new TokenAuthenticated($accessToken));
|
||||
|
||||
if ($this->trackLastUsedAt) {
|
||||
$this->updateLastUsedAt($accessToken);
|
||||
}
|
||||
|
||||
return $tokenable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the tokenable model supports API tokens.
|
||||
*
|
||||
* @param mixed $tokenable
|
||||
* @return bool
|
||||
*/
|
||||
protected function supportsTokens($tokenable = null)
|
||||
{
|
||||
return $tokenable && in_array(HasApiTokens::class, class_uses_recursive(
|
||||
get_class($tokenable)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the token from the request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function getTokenFromRequest(Request $request)
|
||||
{
|
||||
if (is_callable(Sanctum::$accessTokenRetrievalCallback)) {
|
||||
return (string) (Sanctum::$accessTokenRetrievalCallback)($request);
|
||||
}
|
||||
|
||||
$token = $request->bearerToken();
|
||||
|
||||
return $this->isValidBearerToken($token) ? $token : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the bearer token is in the correct format.
|
||||
*
|
||||
* @param string|null $token
|
||||
* @return bool
|
||||
*/
|
||||
protected function isValidBearerToken(?string $token = null)
|
||||
{
|
||||
if (! is_null($token) && str_contains($token, '|')) {
|
||||
$model = new Sanctum::$personalAccessTokenModel;
|
||||
|
||||
if ($model->getKeyType() === 'int') {
|
||||
[$id, $token] = explode('|', $token, 2);
|
||||
|
||||
return ctype_digit($id) && ! empty($token);
|
||||
}
|
||||
}
|
||||
|
||||
return ! empty($token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the provided access token is valid.
|
||||
*
|
||||
* @param mixed $accessToken
|
||||
* @return bool
|
||||
*/
|
||||
protected function isValidAccessToken($accessToken): bool
|
||||
{
|
||||
if (! $accessToken) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$isValid =
|
||||
(! $this->expiration || $accessToken->created_at->gt(now()->subMinutes($this->expiration)))
|
||||
&& (! $accessToken->expires_at || ! $accessToken->expires_at->isPast())
|
||||
&& $this->hasValidProvider($accessToken->tokenable);
|
||||
|
||||
if (is_callable(Sanctum::$accessTokenAuthenticationCallback)) {
|
||||
$isValid = (bool) (Sanctum::$accessTokenAuthenticationCallback)($accessToken, $isValid);
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the tokenable model matches the provider's model type.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Model $tokenable
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasValidProvider($tokenable)
|
||||
{
|
||||
if (is_null($this->provider)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$model = config("auth.providers.{$this->provider}.model");
|
||||
|
||||
return $tokenable instanceof $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the time the token was last used.
|
||||
*
|
||||
* @param \Laravel\Sanctum\PersonalAccessToken $accessToken
|
||||
* @return void
|
||||
*/
|
||||
protected function updateLastUsedAt($accessToken)
|
||||
{
|
||||
if (method_exists($accessToken->getConnection(), 'hasModifiedRecords') &&
|
||||
method_exists($accessToken->getConnection(), 'setRecordModificationState')) {
|
||||
$hasModifiedRecords = $accessToken->getConnection()->hasModifiedRecords();
|
||||
$accessToken->forceFill(['last_used_at' => now()])->save();
|
||||
|
||||
$accessToken->getConnection()->setRecordModificationState($hasModifiedRecords);
|
||||
} else {
|
||||
$accessToken->forceFill(['last_used_at' => now()])->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
111
vendor/laravel/sanctum/src/HasApiTokens.php
vendored
Normal file
111
vendor/laravel/sanctum/src/HasApiTokens.php
vendored
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @template TToken of \Laravel\Sanctum\Contracts\HasAbilities = \Laravel\Sanctum\PersonalAccessToken
|
||||
*/
|
||||
trait HasApiTokens
|
||||
{
|
||||
/**
|
||||
* The access token the user is using for the current request.
|
||||
*
|
||||
* @var TToken
|
||||
*/
|
||||
protected $accessToken;
|
||||
|
||||
/**
|
||||
* Get the access tokens that belong to model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<TToken, $this>
|
||||
*/
|
||||
public function tokens()
|
||||
{
|
||||
return $this->morphMany(Sanctum::$personalAccessTokenModel, 'tokenable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current API token has a given scope.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function tokenCan(string $ability)
|
||||
{
|
||||
return $this->accessToken && $this->accessToken->can($ability);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the current API token does not have a given scope.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function tokenCant(string $ability)
|
||||
{
|
||||
return ! $this->tokenCan($ability);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new personal access token for the user.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $abilities
|
||||
* @param \DateTimeInterface|null $expiresAt
|
||||
* @return \Laravel\Sanctum\NewAccessToken
|
||||
*/
|
||||
public function createToken(string $name, array $abilities = ['*'], ?DateTimeInterface $expiresAt = null)
|
||||
{
|
||||
$plainTextToken = $this->generateTokenString();
|
||||
|
||||
$token = $this->tokens()->create([
|
||||
'name' => $name,
|
||||
'token' => hash('sha256', $plainTextToken),
|
||||
'abilities' => $abilities,
|
||||
'expires_at' => $expiresAt,
|
||||
]);
|
||||
|
||||
return new NewAccessToken($token, $token->getKey().'|'.$plainTextToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the token string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateTokenString()
|
||||
{
|
||||
return sprintf(
|
||||
'%s%s%s',
|
||||
config('sanctum.token_prefix', ''),
|
||||
$tokenEntropy = Str::random(40),
|
||||
hash('crc32b', $tokenEntropy)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the access token currently associated with the user.
|
||||
*
|
||||
* @return TToken
|
||||
*/
|
||||
public function currentAccessToken()
|
||||
{
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current access token for the user.
|
||||
*
|
||||
* @param TToken $accessToken
|
||||
* @return $this
|
||||
*/
|
||||
public function withAccessToken($accessToken)
|
||||
{
|
||||
$this->accessToken = $accessToken;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
25
vendor/laravel/sanctum/src/Http/Controllers/CsrfCookieController.php
vendored
Normal file
25
vendor/laravel/sanctum/src/Http/Controllers/CsrfCookieController.php
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class CsrfCookieController
|
||||
{
|
||||
/**
|
||||
* Return an empty response simply to trigger the storage of the CSRF cookie in the browser.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
if ($request->expectsJson()) {
|
||||
return new JsonResponse(status: 204);
|
||||
}
|
||||
|
||||
return new Response(status: 204);
|
||||
}
|
||||
}
|
||||
121
vendor/laravel/sanctum/src/Http/Middleware/AuthenticateSession.php
vendored
Normal file
121
vendor/laravel/sanctum/src/Http/Middleware/AuthenticateSession.php
vendored
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Auth\SessionGuard;
|
||||
use Illuminate\Contracts\Auth\Factory as AuthFactory;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class AuthenticateSession
|
||||
{
|
||||
/**
|
||||
* Create a new middleware instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Factory $auth The authentication factory implementation.
|
||||
*/
|
||||
public function __construct(protected AuthFactory $auth)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*
|
||||
* @throws \Illuminate\Auth\AuthenticationException
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (! $request->hasSession() || ! $request->user()) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$guards = Collection::make(Arr::wrap(config('sanctum.guard')))
|
||||
->mapWithKeys(fn ($guard) => [$guard => $this->auth->guard($guard)])
|
||||
->filter(fn ($guard) => $guard instanceof SessionGuard);
|
||||
|
||||
$shouldLogout = $guards->filter(
|
||||
fn ($guard, $driver) => $request->session()->has('password_hash_'.$driver)
|
||||
)->filter(
|
||||
fn ($guard, $driver) => ! $this->validatePasswordHash(
|
||||
$guard,
|
||||
$request->user()->getAuthPassword(),
|
||||
$request->session()->get('password_hash_'.$driver)
|
||||
)
|
||||
);
|
||||
|
||||
if ($shouldLogout->isNotEmpty()) {
|
||||
$shouldLogout->each->logoutCurrentDevice();
|
||||
|
||||
$request->session()->flush();
|
||||
|
||||
throw new AuthenticationException('Unauthenticated.', [...$shouldLogout->keys()->all(), 'sanctum']);
|
||||
}
|
||||
|
||||
return tap($next($request), function () use ($request, $guards) {
|
||||
if (! is_null($guard = $this->getFirstGuardWithUser($guards->keys()))) {
|
||||
$this->storePasswordHashInSession($request, $guard);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first authentication guard that has a user.
|
||||
*
|
||||
* @param \Illuminate\Support\Collection $guards
|
||||
* @return string|null
|
||||
*/
|
||||
protected function getFirstGuardWithUser(Collection $guards)
|
||||
{
|
||||
return $guards->first(function ($guard) {
|
||||
$guardInstance = $this->auth->guard($guard);
|
||||
|
||||
return method_exists($guardInstance, 'hasUser') &&
|
||||
$guardInstance->hasUser();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the user's current password hash in the session.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $guard
|
||||
* @return void
|
||||
*/
|
||||
protected function storePasswordHashInSession($request, string $guard)
|
||||
{
|
||||
$guardInstance = $this->auth->guard($guard);
|
||||
|
||||
$request->session()->put([
|
||||
"password_hash_{$guard}" => method_exists($guardInstance, 'hashPasswordForCookie')
|
||||
? $guardInstance->hashPasswordForCookie($guardInstance->user()->getAuthPassword())
|
||||
: $guardInstance->user()->getAuthPassword(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the password hash against the stored value.
|
||||
*
|
||||
* @param \Illuminate\Auth\SessionGuard $guard
|
||||
* @param string|null $passwordHash
|
||||
* @param string $storedValue
|
||||
* @return bool
|
||||
*/
|
||||
protected function validatePasswordHash(SessionGuard $guard, ?string $passwordHash, string $storedValue): bool
|
||||
{
|
||||
// Try new HMAC format first (Laravel 12.45.0+)...
|
||||
if (method_exists($guard, 'hashPasswordForCookie')) {
|
||||
if (hash_equals($guard->hashPasswordForCookie($passwordHash), $storedValue)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to raw password hash format for backward compatibility...
|
||||
return hash_equals($passwordHash ?? '', $storedValue);
|
||||
}
|
||||
}
|
||||
34
vendor/laravel/sanctum/src/Http/Middleware/CheckAbilities.php
vendored
Normal file
34
vendor/laravel/sanctum/src/Http/Middleware/CheckAbilities.php
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Laravel\Sanctum\Exceptions\MissingAbilityException;
|
||||
|
||||
class CheckAbilities
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param mixed ...$abilities
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingAbilityException
|
||||
*/
|
||||
public function handle($request, $next, ...$abilities)
|
||||
{
|
||||
if (! $request->user() || ! $request->user()->currentAccessToken()) {
|
||||
throw new AuthenticationException;
|
||||
}
|
||||
|
||||
foreach ($abilities as $ability) {
|
||||
if (! $request->user()->tokenCan($ability)) {
|
||||
throw new MissingAbilityException($ability);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
34
vendor/laravel/sanctum/src/Http/Middleware/CheckForAnyAbility.php
vendored
Normal file
34
vendor/laravel/sanctum/src/Http/Middleware/CheckForAnyAbility.php
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Laravel\Sanctum\Exceptions\MissingAbilityException;
|
||||
|
||||
class CheckForAnyAbility
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param mixed ...$abilities
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingAbilityException
|
||||
*/
|
||||
public function handle($request, $next, ...$abilities)
|
||||
{
|
||||
if (! $request->user() || ! $request->user()->currentAccessToken()) {
|
||||
throw new AuthenticationException;
|
||||
}
|
||||
|
||||
foreach ($abilities as $ability) {
|
||||
if ($request->user()->tokenCan($ability)) {
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
throw new MissingAbilityException($abilities);
|
||||
}
|
||||
}
|
||||
31
vendor/laravel/sanctum/src/Http/Middleware/CheckForAnyScope.php
vendored
Normal file
31
vendor/laravel/sanctum/src/Http/Middleware/CheckForAnyScope.php
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Laravel\Sanctum\Exceptions\MissingScopeException;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see \Laravel\Sanctum\Http\Middleware\CheckForAnyAbility
|
||||
*/
|
||||
class CheckForAnyScope
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param mixed ...$scopes
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingScopeException
|
||||
*/
|
||||
public function handle($request, $next, ...$scopes)
|
||||
{
|
||||
try {
|
||||
return (new CheckForAnyAbility())->handle($request, $next, ...$scopes);
|
||||
} catch (\Laravel\Sanctum\Exceptions\MissingAbilityException $e) {
|
||||
throw new MissingScopeException($e->abilities());
|
||||
}
|
||||
}
|
||||
}
|
||||
31
vendor/laravel/sanctum/src/Http/Middleware/CheckScopes.php
vendored
Normal file
31
vendor/laravel/sanctum/src/Http/Middleware/CheckScopes.php
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Laravel\Sanctum\Exceptions\MissingScopeException;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see \Laravel\Sanctum\Http\Middleware\CheckAbilities
|
||||
*/
|
||||
class CheckScopes
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param mixed ...$scopes
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingScopeException
|
||||
*/
|
||||
public function handle($request, $next, ...$scopes)
|
||||
{
|
||||
try {
|
||||
return (new CheckAbilities())->handle($request, $next, ...$scopes);
|
||||
} catch (\Laravel\Sanctum\Exceptions\MissingAbilityException $e) {
|
||||
throw new MissingScopeException($e->abilities());
|
||||
}
|
||||
}
|
||||
}
|
||||
93
vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php
vendored
Normal file
93
vendor/laravel/sanctum/src/Http/Middleware/EnsureFrontendRequestsAreStateful.php
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum\Http\Middleware;
|
||||
|
||||
use Illuminate\Routing\Pipeline;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
class EnsureFrontendRequestsAreStateful
|
||||
{
|
||||
/**
|
||||
* Handle the incoming requests.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param callable $next
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function handle($request, $next)
|
||||
{
|
||||
$this->configureSecureCookieSessions();
|
||||
|
||||
return (new Pipeline(app()))->send($request)->through(
|
||||
static::fromFrontend($request) ? $this->frontendMiddleware() : []
|
||||
)->then(function ($request) use ($next) {
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure secure cookie sessions.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureSecureCookieSessions()
|
||||
{
|
||||
config([
|
||||
'session.http_only' => true,
|
||||
'session.same_site' => 'lax',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the middleware that should be applied to requests from the "frontend".
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function frontendMiddleware()
|
||||
{
|
||||
$middleware = array_values(array_filter(array_unique([
|
||||
config('sanctum.middleware.encrypt_cookies', \Illuminate\Cookie\Middleware\EncryptCookies::class),
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
config('sanctum.middleware.validate_csrf_token', config('sanctum.middleware.verify_csrf_token', \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class)),
|
||||
config('sanctum.middleware.authenticate_session'),
|
||||
])));
|
||||
|
||||
array_unshift($middleware, function ($request, $next) {
|
||||
$request->attributes->set('sanctum', true);
|
||||
|
||||
return $next($request);
|
||||
});
|
||||
|
||||
return $middleware;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given request is from the first-party application frontend.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return bool
|
||||
*/
|
||||
public static function fromFrontend($request)
|
||||
{
|
||||
$domain = $request->headers->get('referer') ?: $request->headers->get('origin');
|
||||
|
||||
if (is_null($domain)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$domain = Str::replaceFirst('https://', '', $domain);
|
||||
$domain = Str::replaceFirst('http://', '', $domain);
|
||||
$domain = Str::endsWith($domain, '/') ? $domain : "{$domain}/";
|
||||
|
||||
$stateful = array_filter(config('sanctum.stateful', []));
|
||||
|
||||
return Str::is(Collection::make($stateful)->map(function ($uri) use ($request) {
|
||||
$uri = $uri === Sanctum::$currentRequestHostPlaceholder ? $request->getHttpHost() : $uri;
|
||||
|
||||
return trim($uri).'/*';
|
||||
})->all(), $domain);
|
||||
}
|
||||
}
|
||||
43
vendor/laravel/sanctum/src/NewAccessToken.php
vendored
Normal file
43
vendor/laravel/sanctum/src/NewAccessToken.php
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Contracts\Support\Jsonable;
|
||||
|
||||
class NewAccessToken implements Arrayable, Jsonable
|
||||
{
|
||||
/**
|
||||
* Create a new access token result.
|
||||
*
|
||||
* @param \Laravel\Sanctum\PersonalAccessToken $accessToken The access token instance.
|
||||
* @param string $plainTextToken The plain text version of the token.
|
||||
*/
|
||||
public function __construct(public PersonalAccessToken $accessToken, public string $plainTextToken)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the instance as an array.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return [
|
||||
'accessToken' => $this->accessToken,
|
||||
'plainTextToken' => $this->plainTextToken,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the object to its JSON representation.
|
||||
*
|
||||
* @param int $options
|
||||
* @return string
|
||||
*/
|
||||
public function toJson($options = 0)
|
||||
{
|
||||
return json_encode($this->toArray(), $options);
|
||||
}
|
||||
}
|
||||
93
vendor/laravel/sanctum/src/PersonalAccessToken.php
vendored
Normal file
93
vendor/laravel/sanctum/src/PersonalAccessToken.php
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Laravel\Sanctum\Contracts\HasAbilities;
|
||||
|
||||
class PersonalAccessToken extends Model implements HasAbilities
|
||||
{
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'abilities' => 'json',
|
||||
'last_used_at' => 'datetime',
|
||||
'expires_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'token',
|
||||
'abilities',
|
||||
'expires_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the tokenable model that the access token belongs to.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
*/
|
||||
public function tokenable()
|
||||
{
|
||||
return $this->morphTo('tokenable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the token instance matching the given token.
|
||||
*
|
||||
* @param string $token
|
||||
* @return static|null
|
||||
*/
|
||||
public static function findToken($token)
|
||||
{
|
||||
if (strpos($token, '|') === false) {
|
||||
return static::where('token', hash('sha256', $token))->first();
|
||||
}
|
||||
|
||||
[$id, $token] = explode('|', $token, 2);
|
||||
|
||||
if ($instance = static::find($id)) {
|
||||
return hash_equals($instance->token, hash('sha256', $token)) ? $instance : null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the token has a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function can($ability)
|
||||
{
|
||||
return in_array('*', $this->abilities, true) ||
|
||||
in_array($ability, $this->abilities, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the token is missing a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function cant($ability)
|
||||
{
|
||||
return ! $this->can($ability);
|
||||
}
|
||||
}
|
||||
137
vendor/laravel/sanctum/src/Sanctum.php
vendored
Normal file
137
vendor/laravel/sanctum/src/Sanctum.php
vendored
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @template TToken of \Laravel\Sanctum\Contracts\HasAbilities = \Laravel\Sanctum\PersonalAccessToken
|
||||
*/
|
||||
class Sanctum
|
||||
{
|
||||
/**
|
||||
* The personal access client model class name.
|
||||
*
|
||||
* @var class-string<TToken>
|
||||
*/
|
||||
public static $personalAccessTokenModel = 'Laravel\\Sanctum\\PersonalAccessToken';
|
||||
|
||||
/**
|
||||
* A callback that can get the token from the request.
|
||||
*
|
||||
* @var callable|null
|
||||
*/
|
||||
public static $accessTokenRetrievalCallback;
|
||||
|
||||
/**
|
||||
* A callback that can add to the validation of the access token.
|
||||
*
|
||||
* @var callable|null
|
||||
*/
|
||||
public static $accessTokenAuthenticationCallback;
|
||||
|
||||
/**
|
||||
* A placeholder to instruct Sanctum to include the current request host in the list of stateful domains.
|
||||
*
|
||||
* @var string;
|
||||
*/
|
||||
public static $currentRequestHostPlaceholder = '__SANCTUM_CURRENT_REQUEST_HOST__';
|
||||
|
||||
/**
|
||||
* Get the current application URL from the "APP_URL" environment variable - with port.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function currentApplicationUrlWithPort()
|
||||
{
|
||||
$appUrl = config('app.url');
|
||||
|
||||
return $appUrl ? ','.parse_url($appUrl, PHP_URL_HOST).(parse_url($appUrl, PHP_URL_PORT) ? ':'.parse_url($appUrl, PHP_URL_PORT) : '') : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a fixed token instructing Sanctum to include the current request host in the list of stateful domains.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function currentRequestHost()
|
||||
{
|
||||
return ','.static::$currentRequestHostPlaceholder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current user for the application with the given abilities.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Authenticatable|\Laravel\Sanctum\HasApiTokens $user
|
||||
* @param array $abilities
|
||||
* @param string $guard
|
||||
* @return \Illuminate\Contracts\Auth\Authenticatable
|
||||
*/
|
||||
public static function actingAs($user, $abilities = [], $guard = 'sanctum')
|
||||
{
|
||||
$token = Mockery::mock(self::personalAccessTokenModel())->shouldIgnoreMissing(false);
|
||||
|
||||
if (in_array('*', $abilities)) {
|
||||
$token->shouldReceive('can')->withAnyArgs()->andReturn(true);
|
||||
} else {
|
||||
foreach ($abilities as $ability) {
|
||||
$token->shouldReceive('can')->with($ability)->andReturn(true);
|
||||
}
|
||||
}
|
||||
|
||||
$user->withAccessToken($token);
|
||||
|
||||
if (isset($user->wasRecentlyCreated) && $user->wasRecentlyCreated) {
|
||||
$user->wasRecentlyCreated = false;
|
||||
}
|
||||
|
||||
app('auth')->guard($guard)->setUser($user);
|
||||
|
||||
app('auth')->shouldUse($guard);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the personal access token model name.
|
||||
*
|
||||
* @param class-string<TToken> $model
|
||||
* @return void
|
||||
*/
|
||||
public static function usePersonalAccessTokenModel($model)
|
||||
{
|
||||
static::$personalAccessTokenModel = $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a callback that should be used to fetch the access token from the request.
|
||||
*
|
||||
* @param callable|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public static function getAccessTokenFromRequestUsing(?callable $callback)
|
||||
{
|
||||
static::$accessTokenRetrievalCallback = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a callback that should be used to authenticate access tokens.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return void
|
||||
*/
|
||||
public static function authenticateAccessTokensUsing(callable $callback)
|
||||
{
|
||||
static::$accessTokenAuthenticationCallback = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the token model class name.
|
||||
*
|
||||
* @return class-string<TToken>
|
||||
*/
|
||||
public static function personalAccessTokenModel()
|
||||
{
|
||||
return static::$personalAccessTokenModel;
|
||||
}
|
||||
}
|
||||
130
vendor/laravel/sanctum/src/SanctumServiceProvider.php
vendored
Normal file
130
vendor/laravel/sanctum/src/SanctumServiceProvider.php
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Illuminate\Auth\RequestGuard;
|
||||
use Illuminate\Contracts\Http\Kernel;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Sanctum\Console\Commands\PruneExpired;
|
||||
use Laravel\Sanctum\Http\Controllers\CsrfCookieController;
|
||||
use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful;
|
||||
|
||||
class SanctumServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
config([
|
||||
'auth.guards.sanctum' => array_merge([
|
||||
'driver' => 'sanctum',
|
||||
'provider' => null,
|
||||
], config('auth.guards.sanctum', [])),
|
||||
]);
|
||||
|
||||
if (! app()->configurationIsCached()) {
|
||||
$this->mergeConfigFrom(__DIR__.'/../config/sanctum.php', 'sanctum');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
if (app()->runningInConsole()) {
|
||||
$this->publishesMigrations([
|
||||
__DIR__.'/../database/migrations' => database_path('migrations'),
|
||||
], 'sanctum-migrations');
|
||||
|
||||
$this->publishes([
|
||||
__DIR__.'/../config/sanctum.php' => config_path('sanctum.php'),
|
||||
], 'sanctum-config');
|
||||
|
||||
$this->commands([
|
||||
PruneExpired::class,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->defineRoutes();
|
||||
$this->configureGuard();
|
||||
$this->configureMiddleware();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the Sanctum routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function defineRoutes()
|
||||
{
|
||||
if (app()->routesAreCached() || config('sanctum.routes') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
Route::group(['prefix' => config('sanctum.prefix', 'sanctum')], function () {
|
||||
Route::get(
|
||||
'/csrf-cookie',
|
||||
CsrfCookieController::class.'@show'
|
||||
)->middleware('web')->name('sanctum.csrf-cookie');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the Sanctum authentication guard.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureGuard()
|
||||
{
|
||||
Auth::resolved(function ($auth) {
|
||||
$requestGuardCreator = fn ($config) => $this->createGuard($auth, $config);
|
||||
|
||||
$auth->extend('sanctum', function ($app, $name, array $config) use ($requestGuardCreator) {
|
||||
return tap($requestGuardCreator($config), function ($guard) {
|
||||
app()->refresh('request', $guard, 'setRequest');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the guard.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Factory $auth
|
||||
* @param array $config
|
||||
* @return RequestGuard
|
||||
*/
|
||||
protected function createGuard($auth, $config)
|
||||
{
|
||||
return new RequestGuard(
|
||||
new Guard(
|
||||
$auth,
|
||||
config('sanctum.expiration'),
|
||||
$config['provider'],
|
||||
config('sanctum.last_used_at', true)
|
||||
),
|
||||
request(),
|
||||
$auth->createUserProvider($config['provider'] ?? null)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the Sanctum middleware and priority.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureMiddleware()
|
||||
{
|
||||
$kernel = app()->make(Kernel::class);
|
||||
|
||||
$kernel->prependToMiddlewarePriority(EnsureFrontendRequestsAreStateful::class);
|
||||
}
|
||||
}
|
||||
30
vendor/laravel/sanctum/src/TransientToken.php
vendored
Normal file
30
vendor/laravel/sanctum/src/TransientToken.php
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Laravel\Sanctum;
|
||||
|
||||
use Laravel\Sanctum\Contracts\HasAbilities;
|
||||
|
||||
class TransientToken implements HasAbilities
|
||||
{
|
||||
/**
|
||||
* Determine if the token has a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function can($ability)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the token is missing a given ability.
|
||||
*
|
||||
* @param string $ability
|
||||
* @return bool
|
||||
*/
|
||||
public function cant($ability)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
4
vendor/laravel/sanctum/testbench.yaml
vendored
Normal file
4
vendor/laravel/sanctum/testbench.yaml
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
providers:
|
||||
- Laravel\Sanctum\SanctumServiceProvider
|
||||
migrations:
|
||||
- database/migrations
|
||||
Loading…
Add table
Add a link
Reference in a new issue