add support filling policy handler ...
This commit is contained in:
@@ -160,7 +160,7 @@ namespace xAiApi.Providers
|
||||
//
|
||||
var tasks = servers
|
||||
.Select(s =>
|
||||
ConnectAndValidateAsync(s, cancellationToken));
|
||||
ConnectAndValidateAsync(s, userInfo, cancellationToken));
|
||||
await Task.WhenAll(tasks);
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace xAiApi.Providers
|
||||
await initLock.WaitAsync(cancellationToken);
|
||||
try
|
||||
{
|
||||
await ConnectAndValidateAsync(result, cancellationToken);
|
||||
await ConnectAndValidateAsync(result, userInfo, cancellationToken);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -497,7 +497,7 @@ namespace xAiApi.Providers
|
||||
|
||||
//
|
||||
// Update ...
|
||||
await ConnectAndValidateAsync(result, cancellationToken);
|
||||
await ConnectAndValidateAsync(result, userInfo, cancellationToken);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -774,7 +774,7 @@ namespace xAiApi.Providers
|
||||
await initLock.WaitAsync(cancellationToken);
|
||||
try
|
||||
{
|
||||
await ConnectAndValidateAsync(exists, cancellationToken);
|
||||
await ConnectAndValidateAsync(exists, userInfo, cancellationToken);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -862,7 +862,7 @@ namespace xAiApi.Providers
|
||||
{
|
||||
if (exists.Enabled)
|
||||
{
|
||||
await ConnectAndValidateAsync(exists, cancellationToken);
|
||||
await ConnectAndValidateAsync(exists, userInfo, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1201,7 +1201,8 @@ namespace xAiApi.Providers
|
||||
|
||||
private async Task ConnectAndValidateAsync(
|
||||
XAiMcpServerDto descriptor,
|
||||
CancellationToken cancellationToken
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -1215,7 +1216,9 @@ namespace xAiApi.Providers
|
||||
var client = await CreateClientAsync(descriptor, cts.Token);
|
||||
await client.PingAsync(cancellationToken: cts.Token);
|
||||
var serverTools = await client
|
||||
.ListToolsAsync(cancellationToken: cts.Token);
|
||||
.ListToolsAsync(
|
||||
cancellationToken: cts.Token
|
||||
);
|
||||
|
||||
//
|
||||
clients[descriptor.Id] = client;
|
||||
|
||||
Reference in New Issue
Block a user