Add OAuth functionality, MCP tools, and feature tests

- 🔒 Added migrations for `oauth_access_tokens`, `oauth_refresh_tokens`, `oauth_auth_codes`, `oauth_clients`, and `oauth_device_codes`.
- 🤖 Created MCP tools (Meetups, Cities, Venues, Courses, Lecturers) for managing entities with authentication and validation.
- 🛠️ Implemented Passport-backed OAuth API guard configuration and validation endpoints.
-  Added comprehensive feature tests for MCP tools and OAuth functionality (access control, validation, and token-based authentication).
This commit is contained in:
HolgerHatGarKeineNode
2026-06-08 09:37:00 +02:00
parent 3cad5f5636
commit d0544bfac9
67 changed files with 3948 additions and 83 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Erzwingt PKCE mit S256 auf dem OAuth-Authorize-Endpunkt.
*
* Die Discovery-Metadaten bewerben ausschließlich S256, der zugrunde liegende
* league/oauth2-server akzeptiert standardmäßig aber auch das schwächere "plain".
* Diese Middleware lehnt jede Authorize-Anfrage mit einer anderen Methode als S256 ab,
* sodass das tatsächliche Verhalten der beworbenen Metadaten entspricht (OAuth 2.1).
*/
class EnforcePkceS256
{
public function handle(Request $request, Closure $next): Response
{
if ($request->is('oauth/authorize')
&& $request->filled('code_challenge')
&& $request->input('code_challenge_method', 'plain') !== 'S256') {
abort(Response::HTTP_BAD_REQUEST, 'Es wird ausschließlich die PKCE-Methode "S256" unterstützt.');
}
return $next($request);
}
}