mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-08-20 08:09:01 +02:00
Adding host reader xpc service and connection info
This commit is contained in:
@@ -13,7 +13,7 @@ import SwiftUI
|
||||
|
||||
extension EnvironmentValues {
|
||||
|
||||
@MainActor fileprivate static let _certificateStore: CertificateStore = CertificateStore()
|
||||
@MainActor fileprivate static let _certificateStore = CertificateStore()
|
||||
|
||||
@MainActor var certificateStore: CertificateStore {
|
||||
EnvironmentValues._certificateStore
|
||||
@@ -49,14 +49,16 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
logger.debug("SecretAgent finished launching")
|
||||
Task {
|
||||
_ = Task {
|
||||
for await session in socketController.sessions {
|
||||
Task {
|
||||
_ = Task {
|
||||
let inputParser = try await XPCAgentInputParser()
|
||||
let hostsReader = try await XPCHostsfileReader()
|
||||
let hosts = try? await hostsReader.read()
|
||||
do {
|
||||
for await message in session.messages {
|
||||
let request = try await inputParser.parse(data: message)
|
||||
let agentResponse = await agent.handle(request: request, provenance: session.provenance)
|
||||
let agentResponse = await agent.handle(request: request, provenance: session.provenance, hosts: hosts)
|
||||
try session.write(agentResponse)
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user