Commit Graph

37818 Commits

Author SHA1 Message Date
Marcel de Rooy fa73b3ef06 Bug 29540: Raise flagsrequired in modrequest
Test plan:
Try modrequest with a user having only 'catalogue' perms and the following URLs:
[1] /cgi-bin/koha/reserve/modrequest.pl?reserve_id=XX&CancelBorrowerNumber=XX&CancelItemnumber=XX&biblionumber=XX
    Fill the XXs with correct identifiers for some item level hold.
[2] /cgi-bin/koha/reserve/modrequest_suspendall.pl?suspend=1&suspend_until=2021-12-01&borrowernumber=XX
    Fill the XX with borrowernumber for borrower that has pending holds.
You should see: Error: You do not have permission to access this page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[AMENDED] More consensus for using reserveforothers than circulate_remaining.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 15285ae209)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 906228266b05fa660476d1f5b9320ac79241db82)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 07:29:27 +00:00
David Cook 6164380b08 Bug 28735: Self-checkout users can access opac-user.pl for sco user when not using AutoSelfCheckID
This patch makes the sandboxing of the selfcheckout more robust by
adding a "sco_user" session variable which is turned on when
logging into the self-checkout (either by AutoSelfCheckAllowed or manually).

If a user with this session variable turned on tries to access
other parts of the system (like the rest of the OPAC), it will
"kick out", so that the browser user will lose the authenticated session.

Test plan:
1) Apply the patch
2) koha-plack --restart kohadev
3) Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
4) Note that you are logged into the self-checkout
     So you see the login screen specific to the self-checkout.
     To log with the actual patron. It's a nested auth.
5) Go to http://localhost:8080/cgi-bin/koha/opac-main.pl
6) Note that you are not logged into the OPAC
7) Log into the staff interface and disable the
system preference AutoSelfCheckAllowed
8) Log out of the staff interface (this step is very important)
9) Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
10) Note that you are prompted to log into Koha
11) Login using the "koha" user (when using koha-testing-docker)
12) Note that you are logged into the self-checkout
13) Go to http://localhost:8080/cgi-bin/koha/opac-main.pl
14) Note that you are not logged into the OPAC
      Without the patch you would still be logged as "koha"
15) Go back to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
16) Note that you will need to log in again as you've lost your
session cookie
      Without the patch you will still be logged in the self-checkout
Voila!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 07:12:11 +00:00
Owen Leonard 155aa985a8 Bug 26102: Prevent XSS when To.json is used: unimarc_field_4XX.tt
To test, edit a MARC framework to link a subfield to the
unimarc_field_4XX.tt. The process of triggering the plugin and selecting
a search result from the plugin popup should work correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit dbd1359353)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit f424ae7dd89a1dfe1b2ab5a054a4388fabe03c37)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:45:06 +00:00
Owen Leonard 1048a5935b Bug 26102: Prevent XSS when To.json is used: subscription-add.tt
Test the process of adding a subscription, entering both a valid vendor
ID and a non-existent vendor ID. The non-existent vendor ID should
trigger a validation alert.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 583aad8e48)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit c971585ab03bf0686d68ad2c73f02006684bc3ed)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:40:34 +00:00
Owen Leonard 2b332eb5bf Bug 26102: Prevent XSS when To.json is used: guarantor_search.tt
To test, edit a patron record and go through the process of adding a
guarantor. In the guarantor search results table the address should be
displayed correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 11d0a05eb9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 82e76c4aeefa11a43cdb53ba566bb1de912e0f67)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:39:13 +00:00
Owen Leonard 55c003f4af Bug 26102: Prevent XSS when To.json is used: catalogue/results.tt
To test, perform a search in the catalogue and verify that search term
highlighting works correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0de86fd323)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 2a56d56f434c777b017c300cb906964ae15f52f4)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:38:32 +00:00
Owen Leonard 9179e5b707 Bug 26102: Prevent XSS when To.json is used: authorities/blinddetail-biblio-search.tt
Test the process of searching for and selecting an authority record for
use in the basic MARC editor.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 57a2a82c50)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 2631c0bcb7a90beaf62ce1401769c4c64f78c0b5)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:36:15 +00:00
Owen Leonard 711848f856 Bug 26102: Prevent XSS when To.json is used: authorities/authorities.tt
Check that mandatory tags and subfields are correctly required when
editing an authority record.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d9ae296b23)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 3cb5340c89f5c609f9154e2f3eb14ba0e195e0f2)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:34:46 +00:00
Owen Leonard f2063ecd9f Bug 26102: Prevent XSS when To.json is used: admin/preferences.tt
Test that preference search term highlighting works correctly.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5df95693f9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit b4b87a3091a38985d13f2a6d2eb243589ec8b7dd)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 06:32:50 +00:00
Jonathan Druart b257f25b1b Bug 29543: [19.11] Enforce authentication for self-checkout
The self-checkout feature is assuming a patron is logged in if patronid
is passed. It also assumes that "We're in a controlled environment; we
trust the user", which is terribly wrong!

