Documentation
¶
Overview ¶
Package submissionshttp serves a form's stored submissions on its script's portal page (#2180): the newest rows of the form's source, sensitive fields decrypted for the reader and the read audited (#2179), and the same rows as CSV or an Excel workbook.
It is mounted by scripthttp, whose ownership gate refuses everybody but the script's owner and an administrator before any handler here runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Reader *epsubmit.Reader
// Owned resolves the script in the path for a caller who owns it, or
// writes the refusal and reports false.
Owned func(w http.ResponseWriter, r *http.Request) (scriptID, actor string, ok bool)
// Viewer is who the request is from, as a decrypt is audited.
Viewer func(r *http.Request) epsubmit.Viewer
}
Deps carries the reader and the ownership gate.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the submission routes.
func ForPortal ¶
func ForPortal(scripts *scripthttp.Handler, deps scripthttp.Deps, reader *epsubmit.Reader) *Handler
ForPortal builds the handler over the scripts handler's ownership gate and the portal's identity of the caller; nil, which mounts nothing, without a reader.