fix(controlplane): limit dependent attestations to the run's organization

MI
2h ago
+115-35

When an attestation is stored, every dependent material of type ATTESTATION must already exist in the control plane. That existence check looked up the digest across all organizations. As a result, an attestation in one organization could reference, and be linked in the referrer graph to, an attestation of another organization. The response also told the caller whether a digest existed in another organization.

The lookup is now scoped to the organization of the run that is being saved. A dependent attestation in another organization is rejected with the same "dependent attestation not found" validation error as a nonexistent one. GetByDigestInOrg uses the same scoped lookup instead of filtering after the query. The repository method also uses First() instead of Only(), because the attestation digest index is not unique.

Refs SEC-625.

AI disclosure: this change was made with the help of Claude Code.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri