Stufe 4c (#764): Kommentare in C#, WebUI-Skripten, CSS und HTML auf Englisch
Rund 2.600 Kommentarblöcke in 310 C#-Dateien übersetzt, Begründungen vollständig erhalten: blockweise gleiche Anzahl wie vorher, kein Block unter 60 % seiner Länge, der Code außerhalb der Kommentare per Tokenizer byte-identisch geprüft. Zitate deutscher Oberflächentexte und Testdaten bleiben deutsch. WebUI: Kommentare in JS/CSS/HTML übersetzt, JSDoc-@param an die in 4b umbenannten Parameter angeglichen. Dabei behoben: - 4b hatte "tag" (HTML-Tag) als deutsches "Tag" gelesen und zu "dayValue" gemacht (makeElement, svg, Tagesübersicht) - zurück auf tag/day. - Aufgaben "InProgress" bekamen die Plakettenart "laufend", für die es nie eine CSS-Klasse gab - jetzt "success" wie laufende Instanzen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
da4ceac7d5
commit
837a634a22
@@ -5,8 +5,8 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Tools.Tests.WebFetch;
|
||||
|
||||
/// <summary>
|
||||
/// Stufe 1 von WebFetch (#602): Hauptinhalt als kompaktes Markdown statt der ganzen Seite als
|
||||
/// Fliesstext. Die Beispielseiten sind selbst geschrieben und bilden typische Aufbauten nach.
|
||||
/// Stage 1 of WebFetch (#602): main content as compact Markdown instead of the whole page as
|
||||
/// running text. The sample pages are self-written and reproduce typical structures.
|
||||
/// </summary>
|
||||
public sealed class HtmlExtraktorTests
|
||||
{
|
||||
@@ -208,14 +208,14 @@ public sealed class HtmlExtraktorTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Was bei welcher Antwort beim Modell ankommt (#602).</summary>
|
||||
/// <summary>What arrives at the model for which response (#602).</summary>
|
||||
public sealed class WebInhaltTests
|
||||
{
|
||||
private static readonly Uri Quelle = new("https://api.beispiel.de/v1/wetter");
|
||||
|
||||
[Theory]
|
||||
[InlineData("application/json")]
|
||||
[InlineData("text/html")] // Server, die JSON als HTML ausliefern, gibt es
|
||||
[InlineData("text/html")] // servers that deliver JSON as HTML do exist
|
||||
[InlineData(null)]
|
||||
public void Json_bleibt_unveraendert(string? mediaType)
|
||||
{
|
||||
@@ -231,9 +231,9 @@ public sealed class WebInhaltTests
|
||||
[Fact]
|
||||
public void Zu_wenig_Hauptinhalt_faellt_mit_Hinweis_auf_den_Volltext_zurueck()
|
||||
{
|
||||
// Uebersichtsseite: Der Inhalt ist eine Linkliste in der Navigation, im Body steht nur ein
|
||||
// Platzhalter, den JavaScript fuellen wuerde. Die Extraktion entfernt die Navigation zu Recht
|
||||
// und behaelt fast nichts - dann ist der Volltext die bessere Antwort.
|
||||
// Overview page: the content is a link list in the navigation, the body only holds a
|
||||
// placeholder that JavaScript would fill. The extraction rightly removes the navigation
|
||||
// and keeps almost nothing - then the full text is the better answer.
|
||||
var html = "<html><body><nav><ul>"
|
||||
+ string.Concat(Enumerable.Range(1, 60).Select(i => $"<li><a href=\"/rubrik/{i}\">Rubrik {i}</a></li>"))
|
||||
+ "</ul></nav><div id=\"app\">Lade …</div></body></html>";
|
||||
|
||||
@@ -5,9 +5,9 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Tools.Tests.WebFetch;
|
||||
|
||||
/// <summary>
|
||||
/// #632: Die DWD-Unwetterwarnungen (JSONP, ganz Deutschland) wurden abschnittsweise
|
||||
/// vollstaendig gelesen - 160.000 Tokens fuer eine einzige Stadt. Mit filter kommt nur,
|
||||
/// was passt.
|
||||
/// #632: The DWD severe weather warnings (JSONP, all of Germany) were read completely,
|
||||
/// section by section - 160,000 tokens for a single city. With filter only what
|
||||
/// matches comes.
|
||||
/// </summary>
|
||||
public sealed class JsonFilterTests
|
||||
{
|
||||
|
||||
@@ -6,9 +6,9 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Tools.Tests.WebFetch;
|
||||
|
||||
/// <summary>
|
||||
/// #580: Die Pruefung der URL sieht nur den Namen. localtest.me steht auf keiner Sperrliste
|
||||
/// und loest auf 127.0.0.1 auf - im Pruefdurchgang oeffnete WebFetch damit eine Verbindung
|
||||
/// auf Loopback. Geprueft wird deshalb die aufgeloeste Adresse, ohne echtes Netz.
|
||||
/// #580: Checking the URL only sees the name. localtest.me is on no blocklist
|
||||
/// and resolves to 127.0.0.1 - in the test run WebFetch thus opened a connection
|
||||
/// to loopback. That's why the resolved address is checked, without a real network.
|
||||
/// </summary>
|
||||
public sealed class UrlGuardAufloesungTests
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public sealed class UrlGuardAufloesungTests
|
||||
[Fact]
|
||||
public async Task Ein_Name_mit_oeffentlicher_und_interner_Adresse_wird_gesperrt()
|
||||
{
|
||||
// Genau das Muster, mit dem man eine Stichprobenpruefung ueberlistet.
|
||||
// Exactly the pattern with which you outwit a sampling check.
|
||||
await Should.ThrowAsync<HttpRequestException>(
|
||||
() => UrlGuard.ResolveAllowedAsync("gemischt.example", Aufloesung("93.184.215.14", "127.0.0.1"), default));
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Tools.Tests.WebFetch;
|
||||
|
||||
/// <summary>
|
||||
/// S5 aus der Bestandsaufnahme: Die Whitelist wurde nur auf die Ausgangs-URL angewendet,
|
||||
/// HttpClient folgte Weiterleitungen aber selbst. Eine erlaubte Domain konnte damit ins
|
||||
/// lokale Netz weiterleiten — Router, NAS, der eigene Git-Server, Cloud-Metadatendienste.
|
||||
/// S5 from the inventory: the whitelist was only applied to the initial URL,
|
||||
/// but HttpClient followed redirects itself. An allowed domain could thus redirect into the
|
||||
/// local network — router, NAS, the own Git server, cloud metadata services.
|
||||
/// </summary>
|
||||
public sealed class UrlGuardTests
|
||||
{
|
||||
@@ -16,11 +16,11 @@ public sealed class UrlGuardTests
|
||||
=> UrlGuard.TryValidate(url, Allowed, out _, out error);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Netzsperren
|
||||
// Network blocks
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Theory]
|
||||
[InlineData("http://169.254.169.254/latest/meta-data/")] // Cloud-Metadaten
|
||||
[InlineData("http://169.254.169.254/latest/meta-data/")] // cloud metadata
|
||||
[InlineData("http://127.0.0.1:8080/")]
|
||||
[InlineData("http://localhost:8418/")]
|
||||
[InlineData("http://192.168.178.10:8418/Richard/ClawdDotNet.git")]
|
||||
@@ -40,8 +40,8 @@ public sealed class UrlGuardTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("172.15.0.1")] // knapp unterhalb von 172.16/12
|
||||
[InlineData("172.32.0.1")] // knapp oberhalb
|
||||
[InlineData("172.15.0.1")] // just below 172.16/12
|
||||
[InlineData("172.32.0.1")] // just above
|
||||
[InlineData("11.0.0.1")]
|
||||
[InlineData("8.8.8.8")]
|
||||
public void Oeffentliche_Adressen_gelten_nicht_als_privat(string host)
|
||||
@@ -94,8 +94,8 @@ public sealed class UrlGuardTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Die alte Fassung entfernte "www." per Ersetzen über die ganze Zeichenkette:
|
||||
/// aus "mywww.example.com" wurde "myexample.com".
|
||||
/// The old version removed "www." via a replace across the whole string:
|
||||
/// "mywww.example.com" became "myexample.com".
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Die_www_Behandlung_verstuemmelt_keine_anderen_Hostnamen()
|
||||
@@ -107,7 +107,7 @@ public sealed class UrlGuardTests
|
||||
[Fact]
|
||||
public void Ein_abschliessender_Punkt_im_Host_umgeht_die_Whitelist_nicht()
|
||||
{
|
||||
// "example.com." ist DNS-technisch derselbe Host.
|
||||
// "example.com." is the same host in DNS terms.
|
||||
UrlGuard.IsDomainAllowed("evil.com.", Allowed).ShouldBeFalse();
|
||||
UrlGuard.IsDomainAllowed("example.com.", Allowed).ShouldBeTrue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user