feat(uploader): server session with trust-on-first-use sign-in and LAN discovery
Checks the certificate before sending the password and returns an unknown self-signed fingerprint for confirmation; restores the saved token, reports quota, probes every 30 s while offline, signs out when the token is rejected or the certificate changes, and maps transport failures for the engine. UDP beacon listener for servers on the LAN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+585
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using Titano.Testing;
|
||||
using Titano.Uploader.Server;
|
||||
|
||||
namespace Titano.App.Tests.Uploader;
|
||||
|
||||
public sealed class ServerAddressTests
|
||||
{
|
||||
[Theory]
|
||||
[Case("nas.local:8443", "https://nas.local:8443/")]
|
||||
[Case("https://nas.local:8443", "https://nas.local:8443/")]
|
||||
[Case(" http://192.168.1.20:8080/titano ", "http://192.168.1.20:8080/titano/")]
|
||||
[Case("https://nas.local/?x=1#y", "https://nas.local/")]
|
||||
public void ServerAddressesBecomeApiBases(string typed, string expected)
|
||||
{
|
||||
Assert.True(ServerAddress.TryParse(typed, out var uri));
|
||||
Assert.Equal(expected, uri.ToString());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Case("")]
|
||||
[Case(" ")]
|
||||
[Case("ftp://nas.local")]
|
||||
[Case("https://")]
|
||||
public void InvalidServerAddressesAreRejected(string typed) => Assert.False(ServerAddress.TryParse(typed, out _));
|
||||
}
|
||||
Reference in new issue
Block a user