Documentation
¶
Overview ¶
Package endpointwire mounts endpoints (#2170) on the platform's mux: the /endpoints/{name}/... routes and the bot check's, which authenticate a signed-in caller the way the portal does (a browser session, CSRF-checked on a write, or an API key), and the bot check's settings behind the admin API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticator ¶
Authenticator adapts the portal's authentication to an endpoint's caller, with whether they administer the platform, the persona their roles resolve to and the API key's name, which an authenticated endpoint admits by (#2259). The portal reports an error only for a browser session refused its CSRF token, which is the caller's credential refused rather than absent. A person of an external persona is refused too (#2290): an authenticated endpoint runs a script, which reaches far more than what is shared with them.
func Mount ¶
func Mount(mux *http.ServeMux, p *platform.Platform, adminAuth func() func(http.Handler) http.Handler, author func(*http.Request) string)
Mount registers the routes. A deployment with no database has no endpoints and mounts nothing. The settings routes are mounted where the admin API is on, behind adminAuth.
Types ¶
type Personas ¶ added in v1.152.0
type Personas struct {
External func(roles []string) bool
Name func(roles []string) string
Admin func(roles []string) bool
}
Personas resolves a caller's roles: whether they are an external persona's, the name of the persona they resolve to ("" for none), and whether the platform's one administrator rule says they administer it. A nil function answers no.