Skip to content

fix: separate CI gateway and PostHog credentials - #1240

Merged
gewenyu99 merged 3 commits into
mainfrom
codex/wizard-ci-separate-credentials
Sep 10, 2026
Merged

fix: separate CI gateway and PostHog credentials#1240
gewenyu99 merged 3 commits into
mainfrom
codex/wizard-ci-separate-credentials

Conversation

@gewenyu99

@gewenyu99 gewenyu99 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

CI needs separate gateway and PostHog project credentials.

Changes

Snapshot CI and --ci use WIZARD_CI_GATEWAY_TOKEN_FILE directly, never minting or reminting. API/MCP credentials stay separate. Optional WIZARD_CI_GATEWAY_URL defaults to regional v2.

Test plan

132 gateway/Pi/CLI tests and build passed; TypeScript matches main’s 28 existing diagnostics. Full local CI has not passed: direct requests with the trimmed gateway token return 401 auth_failed. CI workflow updates across wizard, wizard-workbench, and context-mill remain pending.

Keep project API and MCP access separate from gateway access. CI uses the externally issued bearer directly and never mints or remints it.
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 9, 2026 20:51
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99
gewenyu99 marked this pull request as draft September 9, 2026 21:18
@gewenyu99 gewenyu99 changed the title fix(ci): separate gateway and PostHog credentials WIP: separate CI gateway and PostHog credentials Sep 9, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@gewenyu99 gewenyu99 changed the title WIP: separate CI gateway and PostHog credentials fix: separate CI gateway and PostHog credentials Sep 10, 2026
@gewenyu99
gewenyu99 marked this pull request as ready for review September 10, 2026 21:45
# team and 403s. Same secret name wizard-workbench's wizard-ci.yml uses.
POSTHOG_WIZARD_PROJECT_ID: ${{ secrets.GH_APP_POSTHOG_WIZARD_CI_BOT_TARGET_PROJECT_ID }}
POSTHOG_WIZARD_REGION: us
WIZARD_CI_GATEWAY_TOKEN_FILE: ${{ runner.temp }}/gateway-token

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low: Gateway bearer exposed to dependency lifecycle scripts

This variable is inherited by smoke-test-ci.sh, which runs pnpm install or npm install for the fixture and installs the wizard package before launching the wizard. A compromised lifecycle script can read the predictable token file and use the bearer; create and expose the file only immediately before the wizard invocation, then remove it after configureGatewayFromCIEnvironment reads it.

@veria-ai

veria-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

PR overview

This pull request separates CI gateway credentials from PostHog credentials in the smoke-test workflow and configures the gateway credential for the wizard run.

One security issue remains: the gateway bearer is exposed while dependency installation scripts execute, allowing a compromised package lifecycle script to read and reuse it. Exploitation depends on a malicious or compromised dependency, and no issues have yet been addressed.

Open issues (1)

Fixed/addressed: 0 · PR risk: 3/10

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

/wizard-ci basic-integration/javascript-node

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: dcaf5dc
Workflow: View run

App Confidence PR YARA
basic-integration/javascript-node/express-todo 4/5 #3876 (logs)
basic-integration/javascript-node/fastify-blog 5/5 #3877 (logs)
basic-integration/javascript-node/hono-links 5/5 #3880 (logs)
basic-integration/javascript-node/koa-notes 4/5 #3879 (logs)
basic-integration/javascript-node/native-http-contacts 5/5 #3878 (logs)

Configuration

Setting Value
Wizard ref codex/wizard-ci-separate-credentials
Context Mill ref main
PostHog ref master

Search for trigger ID dcaf5dc in wizard-workbench PRs.

@gewenyu99
gewenyu99 merged commit 662f54d into main Sep 10, 2026
18 of 19 checks passed
@gewenyu99
gewenyu99 deleted the codex/wizard-ci-separate-credentials branch September 10, 2026 21:54
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.

3 participants