[Feat] Block shared publishing from private Sessions - #2642
roomote-roomote[bot] wants to merge 1 commit into
Conversation
|
2 issues outstanding. See task
Reviewed a8d5b99 |
| const merged = mergeProviderTokens( | ||
| providers.map((provider) => tokensByProvider.get(provider)!), | ||
| ); | ||
| if (!readOnly) return merged; |
There was a problem hiding this comment.
The read-only check runs only after all provider credentials have been minted. With a PAT-backed GitLab connection, createTaskRunScopedGitLabTokens creates one-day Developer project tokens with write_repository; this branch then throws without persisting their descriptors, so the normal cleanup path cannot revoke them. Decide read-only support before minting, or revoke the newly created descriptors before failing.
| Object.values(merged.envVars).some(Boolean) || | ||
| (merged.gitCredentials?.some((credential) => Boolean(credential.token)) ?? | ||
| false); | ||
| if (exposesRawCredential) { |
There was a problem hiding this comment.
The new private-task failure is thrown after the run has been claimed, but neither dequeueTaskRun nor dequeueResumeTaskRun catches it to cancel and release that run. The worker receives a rejected dequeue response before it has a taskRun to settle, so every private task using a raw-token provider (including GitHub) can remain stuck active/claimed instead of failing closed visibly. Return or handle a classified bootstrap failure here so the dequeue paths execute their existing cancellation flow.
What changed
Why this change was made
Private content must not escape through shared channels, source control, schedules, artifacts, or deployment settings.
Impact
Shared egress remains unchanged. Private delegation reads repositories only where a genuinely read-only credential path exists.
Related PRs