Bugzilla – Attachment 134671 Details for
Bug 28998
Encrypt borrowers.secret
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28998: (follow-up) Adjust the Auth.t fix
Bug-28998-follow-up-Adjust-the-Autht-fix.patch (text/plain), 2.66 KB, created by
Marcel de Rooy
on 2022-05-06 06:36:03 UTC
(
hide
)
Description:
Bug 28998: (follow-up) Adjust the Auth.t fix
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-05-06 06:36:03 UTC
Size:
2.66 KB
patch
obsolete
>From 378b09df80b865896cd867b1a3d2a3dc403a2247 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 6 May 2022 06:32:51 +0000 >Subject: [PATCH] Bug 28998: (follow-up) Adjust the Auth.t fix >Content-Type: text/plain; charset=utf-8 > >Move the encode_secret call where we need it (when pref is enabled >and patron switches to 2FA). >Mock the koha-conf encryption_key. >Disable 2FA when exiting subtest. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Auth.t | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 46ad64ecff..46aa156b1d 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -151,9 +151,7 @@ subtest 'checkauth() tests' => sub { > } > > t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 ); >- $patron->encode_secret('one_secret'); >- $patron->auth_method('password'); >- $patron->store; >+ $patron->auth_method('password')->store; > ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'intranet' ); > is( $userid, $patron->userid, 'Succesful login' ); > is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), undef, 'Second auth not required' ); >@@ -166,13 +164,16 @@ subtest 'checkauth() tests' => sub { > logout($cgi); > > t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 1 ); >+ t::lib::Mocks::mock_config('encryption_key', '1234tH1s=t&st'); > $patron->auth_method('password')->store; > ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'intranet' ); > is( $userid, $patron->userid, 'Succesful login' ); > is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), undef, 'Second auth not required' ); > logout($cgi); > >- $patron->auth_method('two-factor')->store; >+ $patron->encode_secret('one_secret'); >+ $patron->auth_method('two-factor'); >+ $patron->store; > ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'intranet' ); > is( $userid, $patron->userid, 'Succesful login' ); > my $session = C4::Auth::get_session($sessionID); >@@ -192,6 +193,7 @@ subtest 'checkauth() tests' => sub { > is( $userid, $patron->userid, 'Succesful login' ); > is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), 0, 'Second auth no longer required if OTP token has been verified' ); > >+ t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 ); > }; > > C4::Context->_new_userenv; # For next tests >-- >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 28998
:
124772
|
124773
|
124774
|
133291
|
133317
|
133318
|
133319
|
133320
|
133321
|
133322
|
133323
|
133523
|
133524
|
133525
|
133526
|
133527
|
133528
|
133529
|
133580
|
133581
|
133582
|
133583
|
133584
|
133585
|
133586
|
133588
|
133619
|
133620
|
133621
|
133622
|
133623
|
133624
|
133625
|
133626
|
133627
|
133628
|
133629
|
133631
|
133632
|
133633
|
133634
|
133635
|
133636
|
133637
|
133638
|
133639
|
133640
|
133641
|
133642
|
133645
|
133646
|
133647
|
133648
|
133649
|
133650
|
133651
|
133652
|
133653
|
133654
|
133655
|
134636
|
134637
| 134671