refactor(worker): OnlineTokenStore zu DpapiTokenStore verallgemeinert

This commit is contained in:
mika kuns
2026-08-27 12:27:34 +02:00
parent 3171690bae
commit 41bfc242fa
21 changed files with 136 additions and 137 deletions
+4 -2
View File
@@ -2,6 +2,7 @@ using System.Threading;
using ClaudeDo.Data;
using ClaudeDo.Data.Git;
using ClaudeDo.Data.Repositories;
using ClaudeDo.Worker;
using ClaudeDo.Worker.Agents;
using ClaudeDo.Worker.Config;
using ClaudeDo.Worker.External;
@@ -206,12 +207,13 @@ builder.Services.AddMcpServer()
.WithTools<TaskRunMcpService>()
.WithTools<TaskRunFindingsMcpTools>();
// OnlineInboxConfig and OnlineTokenStore are always registered so hub methods work
// OnlineInboxConfig and the refresh-token store are always registered so hub methods work
// even when sync is disabled. The sync stack (api client, auth, hosted service) is
// only registered when enabled.
builder.Services.AddSingleton(cfg.OnlineInbox);
#pragma warning disable CA1416 // ClaudeDo.Worker is Windows-only; DPAPI is fine here.
builder.Services.AddSingleton<OnlineTokenStore>();
builder.Services.AddSingleton(new OnlineRefreshTokenStore(DpapiTokenStore.InAppData("online-inbox.token")));
builder.Services.AddSingleton(new TicketPatStore(DpapiTokenStore.InAppData("ticket.pat")));
#pragma warning restore CA1416
if (cfg.OnlineInbox.Enabled)