Skip to content

test(mcpbroker): show AS-2 refuses redemptions outside its configuration - #2778

Merged
ChrisJBurns merged 1 commit into
mainfrom
test/as2-redemption-refusals
Nov 13, 2026
Merged

ChrisJBurns merged 1 commit into
mainfrom
test/as2-redemption-refusals

Conversation

@ChrisJBurns

Copy link
Copy Markdown
Contributor

Follow-up to #2744, for @jhrozek's review comment: the AS-2 tests showed what we configure in ToolHive, but not that ToolHive refuses anything outside it.

What

Test-only change in internal/adapter/mcpbroker/as2_test.go. It runs against the real embedded ToolHive authorization server, trusting the harness's AS-1 through the test-only seam.

Checked

  • Accepting the token endpoint as an ID-JAG audience in the test trust makes "ID-JAG for the token endpoint" fail.
  • ToolHive refuses to build the server if mecatl's audiences are widened, or if the vMCP resource is added as an accepted ID-JAG audience. Neither can loosen silently.
  • go test ./internal/adapter/mcpbroker/ and the pinned golangci-lint pass.

API compatibility

None: test-only change.

AS-2's tests only redeemed valid ID-JAGs for the vMCP resource. Add the
refusals that back the configuration: a wrong or missing resource, an
ID-JAG addressed to the vMCP resource or the token endpoint, and an AS-1
access token presented as the assertion, with and without client
authentication. Record the two redemptions AS-2 accepts today that the
design refuses, an ID-JAG whose resource claim names another server and a
plain AS-1 JWT-bearer assertion without client authentication, so the
tickets that close them (#2533) turn them into refusals.

Co-authored-by: Mecatl <noreply@mecatl.dev>
@ChrisJBurns
ChrisJBurns merged commit 77216f2 into main Nov 13, 2026
43 checks passed
@ChrisJBurns
ChrisJBurns deleted the test/as2-redemption-refusals branch November 13, 2026 20:21
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
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