Bugzilla – Attachment 124701 Details for
Bug 28772
Any user that can work with reports can see API keys of any other user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28772: Make secret validation use the new method
Bug-28772-Make-secret-validation-use-the-new-metho.patch (text/plain), 1.79 KB, created by
Marcel de Rooy
on 2021-09-09 12:47:14 UTC
(
hide
)
Description:
Bug 28772: Make secret validation use the new method
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-09-09 12:47:14 UTC
Size:
1.79 KB
patch
obsolete
>From bd127bffb11afe6a5f8a942ba3e899e23ac6d83b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 9 Sep 2021 08:38:25 -0300 >Subject: [PATCH] Bug 28772: Make secret validation use the new method >Content-Type: text/plain; charset=utf-8 > >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> >--- > Koha/OAuth.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/OAuth.pm b/Koha/OAuth.pm >index 29a701114c..99f6108656 100644 >--- a/Koha/OAuth.pm >+++ b/Koha/OAuth.pm >@@ -65,7 +65,7 @@ sub _verify_client_cb { > # client_id mandatory and exists on the DB > return (0, 'unauthorized_client') unless $api_key && $api_key->active; > >- return (0, 'access_denied') unless $api_key->secret eq $client_secret; >+ return (0, 'access_denied') unless $api_key->validate_secret( $client_secret ); > > return (1, undef, []); > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28772
:
124195
|
124247
|
124248
|
124249
|
124250
|
124251
|
124487
|
124488
|
124489
|
124490
|
124491
|
124691
|
124692
|
124693
|
124694
|
124695
|
124696
|
124697
|
124698
|
124699
|
124700
| 124701 |
124702
|
124703
|
124704
|
124705
|
124727
|
125088
|
125112
|
125116
|
125118
|
125128