implemented actually using Host.publicKey and Host.privateKey to store pubkeys and privkeys

- this gives u icloud synced pub/privkeys
 - per host!!
made it load the key's string representation (if present) into the textboxes to tell the user that the key is there
made the privkey box a securefield to show .... instead of the key

added a handler.go() to handler disconnecting if connected and choosing password/pubkey auth
- really cleaned up the view code
added getPubkey(_: SecKey) to keychainmanager
added SSHErrors - commfail, connectionFail, backenderror
added AuthError - rejectedCreds, notconnected
added KeyError - importpub/privError, pub/priv rejected
made most functions throw in sshhandler
fix memoryLayoutsize(ofvalue to buffer.count in testexec
[weak self] in the async loop to prevent memory leaks i guess
added loccritical for easy red logging
This commit is contained in:
neon443
2025-06-23 12:51:41 +01:00
parent c9eab9dde8
commit 8df8c77c7a
7 changed files with 113 additions and 75 deletions

View File

@@ -18,17 +18,12 @@ struct ShellView: View {
.toolbar {
ToolbarItem {
Button() {
if handler.connected {
handler.disconnect()
} else {
handler.connect()
}
handler.go()
} label: {
if handler.connected {
Label("Disconnect", systemImage: "xmark.square.fill")
} else {
Label("Connect", image: "power")
}
Label(
handler.connected ? "Disconnect" : "Connect",
systemImage: handler.connected ? "xmark.app.fill" : "power"
)
}
}
}