Skip to content

feat(secrets): all provider credentials via orun secrets — CI keeps only GITHUB_TOKEN - #34

Merged
ruehowl merged 7 commits into
mainfrom
feat/supabase-and-facts-via-orun-secrets
Jul 28, 2026
Merged

ruehowl merged 7 commits into
mainfrom
feat/supabase-and-facts-via-orun-secrets

Conversation

@ruehowl

@ruehowl ruehowl commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Completes the migration #31 started: every provider credential now resolves from orun secrets (project rung), brokered from the workspace's Cloudflare and Supabase integrations. After this merges + converges, the four provider GitHub secrets get deleted — GITHUB_TOKEN is the only credential CI holds.

Consumer Env var Source
14 worker deploy lanes CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID profile secretBindings (stack-tectonic 0.15.0) → workers-deploy mint + account-id fact
cloudflare-kv token + account id + TF_VAR_cloudflare_account_id component secretEnv
cloudflare-hyperdrive CLOUDFLARE_API_TOKEN ← CLOUDFLARE_HYPERDRIVE_TOKEN (hyperdrive-edit template) + account id component secretEnv
supabase SUPABASE_ACCESS_TOKEN (management-access, fresh per run) + TF_VAR_supabaseOrgId (org-id fact) component secretEnv
db-migrate SUPABASE_ACCESS_TOKEN component secretEnv

Server-side pieces: sourceplane/orun-cloud#664 (fact templates + hyperdrive-edit), sourceplane/stack-tectonic#9 (account-id binding, 0.15.0).

This PR's own plan lanes are the live test: kv/hyperdrive/supabase plan lanes + db-migrate mint all four new secrets. A parent_grant_insufficient on the hyperdrive lane means the connection's parent token needs the Workers Hyperdrive Write permission group added (deny-by-default; the connect recipe includes it going forward).

🤖 Generated with Claude Code

varahul and others added 4 commits July 27, 2026 22:52
…nly GITHUB_TOKEN (phase 2)

Completes the migration #31 started. Every provider credential now resolves
from orun secrets at the project rung, brokered from the workspace's
integrations:

- cloudflare-hyperdrive: CLOUDFLARE_API_TOKEN maps to the new
  CLOUDFLARE_HYPERDRIVE_TOKEN (hyperdrive-edit template — Workers Hyperdrive
  Write, which the workers-deploy token deliberately lacks).
- CLOUDFLARE_ACCOUNT_ID + TF_VAR_cloudflare_account_id: the account-id
  connection-fact template (non-secret custody anchor) — bound by the worker
  deploy profiles (stack-tectonic 0.15.0) and the kv/hyperdrive components.
- supabase: SUPABASE_ACCESS_TOKEN minted fresh per run (management-access);
  TF_VAR_supabaseOrgId from the org-id connection fact. SUPABASE_API_KEY
  aliasing is retired (the provider reads SUPABASE_ACCESS_TOKEN natively).
- db-migrate: SUPABASE_ACCESS_TOKEN via component secretEnv.
- ci.yml: the provider env block is gone — GITHUB_TOKEN (GitHub-issued,
  ephemeral) is the only credential CI holds.

Verified: a synthetic push-main plan against stack-tectonic 0.15.0 shows 36
jobs carrying refs — 14 worker deploys × 2 envs (token + account id),
kv/hyperdrive (token + account id + TF_VAR), supabase (token + org id),
db-migrate (token).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…w retired (phase 3)

Every worker that had managed runtime secrets in the AWS Secrets Manager
escrow now declares them as optionalSecretEnv references (best-effort:
unseeded keys skip at resolve) plus a runtimeSecrets parameter naming what
the stack's secrets-live v2 step pushes via wrangler secret bulk after
deploy. Seeding a value in orun secrets makes the next deploy push it —
zero repo changes per secret:

- identity-worker: GITHUB_OAUTH_CLIENT_SECRET, GOOGLE_OAUTH_CLIENT_SECRET,
  OAUTH_STATE_SECRET
