Expand description
Form submissions: model, boot-time table ensure, and the public submit handler.
The submission table is created at boot via CREATE TABLE IF NOT EXISTS
(the framework’s audit_log/cache pattern) because repo-wide
gen_migration is blocked by pre-existing framework FK-snapshot drift.
A fresh table name (cms_form_entry) sidesteps the dead legacy
cms_form_submission table.
Provenance: the source page is resolved from the Referer at submit;
the embedding block’s per-placement success override is resolved
server-side from that page’s stream JSON by the _embed block uuid
(never trusted from a client field).
Structs§
- Form
Entry - One stored submission. New snippet-backed forms store here.
Constants§
- MAX_
SUBMISSION_ BYTES POST /forms/submit/{form_id}— validate, store, notify, and redirect. The largest form submission accepted, uploads included. Set on the route itself, so a host that raises or disables axum’s default body limit for its own upload routes doesn’t let an anonymous visitor buffer an arbitrarily large file into memory here.
Functions§
- ensure_
table - Create
cms_form_entryif absent. Idempotent; called per tenant at boot.