This patch is suggesting to generate a JSON Web Token (JWT) to store in
a cookie and only allow action (renew, check in/out) is the token is
valid. The token is only generated once the user has been authenticated
And is removed when the user finish the session/logout.

Test plan:
You must know exactly how the self-checkout feature works to test this patch.
The 4 following sysprefs must be tested:
 SelfCheckoutByLogin, AutoSelfCheckAllowed, AutoSelfCheckID, AutoSelfCheckPass
Confirm that you can renew, checkin for the items you own, and checkout new items.
Confirm that you are not allowed to access other account's info.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Remove borrower variable

It's not needed, we have $patron

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Remove inputfocus variable

It's not used in template

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Add JWT token handling

Mojo::JWT is installed already, it's not a new dependency.
We need a way to send the patron a token when it's correctly logged in,
and not assumed it's logged in only if patronid is passed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Prevent user to checkin or renew items they don't own

Checkin or renew must be restricted to the items they own.

Test plan:
Create an item with barcode bc_1
Check it in to user A
Login to SCO with user B
Get the token using the browser dev tool, from the cookie
Hit (replace $JWT)
    /cgi-bin/koha/sco/sco-main.pl?jwt=$JWT&op=renew&barcode=bc_1
    /cgi-bin/koha/sco/sco-main.pl?jwt=$JWT&op=returnbook&barcode=bc_1

You should see an error message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: (follow-up) Add a warning to SelfCheckoutByLogin

This updates the language to warn users of risk if using cardnumber for login and auto-self-check is enabled

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Add Mojo::JWT dependency

Bug 29543: Set autocomplete off for SCO login fields

Cardnumber already had it set, adding for username and password

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 04:39:38 +00:00
Wainui Witika-Park ecfdb05e9e Update release notes for 19.11.24 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-04 05:44:14 +00:00
Wainui Witika-Park 20e53a1678 Increment version for 19.11.24 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-04 04:32:38 +00:00
Wainui Witika-Park f7e3afa0c8 Fix translations for Koha 19.11.24
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-04 04:29:38 +00:00
Koha translators 8c91e021ed Translation updates for Koha 19.11.24
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-04 00:51:30 -03:00
Martin Renvoize fd4cafb329 Bug 28904: Fix typo and display
Fix typo in template: Newletter => Newsletter
Fix latest newsletter editor definition.. it's a has not an array.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ded631f39e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0695c7420)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 95257f7f5c)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 95257f7f5c)
2021-12-01 13:47:20 +00:00
Martin Renvoize 09af8d4850 Bug 28904: Update team list to include newsletter editors
It seems we stopped recording the newsletter editor as part of the team
for a while :(.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6c85c1eac7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ceeec5155d)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 19d68212b8)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 19d68212b8)
2021-12-01 13:46:48 +00:00
Martin Renvoize 24e95ea94f Bug 28904: Add newsletter editor to about page display
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 77448b618d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 86282f26d1)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 9d9a981faf)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 9d9a981faf)
2021-12-01 13:46:12 +00:00
Martin Renvoize 299dcf9b8a Bug 29300: Add 22.05 release team to teams.yaml
Add the 22.05 release team.

Test plan
1/ Check against
   https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cc8a49d2e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4654df673)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit ffeb0b6191)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit ffeb0b6191)
2021-12-01 13:40:44 +00:00
Jonathan Druart a641e8867e Bug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes
On
  commit 5f37d8d2f4
  Bug 28935: No filtering on patron's data on member entry pages
