Koha-clms/Koha/REST
Tomas Cohen Arazi 4efbb9bd61 Bug 25045: Allow restricting anonymous requests on the public API
This patch introduces a check on the authenticate_api_request method for
the RESTPublicAnonymousRequests system preference. If disabled,
anonymous  requests get rejected.

The idea is to replicate the homologous OpacPublic system preference
behaviour.

To test:
1. Apply the Unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail, 200 is answered instead of 401 on the route.
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ec99043a2e)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
2020-06-22 10:07:10 +12:00
..
Plugin Bug 24487: Don't apply matching criteria to path parameters 2020-04-17 18:42:35 +00:00
V1 Bug 25045: Allow restricting anonymous requests on the public API 2020-06-22 10:07:10 +12:00
V1.pm Revert "Bug 22026: Removed 'use Modern::Perl;' from Koha::REST::classes" 2019-02-26 11:04:08 -05:00