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

stacklok / toolhive / 19247866688
51%

Build:
DEFAULT BRANCH: main
Ran 10 Nov 2025 10:21PM UTC
Jobs 1
Files 364
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Nov 2025 10:16PM UTC coverage: 48.817% (+0.1%) from 48.72%
19247866688

push

github

web-flow
Add MCP well-known URI auth discovery per MCP Spec (#2527)

* Add MCP well-known URI auth discovery

Implements RFC 9728 Protected Resource Metadata discovery via
well-known URIs when WWW-Authenticate header is not present.
This completes ToolHive's implementation of the MCP specification
requirement that clients MUST support both discovery mechanisms.

Changes:
- Add tryWellKnownDiscovery() to discover auth via well-known URIs
- Add buildWellKnownURI() to construct RFC 9728 compliant URIs
- Add checkWellKnownURIExists() to validate URI accessibility
- Modify DetectAuthenticationFromServer() for well-known fallback
- Add comprehensive unit tests for all discovery paths
- Add regression tests for empty scope handling contracts

The implementation tries endpoint-specific URIs first, then root-level
URIs per MCP spec priority order. This enables authentication with
MCP-compliant servers that use well-known URIs per RFC 9728 Section 3
but don't send WWW-Authenticate headers.

Test coverage: 75.5% for pkg/auth/discovery

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jon Christiansen <467023+theJC@users.noreply.github.com>

* Update per MR feedback regarding content-type returned from wellknown endpoint, also dont consider wellknown as existing if we cannot access due to unauthorized/401

* fix golangci-lint identified issues

* Add more tests for coverage

* Update comment to make clearer

* PR PR feedback, defensively control how much response draining we are willing to do

* Update test to be more effecient per PR feedback

---------

Signed-off-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

78 of 81 new or added lines in 1 file covered. (96.3%)

4 existing lines in 2 files now uncovered.

23239 of 47604 relevant lines covered (48.82%)

35.95 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
77.06
5.19% pkg/auth/discovery/discovery.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
82.83
-0.55% pkg/transport/proxy/httpsse/http_proxy.go
2
56.0
-0.24% pkg/workloads/manager.go
Jobs
ID Job ID Ran Files Coverage
1 19247866688.1 10 Nov 2025 10:21PM UTC 364
48.82
GitHub Action Run
Source Files on build 19247866688
  • Tree
  • List 364
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #19247866688
  • cd66940f on github
  • Prev Build on main (#19242961116)
  • Next Build on main (#19258130397)
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

© 2025 Coveralls, Inc