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

stacklok / toolhive / 24524851874
66%

Build:
DEFAULT BRANCH: main
Ran 16 Apr 2026 05:43PM UTC
Jobs 1
Files 634
Run time 2min
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

16 Apr 2026 05:37PM UTC coverage: 66.12% (+0.03%) from 66.087%
24524851874

push

github

web-flow
Detect JSON-RPC application errors in proxy audit middleware (#4709)

* Detect JSON-RPC application errors in proxy audit middleware

The audit middleware previously determined outcome solely from the HTTP
status code. Because MCP servers return errors inside HTTP 200 responses
per the JSON-RPC spec, application-level failures (expired tokens, API
errors, invalid parameters) were logged as outcome=success, making them
invisible in audit logs.

This change inspects the response body for a JSON-RPC error field when
the HTTP status is 200. If found, the outcome is recorded as
application_error with the error code and truncated message in metadata.

A new DetectApplicationErrors config flag (default true) controls the
behavior independently of IncludeResponseData, avoiding the need to
enable full response capture just for error detection.

Fixes #4678

Signed-off-by: Guillermo Gomez <guillermogomezmora@gmail.com>

* Fix lint and regenerate swagger docs

- Extract detectApplicationError into separate method to reduce
  cyclomatic complexity of logAuditEvent (gocyclo > 15)
- Fix gci import formatting in config.go
- Regenerate swagger docs for new DetectApplicationErrors config field

Signed-off-by: Guillermo Gomez <guillermogomezmora@gmail.com>

* Wire detectApplicationError into logAuditEvent

Replace inline JSON-RPC error detection logic with a call to the
extracted detectApplicationError method, fixing both the gocyclo
complexity violation and the unused function lint error.

Signed-off-by: Guillermo Gomez <guillermogomezmora@gmail.com>

* Regenerate CRD manifests and docs for DetectApplicationErrors field

Signed-off-by: Gustavo Gomez <gmogmz@indeed.com>

---------

Signed-off-by: Guillermo Gomez <guillermogomezmora@gmail.com>
Signed-off-by: Gustavo Gomez <gmogmz@indeed.com>

65 of 71 new or added lines in 3 files covered. (91.55%)

6 existing lines in 3 files now uncovered.

57486 of 86942 relevant lines covered (66.12%)

63.34 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
84.18
0.17% pkg/audit/auditor.go

Coverage Regressions

Lines Coverage ∆ File
2
93.94
-6.06% pkg/foreach/foreach.go
2
73.63
-0.64% pkg/runner/config.go
2
82.29
-0.21% pkg/vmcp/composer/workflow_engine.go
Jobs
ID Job ID Ran Files Coverage
1 24524851874.1 16 Apr 2026 05:43PM UTC 634
66.12
GitHub Action Run
Source Files on build 24524851874
  • Tree
  • List 634
  • Changed 12
  • Source Changed 4
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24524851874
  • 74335226 on github
  • Prev Build on main (#24523407242)
  • Next Build on main (#24526413656)
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