Bug 10667

Summary: ILS-DI: AuthenticatePatron should also work with cardnumber
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Web servicesAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: bgkriegel, gmcharlt, mtj, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 10667: Add unit tests for ILSDI::Services::AuthenticatePatron
Bug 10667: Allow authentication with cardnumber for ILS-DI
[SIGNED-OFF] Bug 10667: Add unit tests for ILSDI::Services::AuthenticatePatron
[SIGNED-OFF] Bug 10667: Allow authentication with cardnumber for ILS-DI
Bug 10667: Follow up - prevent t/00-load from failing
[SIGNED-OFF] Bug 10667: Follow up - prevent t/00-load from failing
Bug 10667: Add unit tests for ILSDI::Services::AuthenticatePatron
Bug 10667: Allow authentication with cardnumber for ILS-DI
Bug 10667: Follow up - prevent t/00-load from failing

Description Katrin Fischer 2013-07-31 11:47:52 UTC
.../cgi-bin/koha/ilsdi.pl?service=Describe&verb=AuthenticatePatron

Currently only username + password is supported. Authentication should also be possible with cardnumber + password to match OPAC authentication.
Comment 1 Katrin Fischer 2013-09-08 19:49:16 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2013-09-08 19:49:26 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2013-09-08 21:29:42 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2013-09-08 21:29:52 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2013-09-12 04:55:34 UTC
Hm, I think I have to fail this - it looks like my adding use Auth; to Services.pm breaks the packaging process.
Comment 6 Katrin Fischer 2013-09-12 05:40:58 UTC Comment hidden (obsolete)
Comment 7 Bernardo Gonzalez Kriegel 2013-09-12 11:48:10 UTC Comment hidden (obsolete)
Comment 8 Mason James 2013-09-13 02:12:50 UTC
Created attachment 21064 [details] [review]
Bug 10667: Add unit tests for ILSDI::Services::AuthenticatePatron

This patch adds unit tests for Authenticate patron.

To test:
- Run perl t/db_dependent/ILSDI_Services.t
- Verify all tests pass

Note: there are some tests marked as TODO.

Rewriting AuthenticatePatron to make cardnumber and userid
work for authenticating a patron will be implemented in the
next patch. Tests related to this are currently showing as
'not ok', but are still passing.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors
With both patches applied, all test pass.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 9 Mason James 2013-09-13 02:13:09 UTC
Created attachment 21065 [details] [review]
Bug 10667: Allow authentication with cardnumber for ILS-DI

Test authentication via ILS-DI:
- with userid and password
- with userid and wrong password
- with cardnumber and password
- with cardnumber and wrong password
...

Before the patch only userid will authenticate the patron.
After the patch was applied, userid and cardnumber will work.

To test:
- Run t/db_dependent/ILSDI_Services.t - all tests should pass.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors

Test:
Enable ISL-DI
access opac with /cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=XXX&password=YYY
With userid/cardnumber & password returns borrowernumber
With userid/cardnumber & wrong password returns PatronNotFound
Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 10 Mason James 2013-09-13 02:13:28 UTC
Created attachment 21067 [details] [review]
Bug 10667: Follow up - prevent t/00-load from failing

To test:
- Apply first 2 patches for unit tests and changes to Services.pm
- Turn off mysql
- Run t/00-load.t
- Verify that the test fails.
- Apply this third patch.
- Run t/00-load.t again.
- Verify this time it passes.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work well, no koha-qa errors.

Without third patch and mysql down, test fails,
with third patch it succeed.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 11 Mason James 2013-09-13 02:15:27 UTC
patches pass all ./t/tests and qa-tool
passing QA on 3 patches
Comment 12 Galen Charlton 2013-09-16 19:17:05 UTC
Pushed to master.  Thanks, Katrin!
Comment 13 Tomás Cohen Arazi 2013-11-08 18:29:46 UTC
This patch has been pushed to 3.12.x, will be in 3.12.7.

Thanks Katrin!