Bugzilla – Attachment 161099 Details for
Bug 34893
ILS-DI can return the wrong patron for AuthenticatePatron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34893: Add checkpw change to REST API
Bug-34893-Add-checkpw-change-to-REST-API.patch (text/plain), 1.83 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-01-17 12:12:18 UTC
(
hide
)
Description:
Bug 34893: Add checkpw change to REST API
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-01-17 12:12:18 UTC
Size:
1.83 KB
patch
obsolete
>From f3e99e86f0f803f595cc0b3ef903b121506b1ea4 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 28 Nov 2023 22:57:39 +0000 >Subject: [PATCH] Bug 34893: Add checkpw change to REST API > >This patch adds the checkpw return value change to the REST API >route for validating user identifiers and password. > >Test plan: >0. Apply patch >1. prove t/db_dependent/api/v1/password_validation.t > >Bonus points: >1. koha-plack --reload kohadev >2. Enable syspref RESTBasicAuth >3. curl -XPOST -H "Content-Type: application/json" \ >-u <staff_userid>:<staff_password> \ >-d '{"identifier":"<cardnumber>","password":"<password>"}' \ >http://localhost:8081/api/v1/auth/password/validation >4. Validation doesn't fail. It gives you cardnumber, patron_id, userid > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Auth/Password.pm | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/Koha/REST/V1/Auth/Password.pm b/Koha/REST/V1/Auth/Password.pm >index 9889bf45a7d..189dcc80d59 100644 >--- a/Koha/REST/V1/Auth/Password.pm >+++ b/Koha/REST/V1/Auth/Password.pm >@@ -71,7 +71,7 @@ sub validate { > my $password = $body->{password} // ""; > > return try { >- my ( $status, $THE_cardnumber, $THE_userid ) = C4::Auth::checkpw( $identifier, $password ); >+ my ( $status, $THE_cardnumber, $THE_userid, $patron ) = C4::Auth::checkpw( $identifier, $password ); > unless ( $status && $status > 0 ) { > my $error_response = $status == -2 ? 'Password expired' : 'Validation failed'; > return $c->render( >@@ -80,8 +80,6 @@ sub validate { > ); > } > >- my $patron = Koha::Patrons->find( { cardnumber => $THE_cardnumber } ); >- > return $c->render( > status => 201, > openapi => { >-- >2.43.0
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 34893
:
156121
|
156123
|
159311
|
159314
|
159315
|
159356
|
159441
|
159506
|
159507
|
159508
|
159509
|
159797
|
159798
|
159799
|
159800
|
159893
|
161097
|
161098
| 161099 |
161100
|
161101
|
161324
|
163964