Skip to content

Commit 7a5d47f

Browse files
sametbasbugclaude
andcommitted
Ship the Google credential with the Worker version, not the GitHub one
The production deploy was still writing GITHUB_OAUTH_CLIENT_ID and GITHUB_OAUTH_CLIENT_SECRET onto a Worker that no longer has a GitHub provider, and refusing to deploy at all if either Actions secret was absent. Two dead secrets refreshed on every deploy, and a hostage: deleting the stale Actions secrets would have broken deploys. The design is kept because the design is right — credentials ride with the Worker version, so a version is self-contained and a deploy re-establishes sign-in rather than depending on someone having run `wrangler secret put` once. Only the destination changes: the same two Actions secrets now land on GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET. The config guard asserted that the deploy sources the pair from the production environment, and it kept passing all day while the pair went to the wrong bindings — because what went stale was the destination and the guard only watched the source. It now asserts the binding names, and that no GitHub OAuth binding is uploaded at all. Revert-checked: putting the GitHub names back fails with the message that names the consequence. DEPLOY ORDER MATTERS HERE. The two Actions secrets still hold the GitHub client ID and secret. Pushing this before they are updated to the Google values would overwrite the working GOOGLE_* secrets with GitHub ones and break sign-in on the live site immediately. This commit is deliberately not pushed. Local proof: `npm run build` end to end, 81 config assertions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent cdfe878 commit 7a5d47f

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

‎.github/workflows/deploy-production.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ jobs:
256256
ORBIT_MCP_DELEGATION_PEPPER_V1: ${{ secrets.ORBIT_MCP_DELEGATION_PEPPER_V1 }}
257257
run: |
258258
if [[ -z "$ORBIT_LIVE_OAUTH_CLIENT_ID" || -z "$ORBIT_LIVE_OAUTH_CLIENT_SECRET" ]]; then
259-
echo 'Live GitHub OAuth deployment secrets are missing.' >&2
259+
echo 'Live Google OAuth deployment secrets are missing.' >&2
260260
exit 1
261261
fi
262262
if [[ -z "$ORBIT_MCP_SERVICE_SECRET_V1" || -z "$ORBIT_MCP_DELEGATION_PEPPER_V1" ]]; then
@@ -268,8 +268,8 @@ jobs:
268268
trap 'rm -f "$oauth_secrets_file"' EXIT
269269
chmod 600 "$oauth_secrets_file"
270270
jq -n '{
271-
GITHUB_OAUTH_CLIENT_ID: env.ORBIT_LIVE_OAUTH_CLIENT_ID,
272-
GITHUB_OAUTH_CLIENT_SECRET: env.ORBIT_LIVE_OAUTH_CLIENT_SECRET,
271+
GOOGLE_OAUTH_CLIENT_ID: env.ORBIT_LIVE_OAUTH_CLIENT_ID,
272+
GOOGLE_OAUTH_CLIENT_SECRET: env.ORBIT_LIVE_OAUTH_CLIENT_SECRET,
273273
ORBIT_MCP_SERVICE_SECRET_V1: env.ORBIT_MCP_SERVICE_SECRET_V1,
274274
ORBIT_MCP_DELEGATION_PEPPER_V1: env.ORBIT_MCP_DELEGATION_PEPPER_V1
275275
}' > "$oauth_secrets_file"

‎docs/V6_PROJECT_LEDGER.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,3 +2056,16 @@ Anything under `docs/archive/` describes an earlier state and is frozen. Read it
20562056
rewritten owner test and would otherwise have vanished with it.
20572057
- Local proof: `npm run check` 0 errors 0 hints, `npm run build` end to end —
20582058
227 D1 tests, 2791 site assertions, 557 browser assertions.
2059+
- Two things surfaced only after the removal deployed. Migrations are applied
2060+
by the deploy workflow itself, not by hand — 0040 landed at 13:40:13 as part
2061+
of run 31393933857, and the "new schema, old code" window earlier in the day
2062+
had been self-inflicted by applying 0039 manually three minutes ahead of the
2063+
push. And the deploy was still uploading `GITHUB_OAUTH_CLIENT_ID` and
2064+
`GITHUB_OAUTH_CLIENT_SECRET` onto a Worker with no GitHub provider, failing
2065+
the deploy if either was absent. The workflow now uploads the Google pair
2066+
from the same two Actions secrets, and the config guard asserts the binding
2067+
names rather than only the Actions ones — the old assertions passed
2068+
throughout, because what went stale was the destination, not the source.
2069+
- `production:config:check` moved into `npm run build`. It had drifted twice
2070+
in one day and both times the drift was invisible locally, because the guard
2071+
only ever ran in CI.

‎scripts/orbit-production-config-tests.mjs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,21 @@ assert(
291291
deployWorkflow.includes('--secrets-file "$oauth_secrets_file"'),
292292
'production deploy does not upload the live OAuth pair with the Worker version',
293293
);
294+
/* Hangi BAĞLAMAYA yazdığı da kilitli, yalnız Actions sırrının varlığı değil.
295+
* Sessizce eskiyen tam olarak buydu: sağlayıcı Google'a geçtikten sonra iş
296+
* akışı `GITHUB_OAUTH_*` yazmaya devam etti, iki ölü sır her dağıtımda
297+
* tazelendi ve hiçbir kontrol bunu görmedi — çünkü kontroller Actions
298+
* tarafındaki adlara bakıyordu ve o adlar değişmemişti. */
299+
for (const binding of ['GOOGLE_OAUTH_CLIENT_ID', 'GOOGLE_OAUTH_CLIENT_SECRET']) {
300+
assert(
301+
deployWorkflow.includes(`${binding}: env.ORBIT_LIVE_OAUTH_CLIENT_`),
302+
`production deploy does not upload ${binding}; the Worker version would ship without a usable sign-in credential`,
303+
);
304+
}
305+
assert(
306+
!/GITHUB_OAUTH_CLIENT_(?:ID|SECRET):\s*env\./u.test(deployWorkflow),
307+
'production deploy still uploads GitHub OAuth secrets to a Worker that has no GitHub provider',
308+
);
294309
assert(
295310
deployWorkflow.includes("trap 'rm -f \"$oauth_secrets_file\"' EXIT"),
296311
'production deploy does not clean up its temporary OAuth secrets file',

0 commit comments

Comments
 (0)