[Bug 41383] New: SIP2 server does not search patrons by unique patron attributes (alternate IDs unusable in SIP2)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Bug ID: 41383 Summary: SIP2 server does not search patrons by unique patron attributes (alternate IDs unusable in SIP2) Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: saiful@semanticconsulting.com QA Contact: testopia@bugs.koha-community.org Even when a patron attribute is marked as "Unique identifier," the SIP2 server cannot find patrons using that attribute value. SIP2 lookup is hard-coded to cardnumber/userid and does not consider extended attributes, even when it is unique. Actual Result: SIP2 returns "|AFInvalid cardnumber" when the SIP client sends a value stored in a unique patron attribute. Expected Result: SIP2 should be able to search by any patron attribute marked as a unique identifier. Impact: - Self-check machines using HID/NFC values fail - Access control systems relying on alternate IDs cannot authenticate patrons I plan to submit a patch that will allow unique extended patron attributes to be used in SIP2 requests. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 --- Comment #1 from Saiful Amin <saiful@semanticconsulting.com> --- Created attachment 190311 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190311&action=edit Bug 41383: Allow patron identification by custom unique attributes in find_by_identifier Currently, Koha::Patrons->find_by_identifier only searches for patrons by userid and cardnumber. This patch extends this method to also search by unique borrower attributes (where unique_id=1). This enhancement allows modules like SIP2 to identify patrons using alternative unique identifiers defined in the system. Test Plan: 1. Apply the patch. 2. Run the tests: prove t/db_dependent/Koha/Patrons.t - Verify that all tests pass, including the new cases for unique attribute lookup. 3. Functional Verification: - Define a new patron attribute type with 'unique_id' set to 1. - Assign a value to a patron for this attribute. - Use a tool (like the SIP2 emulator) that utilizes Koha::Patrons->find_by_identifier to search for the patron using this attribute value. e.g., perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information - Verify the patron is found. - Try with a non-unique attribute (unique_id=0) and verify the patron is NOT found. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Saiful Amin <saiful@semanticconsulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Saiful Amin <saiful@semanticconsulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |saiful@semanticconsulting.c |ity.org |om -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Saiful Amin <saiful@semanticconsulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P1 - high -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Saiful Amin <saiful@semanticconsulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190311|0 |1 is obsolete| | --- Comment #2 from Saiful Amin <saiful@semanticconsulting.com> --- Created attachment 194439 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194439&action=edit Bug 41383 - SIP2 server does not search patrons by unique patron attributes (alternate IDs unusable in SIP2) Currently, Koha::Patrons->find_by_identifier only searches for patrons by userid and cardnumber. This patch extends this method to also search by unique borrower attributes (where unique_id=1). This enhancement allows modules like SIP2 to identify patrons using alternative unique identifiers defined in the system. Test Plan: 1. Test current behaviour: - Go to Administration -> Patron attribute types - Create a new Patron attribute with: - Patron attribute type code = "AltID" - Description = "Alternate ID" - Unique identifier checkbox selected - Save - Edit any patron record and go to Additional attributes and identifiers - Add a value "altid123" to "Alternate ID" - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 2. Apply the patch. 3. Run the tests: prove t/db_dependent/Koha/Patrons.t - Verify that all tests pass, including the new cases for unique attribute lookup. 4. Test with patch applied: - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is found with this message: 'AFGreetings from Koha.' e.g.: READ: 64 00120260304 104328000000000000000000000000AOCPL|AA23529001000463|AEEdna Acosta|BLY|BHUSD|BV0|CC5|BD7896 Library Rd. Portland, OR 44240|BF(212) 555-1212|PB19800424|PCPT|PIY|AFGreetings from Koha. | 5. Test non-unique attribute: - Go to Administration -> Patron attribute types - Edit "Alternate ID" attribute type - Unique identifier checkbox NOT selected - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 6. Sign-off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Faheemuddin Syed <faheem@nexuslib.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |faheem@nexuslib.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Faheemuddin Syed <faheem@nexuslib.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Faheemuddin Syed <faheem@nexuslib.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194439|0 |1 is obsolete| | --- Comment #3 from Faheemuddin Syed <faheem@nexuslib.com> --- Created attachment 194497 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194497&action=edit Bug 41383 - SIP2 server does not search patrons by unique patron attributes (alternate IDs unusable in SIP2) Currently, Koha::Patrons->find_by_identifier only searches for patrons by userid and cardnumber. This patch extends this method to also search by unique borrower attributes (where unique_id=1). This enhancement allows modules like SIP2 to identify patrons using alternative unique identifiers defined in the system. Test Plan: 1. Test current behaviour: - Go to Administration -> Patron attribute types - Create a new Patron attribute with: - Patron attribute type code = "AltID" - Description = "Alternate ID" - Unique identifier checkbox selected - Save - Edit any patron record and go to Additional attributes and identifiers - Add a value "altid123" to "Alternate ID" - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 2. Apply the patch. 3. Run the tests: prove t/db_dependent/Koha/Patrons.t - Verify that all tests pass, including the new cases for unique attribute lookup. 4. Test with patch applied: - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is found with this message: 'AFGreetings from Koha.' e.g.: READ: 64 00120260304 104328000000000000000000000000AOCPL|AA23529001000463|AEEdna Acosta|BLY|BHUSD|BV0|CC5|BD7896 Library Rd. Portland, OR 44240|BF(212) 555-1212|PB19800424|PCPT|PIY|AFGreetings from Koha. | 5. Test non-unique attribute: - Go to Administration -> Patron attribute types - Edit "Alternate ID" attribute type - Unique identifier checkbox NOT selected - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 6. Sign-off Signed-off-by: Syed Faheemuddin <faheem@nexuslib.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 --- Comment #4 from Faheemuddin Syed <faheem@nexuslib.com> ---
2. Apply the patch.
Just a note here: The SIP2 services need to be restarted for the patch to take effect. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Sponsorship status|--- |Unsponsored Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194497|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 194930 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194930&action=edit Bug 41383: SIP2 server does not search patrons by unique patron attributes (alternate IDs unusable in SIP2) Currently, Koha::Patrons->find_by_identifier only searches for patrons by userid and cardnumber. This patch extends this method to also search by unique borrower attributes (where unique_id=1). This enhancement allows modules like SIP2 to identify patrons using alternative unique identifiers defined in the system. Test Plan: 1. Test current behaviour: - Go to Administration -> Patron attribute types - Create a new Patron attribute with: - Patron attribute type code = "AltID" - Description = "Alternate ID" - Unique identifier checkbox selected - Save - Edit any patron record and go to Additional attributes and identifiers - Add a value "altid123" to "Alternate ID" - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 2. Apply the patch. 3. Run the tests: prove t/db_dependent/Koha/Patrons.t - Verify that all tests pass, including the new cases for unique attribute lookup. 4. Test with patch applied: - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is found with this message: 'AFGreetings from Koha.' e.g.: READ: 64 00120260304 104328000000000000000000000000AOCPL|AA23529001000463|AEEdna Acosta|BLY|BHUSD|BV0|CC5|BD7896 Library Rd. Portland, OR 44240|BF(212) 555-1212|PB19800424|PCPT|PIY|AFGreetings from Koha. | 5. Test non-unique attribute: - Go to Administration -> Patron attribute types - Edit "Alternate ID" attribute type - Unique identifier checkbox NOT selected - Save - Use any SIP2 client to search for the patron using this attribute value. e.g., `perl misc/sip_cli_emulator.pl -su term1 -sp term1 -l CPL --host localhost --patron altid123 -m patron_information` - Verify that the patron is NOT found with this message: 'AFInvalid cardnumber' e.g.: READ: 64YYYY 00120260304 104611000000000000000000000000AOCPL|AAaltid123|AE|BLN|AFInvalid cardnumber| 6. Sign-off Signed-off-by: Syed Faheemuddin <faheem@nexuslib.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 --- Comment #7 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41383 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #8 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Enhancement - not backporting to 25.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org