Bug 28772: Make secret validation use the new method
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 9 Sep 2021 11:38:25 +0000 (08:38 -0300)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Mon, 20 Sep 2021 13:50:49 +0000 (15:50 +0200)
commit1ba6f245fe2c83db86448fed6fce03e67fefb165
treed6874ac2f363e2766420bde38c5f2bb250780f63
parent7b47bdeeac42229cc3b1a933efe9f3a7d61cd9b4
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>
(cherry picked from commit 977a2327b12042683128907be719e4d00ead7b73)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Koha/OAuth.pm