Repository navigation
feat(console): WorkOS API key from the Secrets Store, and a deploy workflow - #18
Merged
Bryan Fawcett (bryanfawcett) merged 3 commits intoOct 16, 2026
Merged
Conversation
…rkflow - The API key is the Secrets Store secret CONSOLE_WORKOS_API_KEY, bound under the same name (placeholder store_id for the owner), read with env.CONSOLE_WORKOS_API_KEY.get() on each request and handed to AuthKit. The package's own integration reads build-time astro:env strings, so the console owns the routes and a runtime-config middleware instead. Fails closed (JSON 500 for /api, no session elsewhere); never logs a value. - WORKOS_CLIENT_ID (client_01KQBBSMQTSMTBN7HEC9KQBJC0) and the redirect URI are plain vars; WORKOS_COOKIE_PASSWORD stays a separate Worker secret. - deploy.yml: dispatch or push to main only, production environment, pinned cloudflare/wrangler-action, post-deploy smoke. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnTa759tUrAwMiSoif5g6w
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnTa759tUrAwMiSoif5g6w
Replace library env source, per-request config flag, key cache, reject string key in prod, POST-only logout, fixed callback message, smoke Accept headers, store id validation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnTa759tUrAwMiSoif5g6w
Bryan Fawcett (bryanfawcett)
marked this pull request as ready for review
October 16, 2026 23:43
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 2 for the StationKit console (follows #17).
WorkOS from the Secrets Store
CONSOLE_WORKOS_API_KEY, bound under the same name (secrets_store_secrets, placeholderstore_idREPLACE_WITH_SECRETS_STORE_ID, marked OWNER ACTION), read withawait env.CONSOLE_WORKOS_API_KEY.get()on each request.WORKOS_CLIENT_ID=client_01KQBBSMQTSMTBN7HEC9KQBJC0andWORKOS_REDIRECT_URIare plain vars.WORKOS_COOKIE_PASSWORDstays a separate Worker secret (wrangler secret put); no value invented.@workos/authkit-astroreads build-timeastro:envstrings (its injected middleware callsconfigureAuthKitfrom them), which cannot take a Secrets Store binding. So the console owns the routes (/auth/signin,/callback,/auth/logout) and a middleware that resolves the settings at runtime (src/auth/workos-config.ts) and then runs the package's ownauthkitMiddleware. Importing the package root needs a build stub forastro/config, documented inastro.config.mjs.@workos/authkit-sessionis pinned as a direct dependency./api/*(with the security headers) and no session elsewhere; the sign-in routes error. Never logs a value; failure output names settings only.Deploy workflow
.github/workflows/deploy.yml: dispatch or push tomainonly (never on PRs),productionenvironment,contents: read, full checks first,cloudflare/wrangler-actionpinned to a commit, post-deploy smoke (scripts/post-deploy-smoke.mjs: 200 landing, security headers, CSP, anonymous/api/stationsis 401, no secret in output). Reads only: secretCLOUDFLARE_API_TOKEN; varsCLOUDFLARE_ACCOUNT_ID,CONSOLE_SECRETS_STORE_ID,CONSOLE_SMOKE_URL(optional). No route or custom domain is added (the Worker stays unreachable until cutover).Not verified
The happy path with a real Secrets Store key cannot run in a local preview; it is covered by unit tests of
resolveWorkosConfigand by the post-deploy smoke. Not deployed.Generated by Claude Code