Documentation
¶
Overview ¶
Package resultauthority checks live Kubernetes authority for result delivery. It grants permission to persist evidence, never permission to execute SQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotReady = errors.New("result delivery is waiting for durable Job adoption")
ErrNotReady is transient: the controller has not yet persisted the exact Job UID after Create. A fast runner must wait for adoption rather than lose its result as a definitive authority refusal.
Functions ¶
func LogTransientFailures ¶ added in v0.2.11
func LogTransientFailures(authorize func(context.Context, resultdelivery.Identity) error) func(context.Context, resultdelivery.Identity) error
LogTransientFailures wraps the receiver's authorization so that a check which reached no verdict, which the receiver answers with 503, leaves a line saying why. A refusal (ErrAuthority) is the 403 itself and is not logged. Only the receiver wraps its check: admission and credential issuance call Authorizer.Check directly and answer their own callers.
Types ¶
type Authorizer ¶
Authorizer must use an uncached API reader. It reads the subject after Job and Pod, validates both against that current claim, and finishes with the live retirement fence. Admission and the consumer must still cover later changes; Kubernetes offers no cross-object transaction.
func (Authorizer) Check ¶
func (a Authorizer) Check(ctx context.Context, identity resultdelivery.Identity) (verdict error)
type TokenReviewer ¶
type TokenReviewer interface {
Create(context.Context, *authenticationv1.TokenReview, metav1.CreateOptions) (*authenticationv1.TokenReview, error)
}
TokenReviewer submits a TokenReview to the API server. The receiver's own identity needs create on tokenreviews; the runner needs no API permissions.
type TokenVerifier ¶
type TokenVerifier struct {
Reviews TokenReviewer
Reader client.Reader
}
TokenVerifier authenticates a Pod, not its permission to publish a result. The receiver must separately verify the immutable first-Pod pin and current operation authority. Reader bypasses the informer cache. Reviews are never cached: expiration and bound-object deletion must affect later requests and the check immediately before publication completes.
func (TokenVerifier) Verify ¶
func (v TokenVerifier) Verify(ctx context.Context, token string, identity resultdelivery.Identity) error