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

--- Comment #6 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 203794
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203794&action=edit
Bug 42585: Add REST API for report analysis

This patch adds POST /api/v1/reports/analyze, which runs the analyzer
over the given SQL and returns the severity and findings as JSON. It
takes the SQL and any placeholder parameters, and is guarded by the
reports.create_reports permission.

Test Plan:
1) Apply this patch
2) yarn api:bundle
3) Restart all the things!
4) prove t/db_dependent/api/v1/reports_analyze.t
5) Run:
   curl -s -X POST \
     "http://koha:[email protected]/api/v1/reports/analyze"; \
     -H "Content-Type: application/json" \
     -d '{"sql":"UPDATE borrowers SET surname=1"}' | jq .
6) Note the forbidden_statement finding with severity high!
7) Repeat with "SELECT borrowernumber FROM borrowers LIMIT 1", note the
   empty findings list and a null severity!

-- 
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