Bugzilla – Attachment 95230 Details for
Bug 24003
REST API should set C4::Context->userenv
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24003: Create new userenv for REST basic authentication
Bug-24003-Create-new-userenv-for-REST-basic-authen.patch (text/plain), 915 bytes, created by
Lari Taskula
on 2019-11-08 15:21:20 UTC
(
hide
)
Description:
Bug 24003: Create new userenv for REST basic authentication
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2019-11-08 15:21:20 UTC
Size:
915 bytes
patch
obsolete
>From d937b39727b4b88884a2ed05ba8615f2f4092a13 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 8 Nov 2019 15:19:32 +0000 >Subject: [PATCH] Bug 24003: Create new userenv for REST basic authentication > >To test: >1. prove t/db_dependent/api/v1/auth_basic.t >2. Observe success >--- > Koha/REST/V1/Auth.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm >index 8bffc977da..ef9133acd9 100644 >--- a/Koha/REST/V1/Auth.pm >+++ b/Koha/REST/V1/Auth.pm >@@ -447,6 +447,7 @@ sub _basic_auth { > my ( $user_id, $password ) = split( /:/, $decoded_credentials, 2 ); > > my $dbh = C4::Context->dbh; >+ C4::Context->_new_userenv($user_id) unless defined C4::Context->userenv; > unless ( checkpw_internal($dbh, $user_id, $password ) ) { > Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Invalid password' ); > } >-- >2.17.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 24003
:
95228
|
95230
|
105579
|
105580
|
105581
|
105586
|
105587
|
105588
|
105633
|
105634
|
105635
|
105666
|
105844
|
105845
|
105846
|
105847
|
106087
|
106088
|
106089
|
106090