mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-09 08:29:40 +00:00
Changed private web pages and the Confluence search to require a High-confidence provider
This commit is contained in:
11 files changed
+34
-51
No files matched your search
@@ -124,12 +124,12 @@ public sealed class WebPageRetrievalService(HTMLParser htmlParser)
|
||||
if (options.PublicTargetsOnly || options.IsPrivateHostAllowed?.Invoke(url.Host) is not true)
|
||||
throw new WebPageAccessBlockedException("Private or local-network web page URLs are not supported unless their host is explicitly allowed.", WebPageAccessBlockReason.PRIVATE_HOST_NOT_ALLOWED);
|
||||
|
||||
if (options.ProviderConfidence >= ConfidenceLevel.HIGH || options.ProviderIsTrustedByConfiguration)
|
||||
if (options.ProviderConfidence >= ConfidenceLevel.HIGH)
|
||||
return addresses;
|
||||
|
||||
if (options.OnPrivateHostProviderBlockAsync is not null)
|
||||
await options.OnPrivateHostProviderBlockAsync(url, options.ProviderConfidence);
|
||||
throw new WebPageAccessBlockedException("This private or VPN web page requires a High-confidence provider or a provider trusted by configuration.", WebPageAccessBlockReason.INSUFFICIENT_PROVIDER_CONFIDENCE);
|
||||
throw new WebPageAccessBlockedException("This private or VPN web page requires a High-confidence provider.", WebPageAccessBlockReason.INSUFFICIENT_PROVIDER_CONFIDENCE);
|
||||
}
|
||||
|
||||
private static async Task<IReadOnlyList<IPAddress>> ResolveHostAddressesAsync(Uri url, CancellationToken token)
|
||||
@@ -154,8 +154,7 @@ public sealed class WebPageRetrievalService(HTMLParser htmlParser)
|
||||
Uri candidateUrl,
|
||||
IReadOnlyList<IPAddress> addresses,
|
||||
WebPageRetrievalOptions options) =>
|
||||
options.UseOsSso &&
|
||||
(options.ProviderConfidence >= ConfidenceLevel.HIGH || options.ProviderIsTrustedByConfiguration) &&
|
||||
options is { UseOsSso: true, ProviderConfidence: >= ConfidenceLevel.HIGH } &&
|
||||
candidateUrl.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase) &&
|
||||
originalUrl.Scheme.Equals(candidateUrl.Scheme, StringComparison.OrdinalIgnoreCase) &&
|
||||
originalUrl.Host.Equals(candidateUrl.Host, StringComparison.OrdinalIgnoreCase) &&
|
||||
|
||||
Reference in new issue
Block a user