Project public key files for use in configs (#264)

This commit is contained in:
Max Goedjen
2022-01-02 23:25:40 -08:00
committed by GitHub
parent 5894bbca00
commit 05c5aca9b6
4 changed files with 51 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}()
private let updater = Updater(checkOnLaunch: false)
private let notifier = Notifier()
private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: NSHomeDirectory())
private lazy var agent: Agent = {
Agent(storeList: storeList, witness: notifier)
}()
@@ -32,6 +33,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
DispatchQueue.main.async {
self.socketController.handler = self.agent.handle(reader:writer:)
}
DistributedNotificationCenter.default().addObserver(forName: .secretStoreUpdated, object: nil, queue: .main) { [self] _ in
try? publicKeyFileStoreController.generatePublicKeys(for: storeList.stores.flatMap({ $0.secrets }), clear: true)
}
try? publicKeyFileStoreController.generatePublicKeys(for: storeList.stores.flatMap({ $0.secrets }), clear: true)
notifier.prompt()
updateSink = updater.$update.sink { update in
guard let update = update else { return }
@@ -39,6 +44,5 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
}