Stufe 4c (#764): Bezeichner auf Englisch - Typen, Methoden, Felder, Parameter, Locals, Testnamen
Mit Roslyn umbenannt (Verweise folgen, Zeichenketten bleiben unberuehrt). Nicht umbenannt, weil gespeichert oder ueber die API gebunden (Stufe 4e): Properties, Record-Parameter, Enum-Member sowie die Parameter der Endpunkt-Handler (Routen-/Query-Bindung ueber den Namen). Die JSON-Felder anonymer Objekte bleiben ausdruecklich benannt (JsonFilter: pfad). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
837a634a22
commit
77062facc9
@@ -19,7 +19,7 @@ namespace ClawdDotNet.App.Tests.Services;
|
||||
public sealed class InstanceSecretRoundtripTests
|
||||
{
|
||||
[Fact]
|
||||
public void Zugangsdaten_kommen_im_Klartext_zurueck()
|
||||
public void Credentials_come_back_in_plaintext()
|
||||
{
|
||||
using var host = new TestHost();
|
||||
|
||||
@@ -29,15 +29,15 @@ public sealed class InstanceSecretRoundtripTests
|
||||
|
||||
host.Host.SaveInstance(new InstanceChange(InstanceChangeKind.Settings));
|
||||
|
||||
var geladen = host.Host.Directories.LoadInstanceConfig(host.Host.InstancePath);
|
||||
var loaded = host.Host.Directories.LoadInstanceConfig(host.Host.InstancePath);
|
||||
|
||||
geladen.OpenRouterApiKey.ShouldBe("sk-or-v1-beispielschluessel");
|
||||
geladen.WebUiToken.ShouldBe("ein-hinreichend-langes-token");
|
||||
geladen.Watchdog.AgentToken.ShouldBe("dc-token-beispiel");
|
||||
loaded.OpenRouterApiKey.ShouldBe("sk-or-v1-beispielschluessel");
|
||||
loaded.WebUiToken.ShouldBe("ein-hinreichend-langes-token");
|
||||
loaded.Watchdog.AgentToken.ShouldBe("dc-token-beispiel");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void In_der_Datei_stehen_sie_trotzdem_geschuetzt()
|
||||
public void In_the_file_they_are_still_protected()
|
||||
{
|
||||
// The counter-check: decrypting when loading must not mean that nothing is
|
||||
// encrypted any more.
|
||||
@@ -46,22 +46,22 @@ public sealed class InstanceSecretRoundtripTests
|
||||
host.Host.Instance.OpenRouterApiKey = "sk-or-v1-beispielschluessel";
|
||||
host.Host.SaveInstance(new InstanceChange(InstanceChangeKind.Settings));
|
||||
|
||||
var rohtext = File.ReadAllText(
|
||||
var rawText = File.ReadAllText(
|
||||
Path.Combine(host.Host.InstancePath, "InstanceSettings.json"));
|
||||
|
||||
rohtext.ShouldNotContain("sk-or-v1-beispielschluessel");
|
||||
rawText.ShouldNotContain("sk-or-v1-beispielschluessel");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Klartext_aus_aelteren_Dateien_bleibt_lesbar()
|
||||
public void Plaintext_from_older_files_stays_readable()
|
||||
{
|
||||
// Decrypting must be safely applicable to something that was never encrypted
|
||||
// — otherwise the first start after the update would break every existing instance.
|
||||
using var host = new TestHost();
|
||||
|
||||
var pfad = Path.Combine(host.Host.InstancePath, "InstanceSettings.json");
|
||||
var path = Path.Combine(host.Host.InstancePath, "InstanceSettings.json");
|
||||
|
||||
File.WriteAllText(pfad, """
|
||||
File.WriteAllText(path, """
|
||||
{
|
||||
"instanceId": "alt",
|
||||
"instanceName": "Alt",
|
||||
@@ -70,14 +70,14 @@ public sealed class InstanceSecretRoundtripTests
|
||||
}
|
||||
""");
|
||||
|
||||
var geladen = host.Host.Directories.LoadInstanceConfig(host.Host.InstancePath);
|
||||
var loaded = host.Host.Directories.LoadInstanceConfig(host.Host.InstancePath);
|
||||
|
||||
geladen.OpenRouterApiKey.ShouldBe("klartext-von-hand-eingetragen");
|
||||
geladen.WebUiToken.ShouldBe("auch-klartext");
|
||||
loaded.OpenRouterApiKey.ShouldBe("klartext-von-hand-eingetragen");
|
||||
loaded.WebUiToken.ShouldBe("auch-klartext");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Zweimal_speichern_verschluesselt_nicht_zweimal()
|
||||
public void Saving_twice_does_not_encrypt_twice()
|
||||
{
|
||||
using var host = new TestHost();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user