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

ruby-grape / grape / 29200448895
97%

Build:
DEFAULT BRANCH: master
Ran 12 Jul 2026 04:36PM UTC
Jobs 32
Files 169
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

12 Jul 2026 04:36PM UTC coverage: 96.702% (+0.02%) from 96.686%
29200448895

push

github

web-flow
Add Grape::Mountable marker to identify a Grape app (#2793)

* Add Grape::Mountable marker to identify a Grape app

Grape distinguished a mounted Grape app from a bare Rack app by duck-typing
on an incidental internal method (`respond_to?(:inheritable_setting)`).
That is brittle: Grape::API and Grape::API::Instance share no common
ancestor and don't even respond to the same methods (mount_instance vs
inheritable_setting/endpoints), so there was no single predicate and the
checks keyed on a settings method that has nothing to do with mountability.

Introduce a Grape::Mountable marker extended by both Grape::API and
Grape::API::Instance, giving one explicit `is_a?(Grape::Mountable)`
predicate. Route the identity checks through it: Endpoint#bare_rack_app?
(used for forward_match) and the mount branch in DSL::Routing.

Capability checks that go on to call a stage-specific method are left as
respond_to? on purpose (a Mountable does not respond to every such method):
`respond_to?(:mount_instance)` still gates the remountable-class stage,
`respond_to?(:endpoints)` still guards reading endpoints, and the settings
inheritance check still guards calling inheritable_setting.

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

* Harden mounted-app auth surface and error HTML escaping

Two security-relevant fixes surfaced by a review of Grape::API:

- Grape::Middleware::Error#rack_response only escaped the error message
  when the response content-type was exactly 'text/html', so a
  parameterized value such as 'text/html; charset=utf-8' skipped escaping
  and could reflect an unescaped message into an HTML response. Compare the
  media type only.

- A bare Rack app mounted with `mount` is called directly and never goes
  through the endpoint middleware stack, so an API's authentication
  middleware does not wrap it and the mount is reachable unauthenticated.
  Mounted Grape APIs are unaffected. Warn at compile time when a bare Rack
  app is mounted under co... (continued)

1136 of 1230 branches covered (92.36%)

Branch coverage included in aggregate %.

21 of 21 new or added lines in 7 files covered. (100.0%)

3614 of 3682 relevant lines covered (98.15%)

23223.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rack_3_1.gemfile - 29200448895.1 12 Jul 2026 04:37PM UTC 168
95.25
GitHub Action Run
2 run-3.4-gemfiles/rails_8_0.gemfile - 29200448895.2 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
3 run-3.4-gemfiles/rails_8_1.gemfile - 29200448895.3 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
4 run-3.4-gemfiles/rails_7_2.gemfile - 29200448895.4 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
5 run-4.0-gemfiles/multi_json.gemfile - 29200448895.5 12 Jul 2026 04:37PM UTC 168
47.72
GitHub Action Run
6 run-3.3-gemfiles/rack_3_0.gemfile - 29200448895.6 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
7 run-3.3-gemfiles/rails_7_2.gemfile - 29200448895.7 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
8 run-4.0-gemfiles/rails_7_2.gemfile - 29200448895.8 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
9 run-4.0-gemfiles/rails_8_1.gemfile - 29200448895.9 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
10 run-4.0-gemfiles/grape_entity.gemfile - 29200448895.10 12 Jul 2026 04:37PM UTC 168
50.51
GitHub Action Run
11 run-4.0-gemfiles/rack_3_1.gemfile - 29200448895.11 12 Jul 2026 04:37PM UTC 168
95.25
GitHub Action Run
12 run-3.3-gemfiles/rack_2_2.gemfile - 29200448895.12 12 Jul 2026 04:37PM UTC 168
95.21
GitHub Action Run
13 run-4.0-gemfiles/rack_2_2.gemfile - 29200448895.13 12 Jul 2026 04:37PM UTC 168
95.21
GitHub Action Run
14 run-4.0-gemfiles/rack_3_0.gemfile - 29200448895.14 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
15 run-4.0-gemfiles/rack_3_2.gemfile - 29200448895.15 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
16 run-4.0-gemfiles/rails_8_0.gemfile - 29200448895.16 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
17 run-4.0-Gemfile - 29200448895.17 12 Jul 2026 04:37PM UTC 168
95.25
GitHub Action Run
18 run-4.0-gemfiles/multi_xml.gemfile - 29200448895.18 12 Jul 2026 04:37PM UTC 168
47.11
GitHub Action Run
19 run-3.3-Gemfile - 29200448895.19 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
20 run-3.3-gemfiles/rack_3_1.gemfile - 29200448895.20 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
21 run-3.4-gemfiles/rack_3_0.gemfile - 29200448895.21 12 Jul 2026 04:37PM UTC 168
95.25
GitHub Action Run
22 run-3.3-gemfiles/rails_8_1.gemfile - 29200448895.22 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
23 run-4.0-gemfiles/dry_validation.gemfile - 29200448895.23 12 Jul 2026 04:37PM UTC 168
58.34
GitHub Action Run
24 run-3.4-Gemfile - 29200448895.24 12 Jul 2026 04:37PM UTC 168
95.25
GitHub Action Run
25 run-4.0-gemfiles/hashie.gemfile - 29200448895.25 12 Jul 2026 04:37PM UTC 168
62.45
GitHub Action Run
26 run-3.3-gemfiles/rack_3_2.gemfile - 29200448895.26 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
27 run-3.3-gemfiles/rails_8_0.gemfile - 29200448895.27 12 Jul 2026 04:37PM UTC 169
95.25
GitHub Action Run
28 run-4.0-gemfiles/multi_xml_0_8.gemfile - 29200448895.28 12 Jul 2026 04:37PM UTC 168
47.15
GitHub Action Run
29 run-4.0-gemfiles/grape_swagger.gemfile - 29200448895.29 12 Jul 2026 04:36PM UTC 168
55.3
GitHub Action Run
30 run-3.4-gemfiles/rack_3_2.gemfile - 29200448895.30 12 Jul 2026 04:36PM UTC 168
95.25
GitHub Action Run
31 run-3.4-gemfiles/rack_2_2.gemfile - 29200448895.31 12 Jul 2026 04:36PM UTC 168
95.21
GitHub Action Run
32 run-4.0-gemfiles/multi_json_1_20.gemfile - 29200448895.32 12 Jul 2026 04:36PM UTC 168
47.76
GitHub Action Run
Source Files on build 29200448895
  • Tree
  • List 169
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #29200448895
  • db3e3e9d on github
  • Prev Build on master (#29200240078)
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