[Bug 36098] New: Create Koha::Session module
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Bug ID: 36098 Summary: Create Koha::Session module Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Authentication Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: dpavlin@rot13.org There are times where you need to interact with Koha sessions, but you can't or don't want to load C4::Auth. I propose creating a minimal Koha::Session module, which will initially only have 1 method for fetching a session object, but over time can be built up. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34478 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18315, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15204, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17427 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 162167 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162167&action=edit Bug 36098: Add Koha::Session module to ease session handling This patch adds a Koha::Session module that makes it easier to work with Koha sessions without needing the full C4::Auth module. Test plan: 0. Apply the patch 1. Run the following unit tests: prove ./t/db_dependent/Auth.t prove ./t/db_dependent/Auth_with_cas.t prove ./t/db_dependent/Koha/Session.t 2. Observe that they all pass -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Blocks|34478 |36102 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162167|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 162200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162200&action=edit Bug 36098: Add Koha::Session module to ease session handling This patch adds a Koha::Session module that makes it easier to work with Koha sessions without needing the full C4::Auth module. Test plan: 0. Apply the patch 1. Run the following unit tests: prove ./t/db_dependent/Auth.t prove ./t/db_dependent/Auth_with_cas.t prove ./t/db_dependent/Koha/Session.t 2. Observe that they all pass Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 162201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162201&action=edit Bug 36098: (QA follow-up) Add POD to Koha::Session Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com Patch complexity|--- |Trivial patch --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This is a simple and clear patch, opting to straight QA it to keep things moving here. QA scripts happy, Unit tests happy, Tests added and passing. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Please don't push now. Wait for the rest of the tree. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 162204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162204&action=edit Bug 36098: Allow to pass storage_method Will need this on follow-up bugs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162204|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 162205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162205&action=edit Bug 36098: Allow to pass storage_method Will need this on follow-up bugs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 162205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162205 Bug 36098: Allow to pass storage_method Review of attachment 162205: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36098&attachment=162205) ----------------------------------------------------------------- ::: Koha/Session.pm @@ +51,4 @@
=cut
sub _get_session_params { + my ( $class, $storage_method ) = @_;
$storage_method is a hashref in get_session() but treated as a string below. This should be updated to $args and $storage_method should be pulled from it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #7)
Created attachment 162205 [details] [review] Bug 36098: Allow to pass storage_method
Will need this on follow-up bugs.
Could you explain why? I don't see why yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Created attachment 162228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162228&action=edit Bug 36098: Fix storage_method pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Created attachment 162231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162231&action=edit Bug 36098: (follow-up) extend test to check driver -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #12 from David Cook <dcook@prosentient.com.au> --- Thought I'd reset to "Needs Signoff" as we've added another 3 patches since Martin's original SO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to David Cook from comment #9)
(In reply to Jonathan Druart from comment #7)
Created attachment 162205 [details] [review] [review] Bug 36098: Allow to pass storage_method
Will need this on follow-up bugs.
Could you explain why? I don't see why yet.
On bug 36102, "Use Koha::Session from C4::InstallAuth". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|36102 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34478 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 162314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162314&action=edit Bug 36098: Default to 'file' if pref does not exist During the installer process there is a bunch of warnings "Use of uninitialized value $storage_method in string eq at" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 162314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162314 Bug 36098: Default to 'file' if pref does not exist Review of attachment 162314: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36098&attachment=162314) ----------------------------------------------------------------- ::: Koha/Session.pm @@ +53,4 @@
sub _get_session_params { my ( $class, $args ) = @_; my $storage_method = $args->{storage_method}; + $storage_method ||= C4::Context->preference('SessionStorage') || 'file';
This isn't very human-friendly to read. I think we should either add a comment explaining it, or make it easier to read (which would admittedly be more verbose). Not the end of the world if we leave as is of course. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34755 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34755 [Bug 34755] Error authenticating to external OpenID Connect (OIDC) identity provider : wrong_csrf_token -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #15)
Comment on attachment 162314 [details] [review] Bug 36098: Default to 'file' if pref does not exist
Review of attachment 162314 [details] [review]: -----------------------------------------------------------------
::: Koha/Session.pm @@ +53,4 @@
sub _get_session_params { my ( $class, $args ) = @_; my $storage_method = $args->{storage_method}; + $storage_method ||= C4::Context->preference('SessionStorage') || 'file';
This isn't very human-friendly to read.
Really? This is trivial Perl... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.05.00 released in| | --- Comment #17 from Jonathan Druart <jonathan.druart@gmail.com> --- Pushed to master for 24.05.00. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal --- Comment #18 from David Cook <dcook@prosentient.com.au> --- I'm actually changing this from "enhancement" to "normal" (although maybe it should be more severe), since it's needed to fix bug 34755 which is a bug that was reported around 6 months ago. (It took me a while to reproduce the problem and figure out the root cause, so here we are.) It would be great to get this backported to the stable branches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This applies nicely on 23.11.x and works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.04 released in| | CC| |fridolin.somers@biblibre.co | |m --- Comment #20 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00,23.11.04 |24.05.00,23.11.04,23.05.10 released in| | Status|Pushed to stable |Pushed to oldstable CC| |lucas@bywatersolutions.com --- Comment #21 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |f.demians@tamil.fr --- Comment #22 from David Cook <dcook@prosentient.com.au> --- Hoping we can get this one and bug 34755 into 22.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #23 from Frédéric Demians <f.demians@tamil.fr> --- Backported to 22.11.x for 22.11.16 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00,23.11.04,23.05.10 |24.05.00,23.11.04,23.05.10, released in| |22.11.16 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 --- Comment #24 from David Cook <dcook@prosentient.com.au> --- (In reply to Frédéric Demians from comment #23)
Backported to 22.11.x for 22.11.16
Many thanks :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org Status|Pushed to oldoldstable |Needs documenting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36098 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED CC| |david@davidnind.com --- Comment #25 from David Nind <david@davidnind.com> --- Not covered in the manual - no update required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org