Bugzilla – Attachment 176164 Details for
Bug 38826
C4::Auth::check_api_auth sometimes returns $session and sometimes returns $sessionID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38826: Make check_api_auth $sessionID consistent
Bug-38826-Make-checkapiauth-sessionID-consistent.patch (text/plain), 1.94 KB, created by
Jan Kissig
on 2025-01-06 19:06:41 UTC
(
hide
)
Description:
Bug 38826: Make check_api_auth $sessionID consistent
Filename:
MIME Type:
Creator:
Jan Kissig
Created:
2025-01-06 19:06:41 UTC
Size:
1.94 KB
patch
obsolete
>From c1c90745402f3237db76f9afe7e825075c453bb1 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Sun, 5 Jan 2025 23:47:37 +0000 >Subject: [PATCH] Bug 38826: Make check_api_auth $sessionID consistent > >This change makes $sessionID consistently return using the session >ID and not sometimes the session object. > >Test plan: >0. Apply the patch >1. koha-plack --restart kohadev >2. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' --cookie-jar /tmp/test.cookies >3. Note the Csrf-Token header value >4. Replace the <CSRF-TOKEN>, <USERID>, and <PASSWORD> tokens in the next step >using the appropriate values (eg the CSRF-TOKEN is from the previous step) >5. curl -v -H "Content-Type: application/x-www-form-urlencoded" \ > -H "Csrf-Token: <CSRF-TOKEN>" -XPOST \ > 'http://localhost:8081/cgi-bin/koha/svc/authentication' \ > -d "login_userid=<USERID>&login_password=<PASSWORD>" \ > --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies >6. curl -XGET -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \ > --cookie /tmp/test.cookies > rec.marcxml >7. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' \ > --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies >8. Note the Csrf-Token header value >9. curl -H "Content-Type: text/xml" -H "Csrf-Token: <CSRF-TOKEN>" \ > -XPOST -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \ > --cookie /tmp/test.cookies --data @rec.marcxml > >Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> >--- > C4/Auth.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 0ee06104a4..b13f2589a6 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1635,7 +1635,7 @@ sub check_api_auth { > -secure => ( C4::Context->https_enabled() ? 1 : 0 ), > -sameSite => 'Lax' > ); >- return ( $return, $cookie, $session ); # return == 'ok' here >+ return ( $return, $cookie, $session->id ); # return == 'ok' here > > } else { > >-- >2.39.5
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 38826
:
176145
|
176164
|
176187