mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-17 06:14:40 +00:00
fix(api): validate token team context
This commit is contained in:
1 parent
4d0be415c8
commit
a511bd9b67
14 files changed
+277
-23
No files matched your search
@@ -192,3 +192,14 @@ test('tool calls fail when the token lacks the read ability', function () {
|
||||
expect($response->json('result.isError'))->toBeTrue();
|
||||
expect($response->json('result.content.0.text'))->toContain('Missing required permissions');
|
||||
});
|
||||
|
||||
test('MCP rejects token when user no longer belongs to token team', function () {
|
||||
Project::create(['name' => 'Hidden', 'team_id' => $this->team->id]);
|
||||
$token = $this->user->createToken('mcp-read', ['read'])->plainTextToken;
|
||||
|
||||
$this->team->members()->detach($this->user->id);
|
||||
|
||||
$response = mcpCallTool($token, 'list_projects');
|
||||
|
||||
$response->assertUnauthorized();
|
||||
});
|
||||
Reference in new issue
Block a user