Build Charac server and client with OIDC, SSH sessions, and packages
Verify / verify (ubuntu-latest, linux-bionic-arm64) (push) Canceled after 0s
Verify / verify (ubuntu-latest, linux-x64) (push) Canceled after 0s
Verify / verify (windows-latest, win-x64) (push) Canceled after 0s
Verify / postgres (push) Canceled after 0s

This commit is contained in:
Nitload
2026-10-05 14:02:50 +08:00
parent 4bc3552167
commit 0ea679932e
185 changed files with 10653 additions and 772 deletions
@@ -0,0 +1,27 @@
using Charac.Client;
namespace Charac.Server.Tests;
public sealed class ClientConfigurationTests
{
[Fact]
public void LoadsHttpsServerAndRejectsUnsafeOrAmbiguousSettings()
{
var path = Path.Combine(Path.GetTempPath(), "rac-client-config-" + Guid.NewGuid().ToString("N"));
try
{
File.WriteAllText(path, "; per-user endpoint\n[client]\nserver=\"https://access.example.com\"\n");
Assert.Equal("https://access.example.com/", ClientConfiguration.LoadServer(path));
File.WriteAllText(path, "[client]\nserver=http://access.example.com\n");
Assert.Throws<InvalidOperationException>(() => ClientConfiguration.LoadServer(path));
File.WriteAllText(path, "[client]\nserver=https://one.example\nserver=https://two.example\n");
Assert.Throws<InvalidOperationException>(() => ClientConfiguration.LoadServer(path));
}
finally
{
File.Delete(path);
}
}
}