Changed private web pages and the Confluence search to require a High-confidence provider

This commit is contained in:
Thorsten Sommer committed 2026-09-23 16:31:21 +02:00
1 parent 56978d88f2
commit ad6b285c8d
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) &&