resultauthority

package
v0.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 18 Imported by: 0

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

View Source
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

type Authorizer struct{ Reader client.Reader }

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL