feat(macOS): add gateway password auth support and fix Swift 6.2 concurrency
- Add CLAWDIS_GATEWAY_PASSWORD to launchd plist environment - Read password from gateway.remote.password config in client - Fix Swift 6.2 sending parameter violations in config save functions - Add password parameter to GatewayConnection.Config type - GatewayChannel now sends password in connect auth params - GatewayEndpointStore and GatewayLaunchAgentManager read password from config - CLI gateway client reads password from remote config and env
This commit is contained in:
@@ -75,6 +75,15 @@ extension OnboardingView {
|
||||
|
||||
@discardableResult
|
||||
func saveAgentWorkspace(_ workspace: String?) async -> Bool {
|
||||
let (success, errorMessage) = await OnboardingView.buildAndSaveWorkspace(workspace)
|
||||
|
||||
if let errorMessage {
|
||||
self.workspaceStatus = errorMessage
|
||||
}
|
||||
return success
|
||||
}
|
||||
|
||||
private nonisolated static func buildAndSaveWorkspace(_ workspace: String?) async -> (Bool, String?) {
|
||||
var root = await ConfigStore.load()
|
||||
var agent = root["agent"] as? [String: Any] ?? [:]
|
||||
let trimmed = workspace?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
@@ -90,10 +99,10 @@ extension OnboardingView {
|
||||
}
|
||||
do {
|
||||
try await ConfigStore.save(root)
|
||||
return true
|
||||
} catch {
|
||||
self.workspaceStatus = "Failed to save config: \(error.localizedDescription)"
|
||||
return false
|
||||
return (true, nil)
|
||||
} catch let error {
|
||||
let errorMessage = "Failed to save config: \(error.localizedDescription)"
|
||||
return (false, errorMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user