https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43137

--- Comment #12 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 202277
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202277&action=edit
Bug 43137: Add GET /api/v1/health endpoint

REST API endpoint that returns the aggregated system health status.

- Routes to Koha::REST::V1::Health#get
- Requires catalogue permission (low bar for access)
- Passes $c->stash(koha.user) to Koha::Health->status for filtering
- Permission-based filtering: checks the user cannot see get
  restricted => 1 with empty alert arrays
- Severity always reflects the unfiltered state (the dot is honest)
- Core alerts use { code, params } for translatable messages
- Plugin alerts use { message } (displayed as-is)

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ yarn api:bundle && koha-plack --restart kohadev
   k$ prove -v t/db_dependent/api/v1/health.t
   => SUCCESS: All tests pass
3. Tests cover:
   - 401 for unauthenticated requests
   - 403 for users without catalogue permission
   - 200 with correct response structure for authorized users
   - Internal _class field not exposed in response
4. Sign off :-D

Assisted-by: Sonnet 4 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to