Documentation
¶
Overview ¶
Package outputshttp serves the outputs of the script runs a caller asked for (#1848): an application that runs scripts for its users reads back what those runs wrote, across scripts, filtered by script, tag and metadata, each with a short-lived link that downloads it.
It is mounted by scripthttp, which resolves the caller. A caller reads the outputs of the runs it requested, whoever owns the scripts, because the run already handed them to it; an administrator reads every run's.
Index ¶
Constants ¶
const Route = "GET /api/v1/portal/scripts/runs/outputs"
Route is where the listing is served. A literal segment outranks the {id} wildcard, so no script id can shadow it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Runs RunLister
// Caller is who is asking, or ok=false after writing the refusal. An
// administrator reads every run's outputs.
Caller func(w http.ResponseWriter, r *http.Request) (requester string, isAdmin, ok bool)
// ContentURL mints a signed link to one asset version, and its expiry.
// Nil leaves outputs without a link.
ContentURL func(assetID string, version int) (string, time.Time)
}
Deps carries the run history, the caller, and the link minter.