Documentation
¶
Overview ¶
Package storeaudit keeps secrets out of the durable stores' bytes. It holds the audit of every stored kind (why its stored form carries no credential), the scan for token-shaped strings, and a real-shaped object of every kind, which the file store's and the object store's tests write and then scan: a kind that reaches the disk or the bucket without an audit line fails them, and so does a token marker anywhere in what they wrote.
Design: design/workstreams/dispatcher-runtime/LLD/store.md §File store ("What never reaches the disk"), and §Object store when present.
Index ¶
- Variables
- func Delivery(id string) *controllers.Delivery
- func FindTokens(data []byte) []string
- func Fixtures() []store.Object
- func InternalKinds() map[string]store.Object
- func Lease(name string) *scheduler.Lease
- func ObjectStoreFixtures() []store.Object
- func Run(name string) *v1alpha1.Run
- func Task(id, workItem string, phase v1alpha1.TaskPhase) *v1alpha1.Task
Constants ¶
This section is empty.
Variables ¶
var Epoch = time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC)
Epoch is the fixtures' time.
var KindAudit = map[string]string{ v1alpha1.KindEvent: "normalised provider events: ids, refs, actors, facts and the untrusted raw payload; webhook payloads carry no credentials", v1alpha1.KindWorkItem: "links, rule state, counters and decisions; no credentials", v1alpha1.KindTask: "spec and status; spec.credentials describes the git token to mint (repo, permissions, TTL) and llm is always agent-local: the tokens themselves are minted per lease and never stored", v1alpha1.KindRun: "attempt, agent, progress events and the Result; the agent reports no credentials", v1alpha1.KindAgent: "pool, owner login, capabilities and lending; the agent's token is the AgentToken kind, hashed", v1alpha1.KindEffect: "the provider write asked and its result (URL or error); the identity is a name, its credentials stay in the provider adapter", v1alpha1.KindBudgetCounter: "run, token and USD counts", v1alpha1.KindApproval: "the question, approvers group and decisions (logins)", auth.KindSession: "named by the SHA-256 of the session id (never the cookie value), holds the GitHub login and no GitHub token", auth.KindUsedLoginState: "named by the SHA-256 of a finished login's OAuth state id (never the state), holds the state's expiry", scheduler.KindLease: "who holds which task until when and the usage deltas; git credentials are minted per lease and never stored, only their expiry", scheduler.KindAgentToken: "the agent token as a sha256: hash of its secret part, never the token", scheduler.KindEnrollment: "the pool, owner, host name and expiry an admin fixed, and the enrollment token as a sha256: hash, never the token", scheduler.KindAgentRefresh: "the agent's refresh token as a sha256: hash, never the token, and the enrollment it came from", controllers.KindDelivery: "the raw webhook as received, minus Authorization, Cookie and Proxy-Authorization (github ingress droppedHeaders); body and headers are dropped once handled. X-Hub-Signature-256 is an HMAC of the body, not the secret", controllers.KindEventStatus: "an event id, a work item name and a time", controllers.KindDebounce: "a rule's held actions (dispatch, set, notify...): catalog values and event facts, no credentials", controllers.KindTaskPrompt: "the rendered prompt: catalog templates and untrusted provider text; no credential is templated into prompts", controllers.KindKillSwitch: "a pause scope, target, actor and time", controllers.KindLinkObservations: "a work item's links (provider/ref) and the SHA-256 digests of their last observations; no provider text", objectstore.KindStoreLock: "a lock's name, the holding store's instance id, a random per-hold id and an expiry; no credential", objectstore.KindTranscriptBlob: "a transcript blob's run name, random blob id, size and put time; the blob itself is agent output, kept beside the log", }
KindAudit is every kind the stores hold, with why its stored form carries no secret. A kind that reaches the disk or a bucket without an entry here fails the tests: add one (after checking), or keep the secret out of the store.
var TokenMarkers = []string{"ghs_", "gho_", "ghp_", "github_pat_", "sk-ant-", "-----BEGIN", "x-access-token:"}
TokenMarkers are the prefixes of the credentials the dispatcher handles.
Functions ¶
func Delivery ¶
func Delivery(id string) *controllers.Delivery
Delivery returns a real-shaped Delivery, as the GitHub ingress stores it.
func FindTokens ¶
FindTokens returns the token markers in data: in the raw bytes, in every JSON string (unescaped) and in every JSON string that is base64 (the encoding of []byte fields such as a Delivery's body), whether data is one JSON document or one per line.
func Fixtures ¶
Fixtures returns one real-shaped object of every kind the dispatcher stores, except the object store's own (StoreLock and TranscriptBlob), which it writes itself: a Lock and a PutTranscript make them.
func InternalKinds ¶
InternalKinds are the internal kinds the dispatcher stores, with their Go types: the same table as serve's (cmd/factory internalKinds, which a test keeps equal to this one).
func ObjectStoreFixtures ¶
ObjectStoreFixtures returns a real-shaped object of each of the object store's own kinds, for a store that doesn't make them itself (the file store holds them only as registered kinds).
Types ¶
This section is empty.