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:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Servers\EinundzwanzigServer;
|
||||
use App\Mcp\Tools\CourseEvent\UpdateCourseEventTool;
|
||||
use App\Mcp\Tools\Meetup\CreateMeetupTool;
|
||||
use App\Mcp\Tools\Search\SearchCitiesTool;
|
||||
|
||||
it('rejects unauthenticated requests to the mcp endpoint', function () {
|
||||
$this->postJson('/mcp', [
|
||||
'jsonrpc' => '2.0',
|
||||
'id' => 1,
|
||||
'method' => 'tools/list',
|
||||
])->assertUnauthorized();
|
||||
});
|
||||
|
||||
it('registers every domain tool on the server', function () {
|
||||
$property = (new ReflectionClass(EinundzwanzigServer::class))->getProperty('tools');
|
||||
$tools = $property->getDefaultValue();
|
||||
|
||||
expect($tools)->toHaveCount(30)
|
||||
->and($tools)->toContain(CreateMeetupTool::class)
|
||||
->and($tools)->toContain(UpdateCourseEventTool::class)
|
||||
->and($tools)->toContain(SearchCitiesTool::class);
|
||||
});
|
||||
Reference in New Issue
Block a user