]> git.koha-community.org Git - koha.git/commit
Bug 36420: Allow Basic authentication using `cardnumber`
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 27 Mar 2024 12:01:32 +0000 (12:01 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 28 May 2024 19:33:20 +0000 (19:33 +0000)
commit448ac1a22fa40bc6220a3f6c24781b2d34667fec
tree26a510f446d18182ae1a7a48818e007ce56b44ba
parentb91a66df91c844005d832a9ab3aaead189456ba3
Bug 36420: Allow Basic authentication using `cardnumber`

This patch makes the API Basic authentication work with cardnumbers.
The used `checkpw_internal` method already does the fallback check.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests explode! [1]
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] This highlights an underlying bug! Instead of getting 403, etc we get a 500. This is because of the internal fallback mechanism allowing the cardnumber+password combination, but then the Koha::Patron->find... not finding :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 154a2ea9ad5b6e911a504b8798f5ffe6df1c2297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd58ce2a036e9b762f3e5418b7b670532de5dd05)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/REST/V1/Auth.pm