we restricted the list of the columns from the borrowers table that can
be modified from the patron edit view.
We were too restrictive, the following 3 attributes can be edited from
this form: privacy_guarantor_fines, privacy_guarantor_checkouts,
checkprevcheckout and lang

Test plan:
Turn on the following prefs:
- AllowStaffToSetFinesVisibilityForGuarantor
- AllowStaffToSetCheckoutsVisibilityForGuarantor
- CheckPrevCheckout (set to 'unless overridden *')
- TranslateNotices
Edit a patron and see the 4 different options are now displayed.
Change their value, save, edit again
Confirm that the values have been saved

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0ca1419b26)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 04df6726ab)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 04df6726ab)
2021-12-01 13:31:10 +00:00
Jonathan Druart 29be0a38bf Bug 28772: DBRev 19.11.23.001
Note that this added back the following patch: "Bug 28772: Do not hash secrets twice"

https://bugs.koha-community.org/show_bug.cgi?id=29132
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-11-23 04:03:01 +00:00
Wainui Witika-Park 088ec2d60b Update release notes for 19.11.23 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-10-27 04:10:48 +00:00
Wainui Witika-Park d703ea9c90 Increment version for 19.11.23 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-10-27 03:57:37 +00:00
Koha translators 7860b72628 Translation updates for Koha 19.11.23
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-10-27 18:54:20 -03:00
Tomas Cohen Arazi e9d4702520 Bug 29032: Pre-load ILL backends to speed up response
Bug 22440 will rewrite the route and make it even more efficient by
prefetching the related data instead of performing several queries in
loops.

In the meantime, we can make this controller perform better with a
simple intervention: load backends once, and use the
$request->_backend() setter to pre-set it before using the objects.

To test:
1. Perform any usual ILL requests listing, try having several
=> FAIL: Notice it takes a weird amount of time to load
2. Apply this patch
3. Restart all
4. Repeat 1
=> SUCCESS: It feels fast enough!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7b1dc9d5f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa84d0704f)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit be277cd4c6)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit be277cd4c6)
2021-10-18 02:40:30 +00:00
Nick Clemens 8d687b2ea8 Bug 28676: Cache and retrieve match_count when searching a cached heading
We use match_count to determine if a new authority record should be created, however,
we were not adding this count to the cache, so if a record returned too many matches on first
lookup, we would create a new record on the second lookup

