Repository navigation
Conversation
Shared workflows can start without a project. requireProjectWriter treats an empty project as writable by every authenticated user, so runWriteGuard let any signed-in account approve, reject, cancel, pause, retry, pass or delete another user's project-less run and inject HumanDecision context into it. For a run without a project (and without a linked issue project), authorize lifecycle writes against ExecutionContext.ResponsibleUserID. Unknown ownership fails closed; platform admins and project-backed runs keep their existing checks. Adds tests for the responsible user, an unrelated account and an ownerless run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A shared workflow can be started with an empty
projectId. In that caserunWriteGuardauthorized run lifecycle writes throughrequireProjectWriter(c, ""), and an empty project is treated as writable by every authenticated user. As a result, any signed-in account could approve/reject/retry/pause/resume/pass/cancel a project-less run and injectHumanDecision.Contextinto another user's agent invocation; the run could also be deleted.This change scopes project-less runs to their responsible user:
run.ExecutionContext.ResponsibleUserID(or a platform admin) may write/control it.Scope
Compatibility
No API or schema change. Project-backed runs and platform admins keep their current authorization. Owners of existing project-less runs with
ResponsibleUserIDset keep access; runs with no recorded owner now require an admin, which is the intended fail-closed behavior.Validation
Commands actually run:
New tests cover the responsible user (200), an unrelated account (403) and an ownerless run (403).
Not run: the full
go test -p=2 ./...suite and browser acceptance in this environment.Safety