Files
Termind/Frameworks/TermindApplication/Connections/RemoteSessionHostStore.swift
T
Kaede Akino c2958a05b3 Add iOS workspaces and shared feature services
Share Vault, persistence, SSH/SFTP, forwarding, and SwiftUI components across platforms. Add mobile editors, terminal input, standalone Assistant, Metrics navigation, transfers, and a unified Live Activity with host system icons.

Validation: 35 iOS tests and 100 focused macOS tests pass; formatting and zh-Hans checks pass. The full macOS run reports 14 issues in the documented timing, Keychain, and popover suites. Remaining Assistant tool and CloudKit work is tracked in Memory/MOBILE_ROLLOUT.md.
2026-09-11 13:47:16 +08:00

45 lines
2.1 KiB
Swift

import Foundation
import TermindDomain
import struct TermindDomain.Host
/// The host, trust, and credential capabilities required to establish a live
/// SSH-backed session. Session features depend on this port instead of gaining
/// the complete Vault mutation surface from `HostLibraryModel`.
@MainActor
public protocol RemoteSessionHostStore: AnyObject, Sendable {
func host(_ id: Host.ID) -> Host?
func identity(_ id: Identity.ID) -> Identity?
func identity(for host: Host) -> Identity?
func key(_ id: SSHKeyRef.ID) -> SSHKeyRef?
func knownHosts(for host: Host) -> [KnownHostEntry]
func route(for host: Host) -> [Host]
func expectedHostKeys(
for host: Host, temporaryHostKeys: [Host.ID: SSHHostKeyIdentity]
) throws -> Set<SSHHostKeyIdentity>
func prepareSSHConnection(
for host: Host, submissions: [Host.ID: SSHAuthenticationSubmission]
) throws -> SSHConnectionPreparation
func sshConnectionConfiguration(
for host: Host, submissions: [Host.ID: SSHAuthenticationSubmission],
temporaryHostKeys: [Host.ID: SSHHostKeyIdentity]
) throws -> SSHConnectionConfiguration
func sshJumpConfigurations(
for host: Host, submissions: [Host.ID: SSHAuthenticationSubmission],
temporaryHostKeys: [Host.ID: SSHHostKeyIdentity]
) throws -> [SSHRouteHopConfiguration]
func transportProxy(for host: Host) throws -> SSHTransportProxy?
func sshCredentials(for identity: Identity) -> SSHCredentialResolution
func passwordCredential(for identity: Identity) throws -> String?
func keyCredential(for key: SSHKeyRef) throws -> StoredSSHKeyCredential?
func setConnectionStatus(_ status: ConnectionStatus, connectionID: UUID, hostID: Host.ID)
func recordRemoteSystemInfo(_ systemInfo: RemoteSystemInfo?, for hostID: Host.ID)
func trust(_ entry: KnownHostEntry)
func markKnownHostMismatched(hostname: String, port: Int)
@discardableResult func upsert(_ identity: Identity) -> Bool
func upsert(_ identity: Identity, passwordUpdate: IdentityPasswordUpdate) throws
func upsert(_ host: Host)
}
extension HostLibraryModel: RemoteSessionHostStore {}