Documentation
¶
Overview ¶
Package admissionwebhook is the dispatch admission hook that asks an operator's HTTPS endpoint (ADR 0100 §8). It sends each task attempt as JSON and turns the answer into an admission.Decision.
The endpoint is trusted with the attempt's tenant, DAG and execution fields, never with its environment, source, secrets or token. Its answer is not trusted further than the hook contract allows: no redirect is followed, the body is capped at MaxResponseBytes and decoded strictly, the answer must echo the request's UID, and it may set a service account only when the operator's allowlist of service accounts is set.
Index ¶
Constants ¶
const APIVersion = "dexaflow.io/admission/v1"
APIVersion names the wire format. A breaking change to it takes a new version, served side by side.
const Kind = "AdmissionReview"
Kind is the kind of both the request and the answer.
const MaxResponseBytes = 64 << 10
MaxResponseBytes caps the answer's body.
Variables ¶
This section is empty.
Functions ¶
func ValidateURL ¶
ValidateURL checks the endpoint URL: absolute, https unless the host is loopback, and without user info (the token goes in token_file).
Types ¶
type Config ¶
type Config struct {
// URL is the endpoint. It must be https unless its host is loopback.
URL string
// CAFile, when set, is a PEM bundle the endpoint's certificate must chain
// to, instead of the system roots.
CAFile string
// TokenFile, when set, holds a bearer token sent as Authorization. It is
// read on every call, so a rotated token is picked up without a restart.
TokenFile string
// AllowServiceAccount lets the answer set the service account. The server
// sets it only when execution_allowlist.service_accounts is set, so the
// endpoint's owner cannot move a task onto any account of the namespace.
AllowServiceAccount bool
}
Config is execution.admission.webhook.
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook is the webhook admission hook. It is safe for concurrent use.
func New ¶
New builds the hook. It fails when the URL is invalid or the CA bundle cannot be read, so a misconfigured server does not boot.