Skip to content

Commit

Permalink
feat: Tighten input validation (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllimyt authored Jan 10, 2025
1 parent 1f544ca commit b4ae816
Show file tree
Hide file tree
Showing 18 changed files with 746 additions and 303 deletions.
10 changes: 8 additions & 2 deletions frontend/src/app/registry/actions/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ function EditTemplateActionView({
}

const editTemplateActionFormSchema = z.object({
origin: z.string(),
definition: z.string(),
origin: z
.string()
.min(1, "Origin is required")
.max(1000, "Origin cannot exceed 1000 characters"),
definition: z
.string()
.min(1, "Definition is required")
.max(50000, "Definition cannot exceed 50,000 characters"),
})

type EditTemplateActionFormSchema = z.infer<typeof editTemplateActionFormSchema>
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/app/registry/actions/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@ function NewTemplateActionView({
}

const newTemplateActionFormSchema = z.object({
origin: z.string(),
definition: z.string(),
origin: z
.string()
.min(1, "Origin is required")
.max(1000, "Origin cannot exceed 1000 characters"),
definition: z
.string()
.min(1, "Definition is required")
.max(50000, "Definition cannot exceed 50,000 characters"),
})

type NewTemplateActionFormSchema = z.infer<typeof newTemplateActionFormSchema>
Expand Down
Loading

0 comments on commit b4ae816

Please sign in to comment.