Skip to main content

Module xet_provenance

Module xet_provenance 

Source
Expand description

XET content provenance store (the #436 / #509 fix).

§Why this exists

The XET CAS is global and content-addressed: bytes are deduplicated by their computed merkle root with no per-tenant namespacing. The pre-existing getBlob authorization (condition (b)) decided entitlement from a git-xet / git-lfs pointer blob committed into the grant repo’s HEAD tree. That pointer is caller-committed and therefore forgeable: Tenant B can commit oid sha256:<Tenant A's private merkle> into their own repo and read A’s private bytes back over the shared CAS. The pointer-only check structurally cannot tell a planted reference from a genuine one.

§What this provides

A persisted, server-side-only mapping merkle_hex → {repo_id, …} recording which repositories actually contributed (uploaded) the bytes behind a merkle. The bytes themselves remain globally deduplicated in the CAS — only this provenance mapping is per-repo. The read gate consults this store and fails closed: if no provenance record binds the merkle to the grant repo, the request is denied. A forgeable pointer can never, on its own, grant access.

§Trust boundary (load-bearing)

record() is the only mutating entry point and MUST be called exclusively from a server-authenticated code path that has already established the pushing repo’s identity (NOT from caller-supplied identity such as $USER or a request field). See the module-level note in registry.rs for the wiring status of the authenticated upload binding (issue #509, part 2).

Structs§

XetProvenanceStore
Persisted (merkle_hex → {repo_id}) provenance mapping for XET CAS content.