Skip to content

Commit f1858dc

Browse files
sametbasbugclaude
andcommitted
Carry the site sign-in secrets with the production version
The two secrets the sign-in door needs now travel in the deploy's --secrets-file, the same way the Google pair and the MCP secrets already do, and the deploy stops if either is missing. Deliberately NOT added to assertIdentityBindings, which is where the earlier plan pointed. That check runs at the top of every API request, so requiring the signing key there would take the feed, posts and messages down over a missing key whose only real consequence is that one door cannot open — and the door already answers 503 on its own. Losing a key to a door should not demolish the house. The noise belongs at deploy time instead, which is what the workflow's own guard and the two new config assertions provide; both fail when reverted. Worth recording: REQUIRED_SECRET_BINDINGS in constants.ts is referenced nowhere. It reads like a gate and gates nothing, so "not in that list" was never the safety property it sounded like. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9dabcbe commit f1858dc

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ jobs:
254254
ORBIT_LIVE_OAUTH_CLIENT_SECRET: ${{ secrets.ORBIT_LIVE_OAUTH_CLIENT_SECRET }}
255255
ORBIT_MCP_SERVICE_SECRET_V1: ${{ secrets.ORBIT_MCP_SERVICE_SECRET_V1 }}
256256
ORBIT_MCP_DELEGATION_PEPPER_V1: ${{ secrets.ORBIT_MCP_DELEGATION_PEPPER_V1 }}
257+
ORBIT_OIDC_SIGNING_KEY_V1: ${{ secrets.ORBIT_OIDC_SIGNING_KEY_V1 }}
258+
ORBIT_SITE_TOKEN_PEPPER_V1: ${{ secrets.ORBIT_SITE_TOKEN_PEPPER_V1 }}
257259
run: |
258260
if [[ -z "$ORBIT_LIVE_OAUTH_CLIENT_ID" || -z "$ORBIT_LIVE_OAUTH_CLIENT_SECRET" ]]; then
259261
echo 'Live Google OAuth deployment secrets are missing.' >&2
@@ -263,6 +265,14 @@ jobs:
263265
echo 'Orbit MCP production secrets are missing.' >&2
264266
exit 1
265267
fi
268+
# Site giriş kapısının iki sırrı. Eksikse dağıtım burada duruyor,
269+
# çalışma zamanında durmuyor: eksik bir imza anahtarının gerçek sonucu
270+
# yalnızca o kapının kapalı olması, ve kapı bunu kendi başına 503 ile
271+
# söylüyor. Bir kapının anahtarını kaybetmek evi yıkmamalı.
272+
if [[ -z "$ORBIT_OIDC_SIGNING_KEY_V1" || -z "$ORBIT_SITE_TOKEN_PEPPER_V1" ]]; then
273+
echo 'Orbit site sign-in production secrets are missing.' >&2
274+
exit 1
275+
fi
266276
267277
oauth_secrets_file="$(mktemp)"
268278
trap 'rm -f "$oauth_secrets_file"' EXIT
@@ -271,10 +281,13 @@ jobs:
271281
GOOGLE_OAUTH_CLIENT_ID: env.ORBIT_LIVE_OAUTH_CLIENT_ID,
272282
GOOGLE_OAUTH_CLIENT_SECRET: env.ORBIT_LIVE_OAUTH_CLIENT_SECRET,
273283
ORBIT_MCP_SERVICE_SECRET_V1: env.ORBIT_MCP_SERVICE_SECRET_V1,
274-
ORBIT_MCP_DELEGATION_PEPPER_V1: env.ORBIT_MCP_DELEGATION_PEPPER_V1
284+
ORBIT_MCP_DELEGATION_PEPPER_V1: env.ORBIT_MCP_DELEGATION_PEPPER_V1,
285+
ORBIT_OIDC_SIGNING_KEY_V1: env.ORBIT_OIDC_SIGNING_KEY_V1,
286+
ORBIT_SITE_TOKEN_PEPPER_V1: env.ORBIT_SITE_TOKEN_PEPPER_V1
275287
}' > "$oauth_secrets_file"
276288
unset ORBIT_LIVE_OAUTH_CLIENT_ID ORBIT_LIVE_OAUTH_CLIENT_SECRET
277289
unset ORBIT_MCP_SERVICE_SECRET_V1 ORBIT_MCP_DELEGATION_PEPPER_V1
290+
unset ORBIT_OIDC_SIGNING_KEY_V1 ORBIT_SITE_TOKEN_PEPPER_V1
278291
279292
npx wrangler d1 migrations apply DB \
280293
--remote \

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,33 @@ assert(
310310
deployWorkflow.includes("trap 'rm -f \"$oauth_secrets_file\"' EXIT"),
311311
'production deploy does not clean up its temporary OAuth secrets file',
312312
);
313+
314+
/* Site giriş kapısının iki sırrı da her dağıtımda Worker sürümüyle birlikte
315+
* yükleniyor, ve bu kontrol o davranışın kilidi.
316+
*
317+
* Neden bu iki sır `assertIdentityBindings`'in zorunlu listesinde DEĞİL: o
318+
* kontrol her isteğin başında koşuyor. Eksik bir imza anahtarı akışı,
319+
* gönderileri ve mesajları da düşürürdü — oysa eksik anahtarın gerçek sonucu
320+
* yalnızca giriş kapısının kapalı olması, ve kapı bunu kendi başına 503 ile
321+
* söylüyor. Bir kapının anahtarını kaybetmek evi yıkmamalı. Gürültü bu yüzden
322+
* çalışma zamanında değil, dağıtım anında çıkıyor: aşağıdaki iki iddia iş
323+
* akışının sırları taşımayı bırakmasını yakalıyor, ve iş akışının kendi boşluk
324+
* kontrolü de eksik sırla dağıtımı durduruyor. */
325+
assert(
326+
deployWorkflow.includes('ORBIT_OIDC_SIGNING_KEY_V1: ${{ secrets.ORBIT_OIDC_SIGNING_KEY_V1 }}')
327+
&& deployWorkflow.includes('ORBIT_SITE_TOKEN_PEPPER_V1: ${{ secrets.ORBIT_SITE_TOKEN_PEPPER_V1 }}'),
328+
'production deploy does not source the site sign-in secrets',
329+
);
330+
for (const binding of ['ORBIT_OIDC_SIGNING_KEY_V1', 'ORBIT_SITE_TOKEN_PEPPER_V1']) {
331+
assert(
332+
deployWorkflow.includes(`${binding}: env.${binding}`),
333+
`production deploy does not upload ${binding}; the site sign-in door would ship closed`,
334+
);
335+
}
336+
assert(
337+
/if \[\[ -z "\$ORBIT_OIDC_SIGNING_KEY_V1" \|\| -z "\$ORBIT_SITE_TOKEN_PEPPER_V1" \]\]/u.test(deployWorkflow),
338+
'production deploy does not stop when the site sign-in secrets are missing',
339+
);
313340
assert(
314341
deployWorkflow.includes("- 'docs/**'") && deployWorkflow.includes("- '*.md'"),
315342
'documentation-only pushes are not excluded from production deploys',

0 commit comments

Comments
 (0)