feat(#5838): separate workflow-host allow-list from caller allow-list - #5916
Conversation
Introduce WORKFLOW_HOST_REPOS env var that controls which repos may
host workflows calling the mint for per-repo callers (default:
fullsend-ai/fullsend). Per-org callers hard-wire to {org}/.fullsend
and upstream. This decouples caller enrollment (PER_REPO_WIF_REPOS /
ALLOWED_ORGS) from workflow-host trust.
Key changes:
- ValidateWorkflowRef now takes isPerRepo, workflowHostRepos params
- Per-repo mode checks workflow host against WORKFLOW_HOST_REPOS
- Per-org mode hard-wires to .fullsend and upstream only
- GET /v1/status includes workflow_host_repos in response
- New CLI: fullsend mint workflow-host add|remove|list
- Provisioner gains AddWorkflowHostRepo/RemoveWorkflowHostRepo
- ADR 0082 documents the trust separation
- WorkerConfig and CF Worker adapter pass WorkflowHostRepos
Note: pre-commit could not run in sandbox (network restriction).
The post-script runs pre-commit authoritatively on the runner.
Closes #5838
|
🤖 Finished Review · ✅ Success · Started 9:14 PM UTC · Completed 9:30 PM UTC |
Site previewPreview: https://300c468d-site.fullsend-ai.workers.dev Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Labels: PR adds new mint authorization feature (workflow-host allow-list separation) implemented in Go with CLI commands, matching type/feature and go labels. Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsLow
Labels: PR separates workflow-host trust from caller enrollment in the mint authorization system, which is a security-relevant trust boundary change. Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsMedium
Low
Labels: PR modifies mint authorization logic (mintcore, CLI, provisioner) and adds a security-related trust separation feature |
|
/fs-fix the review comments, but ignore the behaviour change complaints, that change is intentional |
|
🤖 Finished Fix · ✅ Success · Started 5:41 AM UTC · Completed 5:50 AM UTC |
- Add early return in RemoveWorkflowHostRepo when target repo is not found, avoiding unnecessary Cloud Run revision creation (matches AddWorkflowHostRepo pattern) - Document WORKFLOW_HOST_REPOS in infrastructure-reference.md and update workflow ref validation to describe per-org vs per-repo logic - Document workflow-host add|remove|list subcommand in mint-administration.md and docs/cli/mint.md - Document WORKFLOW_HOST_REPOS in standalone-mint.md Addresses review feedback on #5916
🔧 Fix agent — iteration 1 (human-triggered)Addressed 5 of 7 review findings. Fixed RemoveWorkflowHostRepo early-return bug and added missing documentation for WORKFLOW_HOST_REPOS and workflow-host subcommand across 4 docs files. Disagreed with 2 findings: backward-incompatible behavior change (intentional per human instruction) and api-response-schema-change (informational note, no action needed). Fixed (5):
Disagreed (2):
Tests: passedNext steps:
|
|
🤖 Review · ❌ Terminated · Started 5:50 AM UTC · Ended 6:06 AM UTC |
|
/fs-fix lets avoid special-casing public mode - it should just behave like per-repo mode and support the workflow host repos list. The only difference between that and tight per-repo mode should be the checking of requesting repos against the respective allow list or lack thereof. Add ADR revision refereces where needed to specify this. |
|
🤖 Finished Fix · ✅ Success · Started 5:59 AM UTC · Completed 6:11 AM UTC |
|
🤖 Finished Review · ✅ Success · Started 5:50 AM UTC · Completed 6:06 AM UTC |
Public mode (PER_REPO_WIF_REPOS=*) now uses the same per-repo validation path with WORKFLOW_HOST_REPOS and the basename allowlist. The only difference between public and tight per-repo mode is caller enrollment. Removes the perRepoWIFRepos parameter from ValidateWorkflowRef as it was only used for the now-removed public-mode early return. ADR 0082 updated with revision note. Addresses review feedback on #5916
🔧 Fix agent — iteration 2 (human-triggered)Removed public-mode special-case from ValidateWorkflowRef per human instruction. Public mode now uses the same per-repo validation path with WORKFLOW_HOST_REPOS and ALLOWED_WORKFLOW_FILES basename gate. Updated ADR 0082, architecture.md, infrastructure-reference.md, standalone-mint.md with revision notes. All tests pass. Fixed (6):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:12 AM UTC · Completed 6:27 AM UTC |
|
/fs-fix
|
|
🤖 Finished Fix · ✅ Success · Started 10:48 AM UTC · Completed 10:56 AM UTC |
- Use mintcore.SplitCSV in AddWorkflowHostRepo to normalize existing WORKFLOW_HOST_REPOS value, matching RemoveWorkflowHostRepo's handling of empty entries from malformed CSV values - Add note in ADR 0082 superseding ADR 0059's basename gate exception for public mode, with Related ADRs table cross-referencing both - Add tests for non-empty workflowHostReposCSV parsing and default fallback in NewHandlerFromConfig Addresses review feedback on #5916
🔧 Fix agent — iteration 5 (human-triggered)Addressed all 3 review findings: normalized CSV parsing in AddWorkflowHostRepo via mintcore.SplitCSV, added ADR 0059 cross-reference in ADR 0082, and added test coverage for workflowHostReposCSV parsing and default fallback. Fixed (3):
Tests: passedNext steps:
|
|
🤖 Review · |
|
/fs-fix when a caller is both an enrolled repo and its org is an enrolled org (matching both per-repo and per-org modes) - both job_workflow_ref options should apply - the workflow could either come from an approved host repo or from the per-org mode worflow sources. Need to fix the ADR, the docs and the code to match this. Don't forget to sync the embed files |
|
🤖 Finished Fix · ✅ Success · Started 11:01 AM UTC · Completed 11:11 AM UTC |
When a caller is both in PER_REPO_WIF_REPOS and its org is in
ALLOWED_ORGS, workflow ref validation now accepts sources from
either per-repo mode (WORKFLOW_HOST_REPOS) or per-org mode
({org}/.fullsend, upstream). Previously dual enrollment forced
per-org validation only, rejecting workflows from approved host
repos.
Updates ADR 0082, infrastructure docs, and syncs embed files.
Addresses human instruction on #5916
🔧 Fix agent — iteration 6 (human-triggered)Implemented dual-enrollment workflow ref validation: callers matching both PER_REPO_WIF_REPOS and ALLOWED_ORGS now accept workflow refs from either per-repo sources (WORKFLOW_HOST_REPOS) or per-org sources ({org}/.fullsend, upstream). Updated handler.go (both /v1/status and /v1/token paths), claims.go doc comment, ADR 0082, infrastructure-reference and mint-administration docs, embed files, and added comprehensive tests. Fixed (7):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:12 AM UTC · Completed 11:33 AM UTC |
|
🤖 Finished Retro · ✅ Success · Started 1:12 PM UTC · Completed 1:29 PM UTC |
Retro: PR #5916 — Separate workflow-host allow-list from caller allow-listTimeline
What went well
Evidence for existing open issues
Proposals filed
|
…t revision annotations Add explicit guidance to the "New ADRs in pull requests" section of docs/contributing/adrs.md: when editing an ADR that has not yet merged to main, change the content directly without adding "Revised" annotations, revision dates, or revision history sections. This rule was implicit in "Approval happens at merge" but agents did not infer it, causing a fix agent to add an unnecessary revision date to a brand-new ADR on PR fullsend-ai#5916. Note: pre-commit and make lint could not run in the sandbox (network restriction prevented fetching origin). Manual verification of lint is required. Closes fullsend-ai#5932
Summary
Separates workflow-host trust from caller enrollment in the mint by introducing a dedicated
WORKFLOW_HOST_REPOSenvironment variable. Per-repo callers now have theirjob_workflow_refvalidated against this allow-list (defaulting tofullsend-ai/fullsend), while per-org callers are hard-wired to accept only{org}/.fullsendand upstream workflows. This decouples the two concerns so granting a repo caller access no longer implicitly trusts it as a workflow host.Changes
internal/mintcore/claims.go: RefactoredValidateWorkflowRefto acceptisPerRepoandworkflowHostReposparameters. Per-repo mode validates against the host allow-list; per-org mode hard-wires to.fullsendand upstream.internal/mintcore/handler.go: AddedworkflowHostReposfield to Handler.WORKFLOW_HOST_REPOSis parsed at construction (defaults tofullsend-ai/fullsend). The workflow ref validation now runs after the dual-enrollment guard so the correct mode is used. Status endpoint includesworkflow_host_reposin response.internal/mintcore/config.go: AddedWorkflowHostRepostoWorkerConfigandNewHandlerFromConfig.internal/cli/mint.go: Addedfullsend mint workflow-host add|remove|listCLI commands for managing the allow-list. Updatedfullsend mint statusto display workflow host repos.internal/dispatch/gcf/provisioner.go: AddedAddWorkflowHostRepoandRemoveWorkflowHostRepomethods.internal/dispatch/cf/workersrc/src/index.ts: AddedWORKFLOW_HOST_REPOSto Worker env and config.docs/ADRs/0082-workflow-host-allow-list.md: ADR documenting the trust separation.docs/architecture.md: Added cross-reference to ADR 0082.Testing
internal/mintcoretests pass (including updated tests for the new validation logic)go vetpassesgo build ./cmd/fullsend/...succeedsChecklist
Closes #5838
Post-script verification
agent/5838-workflow-host-allow-list)9df3b1398df9f29db3eada0607b4c9f06535bcb0..HEAD)