Consolidate audit-fixes branch: webhooks, integrations, and deploy hardening
Batch commit of the pending working tree on security/audit-fixes-2026-07. Major areas: - Outbound webhooks / Zapier: schema + signed delivery with retries, public v1 API (REST-hook subscribe/unsubscribe), settings UI, cron drain. - Deploy hardening: email via SMTP2GO (Resend fully removed), verified DB TLS (DATABASE_SSL=require + DATABASE_CA), storage fails loud in production when Spaces is unconfigured instead of silently using ephemeral disk. - Integrations & features (concurrent work): accounting (QuickBooks/Xero), e-signature (DocuSign/Dropbox Sign), PayPal, geocoding/maps, onboarding, expanded legal pages. - DB migrations 0006–0009. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
969d5d4c8a
commit
c9968531e4
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod"
|
||||
import { WEBHOOK_EVENT_IDS } from "@/lib/webhooks/events"
|
||||
|
||||
export const propertySchema = z.object({
|
||||
name: z.string().min(1, "Property name is required").max(200),
|
||||
@@ -71,6 +72,7 @@ export const leaseSchema = z.object({
|
||||
rent_amount: z.number().positive("Rent amount must be positive"),
|
||||
security_deposit: z.number().positive().optional(),
|
||||
lease_type: z.enum(["fixed", "month_to_month"]).default("fixed"),
|
||||
status: z.enum(["active", "expired", "terminated", "renewed"]).optional(),
|
||||
auto_renew: z.boolean().default(false),
|
||||
notes: z.string().max(5000).optional(),
|
||||
})
|
||||
@@ -122,6 +124,15 @@ export const followUpRuleSchema = z.object({
|
||||
message_template: z.string().max(5000).optional(),
|
||||
})
|
||||
|
||||
// Outbound webhooks. `events` is the set of subscribed event ids; an empty array
|
||||
// means "all events". SSRF/host validation happens server-side (see lib/webhooks/ssrf).
|
||||
export const webhookEndpointSchema = z.object({
|
||||
url: z.string().url("Enter a valid URL").max(2000),
|
||||
description: z.string().max(200).optional().or(z.literal("")),
|
||||
events: z.array(z.enum(WEBHOOK_EVENT_IDS as [string, ...string[]])).default([]),
|
||||
})
|
||||
|
||||
export type ExpenseFormValues = z.infer<typeof expenseSchema>
|
||||
export type VendorFormValues = z.infer<typeof vendorSchema>
|
||||
export type InspectionFormValues = z.infer<typeof inspectionSchema>
|
||||
export type WebhookEndpointFormValues = z.infer<typeof webhookEndpointSchema>
|
||||
|
||||
Reference in New Issue
Block a user