feat: new table and crud operations

This commit is contained in:
Lorenzo Migliorero
2024-07-25 15:19:03 +02:00
parent 083bb7b87d
commit f866250c25
12 changed files with 733 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { z } from "zod";
export const sshKeyCreate = z.object({
name: z.string().min(1),
description: z.string().optional(),
publicKey: z.string().regex(/^ssh-rsa\s+([A-Za-z0-9+/=]+)\s*(.*)?$/, {
message: "Invalid format",
}),
privateKey: z
.string()
.regex(
/^-----BEGIN RSA PRIVATE KEY-----\n([A-Za-z0-9+/=\n]+)-----END RSA PRIVATE KEY-----$/,
{
message: "Invalid format",
},
),
});
export const sshKeyUpdate = sshKeyCreate.pick({
name: true,
description: true,
});