• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 23006149677

12 Mar 2026 02:10PM UTC coverage: 64.27% (+0.02%) from 64.25%
23006149677

push

github

web-flow
Split vmcp auth/authz middleware for annotation flow (#4115)

* Split vmcp auth/authz middleware for annotation flow

The vmcp middleware chain previously composed auth+parser+authz into a
single middleware, which meant authz ran before discovery could provide
tool annotations. This splits them so authz runs after discovery.

- NewIncomingAuthMiddleware returns auth and authz separately (4 values)
- Add annotation enrichment middleware between discovery and authz
- Authz now sees tool annotations from discovered capabilities
- New middleware ordering: auth+parser → audit → discovery →
  annotation-enrichment → authz → handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix review findings from annotation flow middleware split

Update stale middleware-chain comments in server.go to reflect the new
ordering that includes annotation-enrichment and authz layers. Add an
early-return guard to ParsingMiddleware so the double-application (once
in auth, once in server.go for the no-auth case) skips re-reading the
request body. Use the mcp.MethodToolsCall constant instead of a string
literal to satisfy goconst, and add a clarifying comment on why
convertAnnotations intentionally omits Title.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

70 of 82 new or added lines in 5 files covered. (85.37%)

10 existing lines in 4 files now uncovered.

48467 of 75411 relevant lines covered (64.27%)

74.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.58
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc