feat(uploader): settings, DPAPI token, single instance and startup registration

uploader.json (server, user, DPAPI CurrentUser-protected token, trusted
fingerprints, options, watch folders) written atomically; command line
(paths, --tray, --capture); named mutex plus a current-user named pipe
that hands a second launch's paths to the running instance; HKCU Run
key for "Start with Windows"; coalescing background writer for state
files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 10:27:36 +00:00
1 parent 27f0d73f05
commit ad5c3e0f37
10 files changed
+540

No files matched your search

@@ -0,0 +1,27 @@
using Titano.Testing;
using Titano.Uploader.Infrastructure;
namespace Titano.App.Tests.Uploader;
public sealed class TokenProtectorTests
{
[Test]
[WindowsOnly]
public void TokenRoundTripsThroughDpapiWithoutPlainText()
{
const string token = "ttn_4f9a1c2e7b";
var blob = TokenProtector.Protect(token);
Assert.False(blob.Contains(token, StringComparison.Ordinal));
Assert.Equal(token, TokenProtector.Unprotect(blob));
}
[Test]
[WindowsOnly]
public void DamagedBlobsGiveNoToken()
{
var blob = Convert.FromBase64String(TokenProtector.Protect("secret"));
blob[^1] ^= 0xFF;
Assert.Null(TokenProtector.Unprotect(Convert.ToBase64String(blob)));
Assert.Null(TokenProtector.Unprotect("not base64!"));
}
}