Expand description
HTTP endpoints for the web console.
StructsΒ§
- Console
Proxy πConfig
ConstantsΒ§
- PREVIEW_
BUILD_ πCOOKIE - Cookie storing the selected preview build label.
- PREVIEW_
BUILD_ πCOOKIE_ MAX_ AGE_ SECS - Preview selections expire after a day so stale cookies drift back to the default build.
- PREVIEW_
BUILD_ πLABEL_ PREFIX - Prefix required of preview build labels. CI only creates preview aliases under this prefix, so requiring it keeps the reachable hosts to builds of console pull requests.
- PREVIEW_
BUILD_ πPARAM - Query parameter that selects (or, with an empty value, clears) the console preview build this proxy serves to the requesting browser.
StaticsΒ§
- CONSOLE_
CONFIG_ πVAR_ NAMES - OIDC configuration values needed by the Console to initiate OIDC login.
FunctionsΒ§
- handle_
console_ config - Returns system variable values the web console needs from environmentd. This endpoint requires no authentication.
- handle_
internal_ πconsole - The User Impersonation feature uses a Teleport proxy in front of the Internal HTTP Server, however Teleport has issues with CORS that prevent making requests to that Teleport-proxied app from our production console URLs. To avoid CORS and serve the Console from the same host as the Teleport app, this route proxies the upstream Console to handle requests for HTML, JS, and CSS static files.
- is_
same_ πorigin - True unless the request was initiated by another site. Browser-set
Sec-Fetch-Sitecannot be forged by page scripts;Originis the fallback for browsers predating it. The fronting proxyβsSameSite=Laxsession cookie also keeps a cross-site POST unauthenticated today, but that is its configuration, not this codeβs, so the check here is the layer this proxy owns. - is_
valid_ πpreview_ build_ label - A valid preview build label is a DNS label (1-63 characters of lowercase
ASCII alphanumerics and hyphens, not ending with a hyphen) starting with
PREVIEW_BUILD_LABEL_PREFIX. - preview_
build_ πconfirmation_ response - Confirmation page for a preview build selection. All interpolated values are validated or config-controlled, never raw request input.
- preview_
build_ πfrom_ cookie - Returns the preview build label from the requestβs cookies, if one is set and valid. Invalid values are ignored rather than rejected so a stale cookie can never break the default console.
- preview_
build_ πselection_ response - Handles the
?preview_build=<label>selection parameter. A GET with a label renders a confirmation page whose form POSTs the selection back; the POST stores it in a cookie and redirects to the same path without the parameter. The POST must additionally be same-origin (seeis_same_origin), so a cross-site navigation cannot change the served build even if the fronting proxyβs session cookie policy were to allow cross-site POSTs. Clearing (an empty label) is allowed on GET: it only ever restores the default build and is the recovery path for a broken selection. ReturnsNonewhen the parameter is absent. - preview_
build_ πunavailable_ response - Error page served when the selected preview build cannot be fetched, linking back to the default build.