- billing-worker: POLAR_ACCESS_TOKEN, POLAR_WEBHOOK_SECRET
- config-worker + webhooks-worker: SECRET_ENCRYPTION_KEY (config-worker's
  generate-if-missing pre-deploy stays as the safety net; seed the CURRENT
  deployed value — a fresh key bricks stored data)
- integrations-worker: the deferred GitHub App set + INTEGRATIONS_STATE_SECRET
  + SECRET_ENCRYPTION_KEY — inert until seeded, exactly the point

tooling/secrets-sync/ and tests/secrets-sync/ are deleted (assemble/check/
sync, manifests, fixtures, escrow runbook), the lockfile regenerated, and
the blueprint module list updated. stack-tectonic 0.15.0 -> 0.16.0
(secrets-live v2), orun v2.39.0 -> v2.41.0 (optionalSecretEnv).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every fork now carries flows/ (bootstrap-flow.yaml, create-secrets.sh,
batch.sh, park.mjs, README.md) via a new blueprint module in the workspace
phase. The files carry LUMEN's instance identity (lumen-api-edge URLs,
lumen.app zone note, org default "lumen") so the rebrand hook rewrites
them for a fork like every other file; the org default fails loudly at
preflight for any operator without access to the baseline workspace.

create-secrets.sh self-heals: a key whose integration connection was
revoked (health orphaned) is revoked and recreated against the current
ACTIVE connection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ublished job output secrets

Mirrors the nimbus flip (stack 0.18.0, orun v2.45.0, orun-cloud SB1 +
SEC-JOB), adapted to lumen's identity:

- terraform roots: backend http (runner TF_HTTP_*), aws provider and all
  aws_secretsmanager_* resources gone; supabase creds + wiring documents
  leave as OUTPUTS lease-published by the runner (secretOutputs param).
- consumers: hyperdrive TF_VARs, db-migrate runner env (no @aws-sdk),
  workers' WIRING_<COMP>_<ENV> secretEnv.
- bootstrap component DELETED (it existed to prove the S3 state bucket);
  blueprint module + phases regenerated; batch plan reordered
  (kv → supabase → db-migrate+hyperdrive → workers…).
- intent: stack 0.18.0, aws params dropped; ci.yml pins orun v2.45.0.

⚠ DO NOT MERGE before running tooling/migrations/tfstate-to-orun.sh
(S3 state pull → drop SM resources from state → push to the platform
backend; needs AWS read creds + an orun token). Without it, applies
against the empty http backend would plan to re-create live resources.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ruehowl

ruehowl commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Merge gate — terraform state migration required first.

This branch now carries the full de-AWS flip (platform backend \"http\" state + lease-published secretOutputs; bootstrap deleted; stack 0.18.0 / orun v2.45.0). Lumen has LIVE terraform state in S3, so before merging:

tooling/migrations/tfstate-to-orun.sh <org_…> <prj_…> <orun-access-token>

(needs AWS creds able to read the sourceplane-{stage,prod} state buckets + a fresh orun token). It pulls each component×env state from S3, drops the aws_secretsmanager_* resources from state (their prevent_destroy would otherwise error every plan; the SM secrets stay in AWS untouched), and pushes into the platform backend. Merging without it would make applies plan to re-create live resources.

After migration + merge, the old <env>-github-sourceplane-lumen-* IAM roles and the state buckets' lumen/ prefixes can be retired in aws-admin.

varahul and others added 3 commits July 28, 2026 18:52
… globally

The global pattern also stripped the two legacy workers' COMMITTED
configs (policy-worker, web-console-next) from forks — their verify
lanes then failed test -f silently (hit live on nimbus workers-a).
….0 resume+retry CI

- supabase provider ~> 1.5.1: 1.6.0+ reads /billing/addons which rejects
  OAuth tokens — the exact credential the platform brokers
- ci.yml: orun v2.48.0, --retry (true resume with exec-id on
  gh run rerun --failed), max-parallel: 8 (resolve-herd stagger)

All three were found and proven live during the nimbus baseline deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ruehowl
ruehowl merged commit d368960 into main Jul 28, 2026
9 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants