Bugzilla – Attachment 133583 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: Adjust Selenium test
Bug-28998-Adjust-Selenium-test.patch (text/plain), 2.81 KB, created by
Martin Renvoize (ashimema)
on 2022-04-21 16:01:29 UTC
(
hide
)
Description:
Bug 28998: Adjust Selenium test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-04-21 16:01:29 UTC
Size:
2.81 KB
patch
obsolete
>From 16d95b6ce104fb4f82bec815979456d4d8978bbb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 10 Sep 2021 11:27:33 +0200 >Subject: [PATCH] Bug 28998: Adjust Selenium test > >Test plan: >Run t/db_dependent/selenium/authentication_2fa.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/selenium/authentication_2fa.t | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/selenium/authentication_2fa.t b/t/db_dependent/selenium/authentication_2fa.t >index ebc0c7f991..6fc42228e7 100755 >--- a/t/db_dependent/selenium/authentication_2fa.t >+++ b/t/db_dependent/selenium/authentication_2fa.t >@@ -21,6 +21,7 @@ use Test::More tests => 2; > use C4::Context; > use Koha::AuthUtils; > use Koha::Auth::TwoFactorAuth; >+use Koha::Encryption; > use t::lib::Mocks; > use t::lib::Selenium; > use t::lib::TestBuilder; >@@ -80,7 +81,7 @@ SKIP: { > $s->submit_form; > is( $driver->find_element('//div[@class="two-factor-status"]')->get_text(), 'Status: Enabled', '2FA is enabled' ); > $patron = $patron->get_from_storage; >- is( $patron->secret, $secret32, 'secret is set in DB' ); >+ is( Koha::Encryption->new->decrypt_hex($patron->secret), $secret32, 'encrypted secret is set in DB' ); > > }; > >@@ -89,6 +90,7 @@ SKIP: { > > my $mainpage = $s->base_url . q|mainpage.pl|; > >+ my $secret32 = Koha::Encryption->new->decrypt_hex($patron->secret); > { # ok first try > $driver->get($mainpage . q|?logout.x=1|); > $driver->get($s->base_url . q|circ/circulation.pl?borrowernumber=|.$patron->borrowernumber); >@@ -98,7 +100,8 @@ SKIP: { > like( $driver->get_title, qr(Two-factor authentication), 'Must be on the second auth screen' ); > is( login_error($s), undef ); > >- my $auth = Koha::Auth::TwoFactorAuth->new({patron => $patron}); >+ my $auth = Koha::Auth::TwoFactorAuth->new( >+ { patron => $patron, secret32 => $secret32 } ); > my $code = $auth->code(); > $auth->clear; > $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys($code); >@@ -139,7 +142,8 @@ SKIP: { > $driver->find_element('//input[@type="submit"]')->click; > ok($driver->find_element('//div[@class="dialog error"][contains(text(), "Invalid two-factor code")]')); > >- my $auth = Koha::Auth::TwoFactorAuth->new({patron => $patron}); >+ my $auth = Koha::Auth::TwoFactorAuth->new( >+ { patron => $patron, secret32 => $secret32 } ); > my $code = $auth->code(); > $auth->clear; > $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys($code); >-- >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