]> git.koha-community.org Git - koha.git/commit
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)
committerWainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Thu, 16 Sep 2021 02:17:37 +0000 (02:17 +0000)
commit977a2327b12042683128907be719e4d00ead7b73
tree2b78d114c604d09d59228c5f63c8d4e5d90eb71f
parent29923bf286f74f28699ffd5582914705001e7291
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>
Koha/OAuth.pm