Files
opsxshell/shared/types/known-hosts.types.ts

36 lines
830 B
TypeScript

/**
* Known Hosts types - host key trust store
*/
export type HostKeyTrustDecision = 'accept-once' | 'accept-always' | 'reject'
export interface KnownHostEntry {
/** host:port */
host: string
port: number
/** e.g. ssh-ed25519, ssh-rsa, ecdsa-sha2-nistp256 */
keyType: string
/** base64-encoded public key blob (OpenSSH wire format body) */
publicKey: string
/** SHA256 fingerprint (base64, no prefix) */
fingerprint: string
firstSeenAt: number
lastSeenAt: number
}
export interface HostKeyPromptPayload {
requestId: string
host: string
port: number
keyType: string
fingerprint: string
/** true when stored key differs from presented key */
isChanged: boolean
previousFingerprint?: string
}
export interface HostKeyPromptResponse {
requestId: string
decision: HostKeyTrustDecision
}