Koha-clms/Koha/REST/V1
Tomas Cohen Arazi 28fb7b4f83 Bug 25327: Do not call authenticate_api_request to render the spec
The original code for Koha::REST::V1::Auth::under called
authenticate_api_request when requesting the API spec. This didn't make
sense, and recent changes on what conditions are tested for public
routes, broke the route.

We could add another condition, but it really doesn't make sense to call
authenticate_api_request if it should be publicly available in any
configuration, as discussed on the bug.

This patch adds a trivial check and the requested route, and lets the
request through in any case in 'under'.

To test:
1. Point your browser to:
   http://kohadev.myDNSname.org:8080/api/v1/
   http://kohadev.myDNSname.org:8080/api/v1/.html
=> FAIL: In both cases you get an authorization error.
2. Apply the regression tests patch
3. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth.t
=> FAIL: The tests reflect the situation, and fail
4. Apply this patch
5. Repeat 1 and 3
=> SUCCESS: All good!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 14:25:17 +12:00
..
Acquisitions Bug 23858: (follow-up) Return code fix 2019-10-28 12:36:46 +00:00
Clubs Bug 23843: Add mapping to Koha::Club::Holds 2019-10-23 18:03:03 +01:00
Patrons Bug 23805: Update 'Pay' to 'PAYMENT' for consistency 2019-10-24 17:35:20 +01:00
Auth.pm Bug 25327: Do not call authenticate_api_request to render the spec 2020-06-22 14:25:17 +12:00
Biblios.pm Bug 24909: Add unprivileged route to get a bibliographic record 2020-06-15 10:38:33 +12:00
Checkouts.pm Bug 23843: Add mapping to Koha::Checkout 2019-10-23 18:02:59 +01:00
Cities.pm Bug 23893: Use in /cities 2020-01-18 15:59:49 +00:00
Holds.pm Bug 23843: Add mapping to Koha::Hold 2019-10-23 18:03:07 +01:00
Illrequests.pm Bug 21460: (follow-up) Fix bugs found in QA 2019-04-25 10:46:56 +00:00
Items.pm Bug 23667: Add route to GET /items 2019-10-29 12:20:35 +00:00
Library.pm Bug 23843: Add mapping to Koha::Library 2019-10-23 18:03:11 +01:00
OAuth.pm Bug 23146: Add support for Basic auth on the OAuth2 token endpoint 2019-06-24 16:05:31 +01:00
Patrons.pm Bug 23893: Use in /patrons 2020-01-18 16:00:01 +00:00
ReturnClaims.pm Bug 14697: (QA follow-up) Organize tests in subtests 2019-10-31 12:05:14 +00:00
Stage.pm Revert "Bug 22026: Removed 'use Modern::Perl;' from Koha::REST::classes" 2019-02-26 11:04:08 -05:00
Static.pm Bug 22835: (follow-up) Remove comented code 2019-06-18 17:34:53 +01:00