Skip to content

fix(mint): GCP --public deploy should set PER_REPO_WIF_REPOS=* not ALLOWED_ORGS=* #6204

Description

@ifireball

What happens

mint deploy --public on GCP (--platform=gcp, the default) sets ALLOWED_ORGS=* and leaves PER_REPO_WIF_REPOS unset. Dry-run and deploy summary text both describe public mode this way.

This contradicts ADR-0078: public mint mode is expressed as * in PER_REPO_WIF_REPOS, not * in ALLOWED_ORGS. ValidateWorkflowRef and AuthorizeToken key public-mode behavior off IsPublicMintRepos(perRepoWIFRepos).

Cloudflare deploy already does the right thing (--publicPER_REPO_WIF_REPOS=*). GCP provisioner (internal/dispatch/gcf/provisioner.go) and CLI messaging (internal/cli/mint.go) still use the legacy ALLOWED_ORGS=* path.

Observed on prod (2026-08-13): first deploy to it-gcp-konflux-prod-fullsend with --public produced revision fullsend-mint-00003-hhq with ALLOWED_ORGS=* and no PER_REPO_WIF_REPOS. Manual env correction (PER_REPO_WIF_REPOS=*, remove ALLOWED_ORGS) required a traffic shift to the new revision.

What should happen

GCP public mint deploy should match ADR-0078 and CF parity:

  • Set PER_REPO_WIF_REPOS=*
  • Leave ALLOWED_ORGS unset or empty (tight/org enrollment is a separate path; public mode has no org wildcard)
  • Public-mode detection in GCP enroll/unenroll, per-repo registration, status, and mode-conversion guards should use IsPublicMintRepos, not IsPublicMint(ALLOWED_ORGS)
  • CLI help, dry-run text, and deploy summary should describe PER_REPO_WIF_REPOS=*, not ALLOWED_ORGS=*

Existing GCP mints deployed with ALLOWED_ORGS=* need a documented migration path (set PER_REPO_WIF_REPOS=*, clear ALLOWED_ORGS).

How to reproduce

go run ./cmd/fullsend mint deploy \
  --project <GCP_PROJECT> \
  --region us-central1 \
  --public \
  --pem-dir <pem-dir> \
  --app-set fullsend-ai \
  --dry-run
# Summary says: "Would deploy public mint (ALLOWED_ORGS=*, permissive WIF)"

# After real deploy, inspect traffic-serving revision env:
gcloud run revisions describe <revision> --project <GCP_PROJECT> --region us-central1 \
  --format='yaml(spec.containers[0].env)' | rg 'ALLOWED_ORGS|PER_REPO_WIF_REPOS'
# ALLOWED_ORGS=* present; PER_REPO_WIF_REPOS absent

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomponent/mintToken mint and cross-boundary credentialspriority/highSignificant impact, address soonready-to-codeTriaged and ready for the code agenttype/bugConfirmed defect in existing behavior

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions