[open-ils-commits] [GIT] Evergreen ILS branch master updated. ecb1dcc58ec3e31f689abdf8dce29f54d0fb7b9a

Evergreen Git git at git.evergreen-ils.org
Tue Oct 1 16:31:59 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  ecb1dcc58ec3e31f689abdf8dce29f54d0fb7b9a (commit)
      from  21a80dc6e0bcd74109291f6135b5ef5e5047a67c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ecb1dcc58ec3e31f689abdf8dce29f54d0fb7b9a
Author: Jeff Davis <jeff.davis at bc.libraries.coop>
Date:   Mon May 27 12:03:00 2019 -0700

    LP#1830642: add tests for authenticating users when password contains percent sign
    
    Signed-off-by: Jeff Davis <jeff.davis at bc.libraries.coop>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/live_t/24-lp1710949-login-api.t b/Open-ILS/src/perlmods/live_t/24-lp1710949-login-api.t
index e32ec619c9..600e7de83a 100644
--- a/Open-ILS/src/perlmods/live_t/24-lp1710949-login-api.t
+++ b/Open-ILS/src/perlmods/live_t/24-lp1710949-login-api.t
@@ -1,6 +1,6 @@
 #!perl
 
-use Test::More tests => 22;
+use Test::More tests => 27;
 
 diag("Tests open-ils.auth.login");
 
@@ -8,6 +8,7 @@ use strict; use warnings;
 use OpenILS::Utils::TestUtils;
 use OpenILS::Application::AppUtils;
 use OpenSRF::Utils::Cache;
+use Digest::MD5 qw/md5_hex/;
 our $U = "OpenILS::Application::AppUtils";
 
 OpenILS::Utils::TestUtils->new->bootstrap;
@@ -93,3 +94,67 @@ isnt($resp->{textcode}, 'SUCCESS', '... and consequently multiple failed attempt
 # and clean up
 my $cache = OpenSRF::Utils::Cache->new("global", 0);
 $cache->delete_cache('oils_auth_br1mclark_count');
+
+# test for LP#1830642
+my $new_pwd = 'password%';
+
+my $user = $U->simplereq(
+    'open-ils.actor',
+    'open-ils.actor.user.fleshed.retrieve_by_barcode',
+    $authtoken,
+    '99999381970'
+);
+$user->passwd($new_pwd);
+$resp = $U->simplereq(
+    'open-ils.actor',
+    'open-ils.actor.patron.update',
+    $authtoken,
+    $user
+);
+isa_ok($resp, 'Fieldmapper::actor::user', 'test password updated');
+
+my $seed = $U->simplereq(
+    'open-ils.auth',
+    'open-ils.auth.authenticate.init',
+    'br1mclark'
+);
+ok(defined $seed, 'Got an auth seed');
+
+my $hashed_pwd = md5_hex($seed . md5_hex($new_pwd));
+$resp = $U->simplereq(
+    'open-ils.auth',
+    'open-ils.auth.authenticate.complete',
+    {
+        username => 'br1mclark',
+        password => $hashed_pwd,
+        type => 'staff'
+    }
+);
+is($resp->{textcode}, 'SUCCESS', '.complete succeeds when password contains %');
+
+$resp = $U->simplereq(
+    'open-ils.auth',
+    'open-ils.auth.login', {
+        identifier => 'br1mclark',
+        password => $new_pwd,
+        type => 'staff'
+    }
+);
+is($resp->{textcode}, 'SUCCESS', '.login succeeds when password contains %');
+
+# cleanup
+my $restored_user = $U->simplereq(
+    'open-ils.actor',
+    'open-ils.actor.user.fleshed.retrieve_by_barcode',
+    $authtoken,
+    '99999381970'
+);
+$restored_user->passwd('montyc1234');
+$resp = $U->simplereq(
+    'open-ils.actor',
+    'open-ils.actor.patron.update',
+    $authtoken,
+    $restored_user
+);
+isa_ok($resp, 'Fieldmapper::actor::user', 'test password reverted');
+

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/live_t/24-lp1710949-login-api.t   | 67 +++++++++++++++++++++-
 1 file changed, 66 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list