Bug 23865 - Throw exceptions from Koha::AuthUtils::is_password_valid
Summary: Throw exceptions from Koha::AuthUtils::is_password_valid
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-22 10:28 UTC by Lari Taskula
Modified: 2019-10-22 10:55 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password (2.96 KB, patch)
2019-10-22 10:42 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password (2.99 KB, patch)
2019-10-22 10:43 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2019-10-22 10:28:28 UTC
Exceptions are currently thrown in Koha::Patron->set_password.

We need to validate password (with exceptions) without wanting to set the password.
Comment 1 Lari Taskula 2019-10-22 10:42:37 UTC
Created attachment 94522 [details] [review]
Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password

Exceptions are currently thrown in Koha::Patron->set_password.

We need to validate password (with exceptions) without wanting to set
the password.

To test:
1. Make sure is_valid_password is not used anywhere in codebase apart from
   Koha::Patron::set_password (grep -rn 'is_valid_password')
2. prove t/db_dependent/Koha/Patrons.t
   Observe ok 35 - ->set_password
Comment 2 Lari Taskula 2019-10-22 10:43:01 UTC
Created attachment 94523 [details] [review]
Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password

Exceptions are currently thrown in Koha::Patron->set_password.

We need to validate password (with exceptions) without wanting to set
the password.

To test:
1. Make sure is_valid_password is not used anywhere in codebase apart from
   Koha::Patron::set_password (grep -rn 'is_valid_password')
2. prove t/db_dependent/Koha/Patrons.t
   Observe ok 35 - ->set_password

Sponsored-by: Koha-Suomi Oy
Comment 3 Jonathan Druart 2019-10-22 10:55:20 UTC
It's "is_password_valid", and it is used in other places:

Koha/AuthUtils.pm:        ( $is_valid, undef ) = is_password_valid( $password );
Koha/Patron.pm:        my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $password );
installer/onboarding.pl:        my ( $is_valid, $passworderror) = Koha::AuthUtils::is_password_valid( $firstpassword );
members/memberentry.pl:      my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $password );
opac/opac-memberentry.pl:        my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $borrower->{password} );