tests: add MCP auth e2e collection covering discovery, credential matrix, OAuth issuance, refresh rotation, revocation window, and runtime mode flip#4525
Conversation
|
|
|
Warning Review limit reached
More reviews will be available in 7 minutes and 15 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughExtends the MCP auth Postman collection with config validation, full OAuth virtual-key identity and session identity flows, revocation window tests, and a runtime config flip scenario. The Newman runner gains ChangesMCP Auth E2E Test Suite Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
395dd0c to
a5fa0bd
Compare
32e4bc0 to
0fc852e
Compare
a5fa0bd to
fb2ee5f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/e2e/api/README.md`:
- Around line 268-269: The documentation comment for MCP auth runner options is
missing the `--mcp-port` flag from the list of supported options. Update the
comment line that documents the runner options (currently showing `--port`,
`--html`, `--json`, `--verbose`, `--bail`) to also include `--mcp-port` with an
appropriate description (e.g., default port number for MCP server). This will
allow users to easily discover and use the flag when configuring local test
runs.
🪄 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: 76273975-5e1a-4083-b462-b4bf00757edd
📒 Files selected for processing (3)
tests/e2e/api/README.mdtests/e2e/api/collections/bifrost-v1-mcp-auth.postman_collection.jsontests/e2e/api/runners/individual/run-newman-mcp-auth-tests.sh
0fc852e to
69dff03
Compare
fb2ee5f to
6071377
Compare
69dff03 to
a0d848e
Compare
6071377 to
401b8ea
Compare
a0d848e to
e2e77f5
Compare
401b8ea to
bbcb5a4
Compare
e2e77f5 to
cbae6c9
Compare
bbcb5a4 to
16504e8
Compare

Summary
Adds a comprehensive end-to-end test suite for MCP inbound authentication, covering all three server auth modes (
headers,both,oauth) in a single Postman collection driven by a dedicated Newman runner.Changes
bifrost-v1-mcp-auth.postman_collection.jsonwith five new test folders:mcp_server_auth_modevalues andoauth2_server_configpayloads sent withheadersmode are rejected with 400, and that the boot mode round-trips correctly throughGET /api/config./mcp, refresh rotation, and stolen-token family revocation (replaying a rotated refresh token revokes the entire grant family)./mcp, and then enablingenforce_auth_on_inferenceat runtime causes that same session token to be rejected.headers-mode boot, upgrades tobothviaPUT /api/config, confirms discovery endpoints come alive, and verifies header-VK connections are unaffected.auth_modeenv-var so a single collection encodes the full credential matrix across modes; steps that do not apply to a given mode are skipped with a passing no-op assertion.--ignore-redirectsto the Newman invocation inrun-newman-mcp-auth-tests.shso that authorize redirects are captured as 302 responses rather than followed, allowing the collection to extract flow IDs fromLocationheaders.README.mdwith a full description of the new collection and runner, including per-mode assertion summaries and local run instructions.Type of change
Affected areas
How to test
Run the MCP auth test suite locally from
tests/e2e/api:The runner builds and starts the upstream MCP server (
examples/mcps/http-no-ping-server), boots a fresh server instance permcp_server_auth_mode, pre-seeds an MCP client and two virtual keys (one active, one inactive), and executes the collection against each mode in sequence. A builtbifrost-httpbinary is required.Screenshots/Recordings
N/A
Breaking changes
Related issues
N/A
Security considerations
The collection exercises the full OAuth 2.0 issuance surface including PKCE, refresh rotation, stolen-token family revocation, and the revocation window. No secrets are introduced; all credentials are ephemeral test values seeded by the runner.
Checklist
docs/contributing/README.mdand followed the guidelines