Change Requirements for Authorization and Authentication Handling ...

This commit is contained in:
2026-11-05 20:08:11 +03:30
parent e9a5e24943
commit 357bf221fa
8 changed files with 236 additions and 22 deletions
+14 -8
View File
@@ -37,28 +37,34 @@ namespace xAiService.Controllers
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> HandleMcp(
public virtual async Task<IActionResult> HandleMcp(
[FromBody] JObject request,
CancellationToken cancellationToken = default
)
{
//
var userInfo = await GetUserInfo();
var connectionId = GetConnectionId();
//
var response = await mcpHandler.ProcessAsync(
request,
cancellationToken
request: request,
userInfo: userInfo,
connectionId: connectionId,
cancellationToken: cancellationToken
);
//
return Ok(response);
}
}
/// <summary>
/// Handle SSE EndPoint ...
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpGet("sse")]
public async Task SseEndpoint(
public virtual async Task SseEndpoint(
CancellationToken cancellationToken = default
)
{
@@ -72,7 +78,7 @@ namespace xAiService.Controllers
"event: endpoint\ndata: /mcp\n\n",
cancellationToken
);
//
await Response.Body.FlushAsync(cancellationToken);
@@ -81,6 +87,6 @@ namespace xAiService.Controllers
{
await Task.Delay(1000, cancellationToken);
}
}
}
}
}