Enforce Optimitron OAuth issuer in production and add Optimitron plugin metadata - #168
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds Optimitron marketplace and plugin manifests, configures its MCP endpoint, and updates MCP OAuth issuer resolution with an environment override, production fallback, and tests. ChangesOptimitron integration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ede5fc780
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/web/src/lib/__tests__/mcp-oauth-resource.test.ts`:
- Around line 49-58: Update the “keeps Optimitron as the production
authorization server” test to stub MCP_OAUTH_ISSUER with a non-empty, different
origin while VERCEL_ENV is production, then keep the assertion that
getOAuthMetadata().issuer equals CANONICAL, covering production override
precedence.
In `@packages/web/src/lib/mcp-oauth.ts`:
- Around line 39-40: Make the production branch in getMcpOAuthIssuer evaluate
before MCP_OAUTH_ISSUER so VERCEL_ENV="production" always returns the canonical
issuer; update packages/web/src/lib/mcp-oauth.ts lines 39-40 accordingly. In
packages/web/src/lib/__tests__/mcp-oauth-resource.test.ts lines 49-58, set a
conflicting non-empty MCP_OAUTH_ISSUER and assert production still returns the
canonical issuer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a5d03fa-5154-4ccc-946c-18f888012c4a
📒 Files selected for processing (6)
.agents/plugins/marketplace.json.env.examplepackages/web/src/lib/__tests__/mcp-oauth-resource.test.tspackages/web/src/lib/mcp-oauth.tsplugins/optimitron/.codex-plugin/plugin.jsonplugins/optimitron/.mcp.json
PR review packetStart here
No user-facing page or component changes were inferred from changed files or the visual review manifest. Changed files considered
Updated automatically when this PR's preview or visual review reruns. |
MCP_OAUTH_ISSUER was checked before the VERCEL_ENV production guard, so a variable scoped to all Vercel environments could override the canonical production issuer. Reorder the checks and add a regression test for a non-empty override in production. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Fixed in 2c79d2a: Generated by Claude Code |
Motivation
Description
packages/web/src/lib/mcp-oauth.tsto preferMCP_OAUTH_ISSUER, returnhttps://optimitron.comwhenVERCEL_ENVisproduction, and otherwise fall back toNEXTAUTH_URLor local defaults.packages/web/src/lib/__tests__/mcp-oauth-resource.test.tsto usehttps://optimitron.comas the canonical issuer, replace the environment stub toMCP_OAUTH_ISSUER, and add a new test that asserts production uses the Optimitron issuer.plugins/optimitron/.codex-plugin/plugin.json,plugins/optimitron/.mcp.json, and register the plugin in the agents marketplace with.agents/plugins/marketplace.json.MCP_OAUTH_ISSUERenvironment variable in.env.exampleto allow non-production overrides.Testing
vitest, includingpackages/web/src/lib/__tests__/mcp-oauth-resource.test.ts, and the modified tests passed.pnpm -w test) and observed the test run succeed for the changed modules.Codex Task
Summary by CodeRabbit
https://optimitron.com(even if an override is set)..env.examplewith an optionalMCP_OAUTH_ISSUERoverride for non-production setups.