mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 02:50:29 +00:00
✨ 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:
@@ -17,6 +17,7 @@ use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Nightwatch\Facades\Nightwatch;
|
||||
use Laravel\Nightwatch\Http\Middleware\Sample;
|
||||
use Laravel\Passport\Passport;
|
||||
use Livewire\Livewire;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -40,6 +41,15 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
Gate::define('viewApiDocs', fn (?Authenticatable $user = null): bool => true);
|
||||
|
||||
// OAuth-2.1-Flow des MCP-Servers (Claude.ai Web-Connector).
|
||||
Passport::authorizationView(fn ($parameters) => view('mcp.authorize', $parameters));
|
||||
|
||||
// Kurze Access-Token-Lebensdauer mit Refresh-Rotation begrenzt den Schaden eines
|
||||
// geleakten Tokens (öffentliche PKCE-Clients ohne Client-Secret). Passport-Default
|
||||
// wäre sonst 1 Jahr für Access- UND Refresh-Token.
|
||||
Passport::tokensExpireIn(now()->addHours(8));
|
||||
Passport::refreshTokensExpireIn(now()->addDays(14));
|
||||
|
||||
if ($this->app->environment('production')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user