Add Super-Admin tools for managing any model

- 🛠️ Introduced generic Super-Admin MCP tools, including `list-models`, `describe-model`, `list-records`, `show-record`, `create-record`, and `update-record`.
- 🛡️ Restricted modification of critical fields (e.g., passwords, roles, tokens) to enhance security.
-  Added extensive feature tests for Super-Admin functionality and access control.
- 📜 Increased pagination length to accommodate new tools on a single page.
- 🔗 Registered Super-Admin tools in `EinundzwanzigServer`.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-08 13:39:04 +02:00
parent 3a507cced2
commit 8c68b19138
14 changed files with 810 additions and 6 deletions
+21
View File
@@ -76,6 +76,27 @@ it('completes a Lightning login and redirects to the dashboard when a recent Log
$this->assertAuthenticatedAs($user);
});
it('resumes the intended OAuth url after a Lightning login instead of going to the dashboard', function () {
$user = User::factory()->create();
$k1 = bin2hex(random_bytes(32));
LoginKey::factory()->create([
'user_id' => $user->id,
'k1' => $k1,
'created_at' => now(),
]);
$intended = url('/oauth/authorize?client_id=1&response_type=code&scope=mcp:use');
$response = $this->withSession([
'lang_country' => 'de-DE',
'locale' => 'de',
'url.intended' => $intended,
])->get(route('auth.ln.complete', ['k1' => $k1]));
$response->assertRedirect($intended);
$this->assertAuthenticatedAs($user);
});
it('redirects to login when the LoginKey is older than 5 minutes', function () {
$user = User::factory()->create();
$k1 = bin2hex(random_bytes(32));