To test:
1 - Set Linker Module to 'Default'
2 - Enable  AutoCreateAuthorities  and  BiblioAddsAuthorities and  CatalogModuleRelink and LinkerRelink
3 - Add two copies of a single authority via Z39
4 - Add two headings for that authority to a bib record (e.g. a 610 and 710)
5 - Save the record and note a new authority is generated
6 - Repeat and see another is generated
7 - Apply patch
8 - Restart all the things
9 - Save the record again, no new authority created

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c46cefb7c5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9d5150e4cd)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 848ac85dcc)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 848ac85dcc)
2021-10-18 02:28:22 +00:00
Nick Clemens 5c04f569a9 Bug 28676: Unit test
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 869f1c758c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 97dcf5ded6)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit e30c1a5c08)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit e30c1a5c08)
2021-10-18 02:26:45 +00:00
Martin Renvoize d6bce50b8b Bug 28960: Explicitly call get_column
This patch adds get_column to ensure we are returning a string value of
a field rather than accidentally triggering a relationship accessor.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c3ef810a54)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9dbf469605)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit be4fbeff29)
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit be4fbeff29)
2021-10-18 02:12:18 +00:00
Wainui Witika-Park a1fd716fc6 Update release notes for 19.11.22 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-20 12:26:14 +00:00
Wainui Witika-Park 71ddd467a1 Increment version for 19.11.22 release
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-20 12:12:47 +00:00
Wainui Witika-Park 862e38f579 Merge remote-tracking branch 'translate/19.11.22-translate-20210922' into 19.11.22security
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-20 12:05:43 +00:00
Koha translators 0fb06d8cf9 Translation updates for Koha 19.11.22
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-22 21:47:40 -03:00
Wainui Witika-Park 4e5cfbc74a Merge branch 'rmaint_19.11.x' into 19.11.22security 2021-09-20 11:52:23 +00:00
Jonathan Druart df44ab6d77 Bug 28772: [19.11.x] Fix Koha/Object.t
Koha::ApiKeys is no longer the simple object we need to test
Koha::Object->store, let use Koha::Library::Groups

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-20 10:59:32 +00:00
Wainui Witika-Park 9df4709edb Revert "Bug 28772: Fix Koha/Object.t"
This reverts commit 711bde5f57.
2021-09-20 10:58:35 +00:00
Jonathan Druart 711bde5f57 Bug 28772: Fix Koha/Object.t
Koha::ApiKeys is no longer the simple object we need to test
Koha::Object->store, let use Koha::Library::Groups
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 5c22a4ca61)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 5c22a4ca61)
2021-09-20 09:21:59 +00:00
Tomas Cohen Arazi 73a06f4e24 Bug 28772: Fix auth_authenticate_api_request.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
(cherry picked from commit 17b2477d65)

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
(cherry picked from commit 17b2477d65)
2021-09-20 09:21:43 +00:00
Wainui Witika-Park 82d6494dc2 Revert "Bug 28772: Update existing keys [STABLE]"
This reverts commit e5c4127e8e.
2021-09-20 09:02:26 +00:00
Wainui Witika-Park d13da9916e Revert "Bug 28772: Do not hash secrets twice"
This reverts commit 9e087c7c8e.
2021-09-20 09:01:41 +00:00
Wainui Witika-Park 2c402eabbf Revert "Bug 28604: Prevent double encoding of MARC::Record::MiJ->to_mij output"
This reverts commit 5c89018abd.
2021-09-20 08:27:48 +00:00
Wainui Witika-Park 42e29ca613 Revert "Bug 28604: Regression tests"
This reverts commit c1a76b0d80.
2021-09-20 08:27:24 +00:00
Jonathan Druart 0cdc606e40 Bug 28772: Make validate_secret return 1|0
Not an empty string

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Marcel de Rooy d84b2254a8 Bug 28772: (QA follow-up) Apply change to other dbrev too [STABLE]
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi e5c4127e8e Bug 28772: Update existing keys [STABLE]
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi fc39e8ee58 Bug 28772: (QA follow-up) Fix wrong message
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi 9e087c7c8e Bug 28772: Do not hash secrets twice
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi 977a2327b1 Bug 28772: Make secret validation use the new method
This patch makes the Koha::OAuth library use the new validation method

To test:
1. In master, enable RESTOAuth2ClientCredentials and have your
   superlibrarian patron a client_id/secret pair generated
2. Use Postman to gain an access token with the client_id/secret pair
=> SUCCESS: This works in Koha
3. Use the access token to GET /api/v1/patrons
=> SUCCESS: It works
4. Apply this patchset up to the regression tests
5. Run:
   $ updatedatabase
   $ koha-plack --restart kohadev
=> SUCCESS: All good
6. Repeat 2
=> FAIL: You get an error trying to acquire an access token. Boo
7. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!
8. Apply this patch
9. Run:
   $ koha-plack --restart kohadev
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass!
10. Repeat 2
=> SUCCESS: Your original client_id/secret pair works!
11. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi 29923bf286 Bug 28722: Regression tests
To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove tt/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:37 +00:00
Tomas Cohen Arazi ce8e29e50a Bug 28772: Display API secret once
This patch makes the apikeys.pl display the generated API secret once,
when generated. After that, it won't be displayed by the UI.

To test:
1. Generate a new API key
=> FAIL: The secret is displayed in the API keys table
2. Visit some other page, and go back to the API keys page
=> FAIL: The API key secret is there
3. Apply this patch
4. Go to More > Manage API keys
=> SUCCESS: It no longer displays the secret
5. Generate a new API key
=> SUCCESS: The API key details (including the secret) are displayed.
=> SUCCESS: A message telling to copy the secret because it won't be
            displayed again is shown.
6. Repeat 4
=> SUCCESS: The secret is no longer displayed
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:36 +00:00
Tomas Cohen Arazi d1fbe564b6 Bug 28772: Add a warning about hash_password usage in updatedatabase.pl
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:36 +00:00
Tomas Cohen Arazi 572b380285 Bug 28772: Update existing keys
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2021-09-16 02:17:36 +00:00