Skip to content

fix(site): use the shared Nyuchi Internal Tools WorkOS app for the docs gate - #50

Merged
bryanfawcett merged 1 commit into
mainfrom
claude/docs-auth-workos-internal-tools
Aug 1, 2026
Merged

fix(site): use the shared Nyuchi Internal Tools WorkOS app for the docs gate#50
bryanfawcett merged 1 commit into
mainfrom
claude/docs-auth-workos-internal-tools

Conversation

@bryanfawcett

Copy link
Copy Markdown
Contributor

Summary

  • docs+feat: Fly.io Agent Gateway docs, and gate internal sections behind auth #48 merged assuming a dedicated confidential "Nyuchi Docs" WorkOS Connect app. Per direction, we're using the existing shared "Nyuchi Internal Tools" app instead (client_01KVTX0V2K1VM3PSC0DJ9VZWTV) — already used by other internal tools/MCP surfaces.
  • That app is clientConfidentiality: Public (no client secret at all — PKCE-only). site/src/worker/gate.ts's token exchange assumed a secret was required; made WORKOS_CLIENT_SECRET optional and only included in the request when set, so the same code path still works if a confidential app is ever swapped in later.
  • Baked the real, non-secret WORKOS_CLIENT_ID/WORKOS_ISSUER into wrangler.toml's [vars] rather than leaving them as a manual post-merge secrets step.
  • Registered https://docs.nyuchi.com/oauth/callback on that app's redirect-URI allowlist in the WorkOS dashboard (validated with a dry-run against the existing 5 redirects first, confirmed with a real run).

Still outstanding, not in this PR: INTERNAL_FETCH_KEY still needs to be generated and set as a Wrangler secret on both site and nyuchi-docs-mcp-worker (has to match on both) — that's an actual secret, not committed here.

Test plan

  • pnpm -r build — all packages build clean, wrangler deploy --dry-run on site shows the real WORKOS_CLIENT_ID/WORKOS_ISSUER bindings
  • pnpm -r test — 35 tests pass unchanged
  • Real login round-trip against docs.nyuchi.com once deployed

Generated by Claude Code

The gate assumed a confidential Connect app and required
WORKOS_CLIENT_SECRET in the token exchange. The app actually in use —
"Nyuchi Internal Tools" (client_01KVTX0V2K1VM3PSC0DJ9VZWTV), shared
with other internal tools/MCP surfaces rather than a dedicated "Nyuchi
Docs" app — is clientConfidentiality: Public, so it has no secret at
all; PKCE is the whole story. Make WORKOS_CLIENT_SECRET optional and
only include it in the token request when set.

Also bakes the real (non-secret) WORKOS_CLIENT_ID/WORKOS_ISSUER into
wrangler.toml [vars] instead of leaving them as a manual secrets
TODO — neither is sensitive: the client ID is exposed in the redirect
URL anyway, and an OIDC issuer is public by design.

https://docs.nyuchi.com/oauth/callback was added to that app's
redirect-URI allowlist in the WorkOS dashboard (validated with a
dry-run first, alongside its five existing redirects).
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nyuchi-docs-mcp 2efb95d Commit Preview URL

Branch Preview URL
Aug 01 2026, 02:15 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
shamwari-docs-ai 2efb95d Commit Preview URL

Branch Preview URL
Aug 01 2026, 02:16 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nyuchi-docs 2efb95d Commit Preview URL

Branch Preview URL
Aug 01 2026, 02:16 AM

@bryanfawcett
bryanfawcett marked this pull request as ready for review August 1, 2026 02:17
@bryanfawcett
bryanfawcett merged commit 87fe4d1 into main Aug 1, 2026
7 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