Change Requirements for Authorization and Authentication Handling ...
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user