mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
* Add SSH host key verification with automatic trust and SCP-style URL support * Fix TypeScript errors for SSH host key schema and test mocks
30 lines
762 B
TypeScript
30 lines
762 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const SSHHostKeyRequestSchema = z.object({
|
|
id: z.string(),
|
|
host: z.string(),
|
|
ip: z.string(),
|
|
keyType: z.string(),
|
|
fingerprint: z.string(),
|
|
timestamp: z.number(),
|
|
isKeyChanged: z.boolean()
|
|
})
|
|
|
|
export const SSHHostKeyResponseSchema = z.object({
|
|
requestId: z.string(),
|
|
response: z.enum(['accept', 'reject'])
|
|
})
|
|
|
|
export const TrustedSSHHostSchema = z.object({
|
|
id: z.number(),
|
|
host: z.string(),
|
|
key_type: z.string(),
|
|
fingerprint: z.string(),
|
|
created_at: z.number(),
|
|
updated_at: z.number()
|
|
})
|
|
|
|
export type SSHHostKeyRequest = z.infer<typeof SSHHostKeyRequestSchema>
|
|
export type SSHHostKeyResponse = z.infer<typeof SSHHostKeyResponseSchema>
|
|
export type TrustedSSHHost = z.infer<typeof TrustedSSHHostSchema>
|