Repository navigation
fix(controlplane): exclude deleted workflows from referrer visibility - #3880
perfloop[bot] wants to merge 2 commits into
Conversation
Assisted-by: Perfloop Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Assisted-by: Perfloop Signed-off-by: Perfloop Agent <agent@perfloop.ai>
AI Session Checks — ⏭️ bypassed by labelAI Coding Session Check BypassedThis PR carries the Learn more about Chainloop Trace. Powered by Chainloop and Chainloop Trace |
| // - projectIDs: the list of associated projects | ||
| // It also returns the associated projects grouped by organization, for the visibility check. | ||
| func hydrateWorkflowsInfo(root *ent.Referrer, out *biz.StoredReferrer) map[uuid.UUID][]uuid.UUID { | ||
| workflowIDs := make([]uuid.UUID, 0, len(root.Edges.Workflows)) |
There was a problem hiding this comment.
can't we prevent the edges from having deleted workflows instead of skipping it downstream in the serialization step?
There was a problem hiding this comment.
Yes—the workflow edges can be filtered at both query sites, in GetFromRoot and referencesPage. I’ll move the exclusion there and verify the root and reference visibility cases, so hydration only receives live workflows.
There was a problem hiding this comment.
will you change this in the end?
|
Perfloop paused work on this pull request before it answered the open comments. The work reached the workspace's overall usage limit. |
Private discovery can expose a shared referrer to a project-scoped caller when a deleted workflow supplies its only granted project. Deleted workflows now stop contributing to referrer visibility, for both root lookups and first-level references.
Consider digest D linked to a live workflow in hidden project B and a deleted workflow in granted project A. The organization-level SQL check finds the live workflow, while hydration currently includes both projects; the grant for A then admits D. Hydration now skips the deleted workflow, so only B participates and the caller cannot retrieve D. A live workflow in A still grants access.
The guard lives in
hydrateWorkflowsInfo, which both discovery paths use. This keeps query ordering and cursor construction unchanged rather than duplicating the rule in the eager-loading queries. Deleted workflows also stop contributing workflow IDs, and project or organization IDs contributed solely by those workflows, to the internal discovery result. There is no API or schema change.AI assistance: Perfloop.
cc @migmartri @javirln
Case and evidence
Made by Perfloop.