refactor(worker): OnlineTokenStore zu DpapiTokenStore verallgemeinert
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using ClaudeDo.Worker;
|
||||
using ClaudeDo.Worker.Config;
|
||||
using ClaudeDo.Worker.Hub;
|
||||
using ClaudeDo.Worker.Online;
|
||||
@@ -21,17 +22,17 @@ public sealed class OnlineInboxHubTests : IDisposable
|
||||
try { File.Delete(_tokenPath); } catch { }
|
||||
}
|
||||
|
||||
private (WorkerHub hub, OnlineInboxConfig inboxCfg, OnlineTokenStore store) CreateHub(
|
||||
OnlineInboxConfig? inboxCfg = null, OnlineTokenStore? store = null)
|
||||
private (WorkerHub hub, OnlineInboxConfig inboxCfg, DpapiTokenStore store) CreateHub(
|
||||
OnlineInboxConfig? inboxCfg = null, DpapiTokenStore? store = null)
|
||||
{
|
||||
var cfg = new WorkerConfig();
|
||||
inboxCfg ??= cfg.OnlineInbox;
|
||||
store ??= new OnlineTokenStore(_tokenPath);
|
||||
store ??= new DpapiTokenStore(_tokenPath);
|
||||
var broadcaster = new HubBroadcaster(new CapturingHubContext());
|
||||
var hub = new WorkerHub(
|
||||
null!, null!, null!, null!, broadcaster, null!,
|
||||
null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, null!, null!,
|
||||
cfg, inboxCfg, store, new ClaudeDo.Worker.Runner.PendingQuestionRegistry(), null!);
|
||||
cfg, inboxCfg, new OnlineRefreshTokenStore(store), new ClaudeDo.Worker.Runner.PendingQuestionRegistry(), null!);
|
||||
hub.Clients = new FakeHubCallerClients(new RecordingClientProxy());
|
||||
hub.Context = new FakeHubCallerContext();
|
||||
return (hub, inboxCfg, store);
|
||||
@@ -95,7 +96,7 @@ public sealed class OnlineInboxHubTests : IDisposable
|
||||
var cfg = new WorkerConfig();
|
||||
// point SaveOnlineInbox to our temp file
|
||||
var inboxCfg = cfg.OnlineInbox;
|
||||
var store = new OnlineTokenStore(_tokenPath);
|
||||
var store = new DpapiTokenStore(_tokenPath);
|
||||
var broadcaster = new HubBroadcaster(new CapturingHubContext());
|
||||
|
||||
// Patch cfg to save to our temp path by writing an initial file there
|
||||
|
||||
Reference in New Issue
Block a user