LP1889628 SIP patron username logging config option Adds an option to oils_sip.xml which allows admins to activate (or not) the login-via-username SIP support. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP 1889628: Use Workstation in SIP Username Lookup Following a suggestion from Bill Erickson, the SIP->get_ou_settings() function now uses the workstation org. unit of the logged in SIP2 account if it is set. The home_ou is used as a fallback. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Bill Erickson <berickxx@gmail.com>
LP 1889628: SIP2 Patron Username Lookup Allow SIP2 clients to pass the username or barcode in the SIP2 Patron Identifier field (AA). This is useful for services, such as Overdrive, that can send a patron's username. It is easier for a patron to remember their username rather than barcode, and this unifies login for those patrons who use their username to login to the OPAC. To make this possible, we modify the OpenILS::SIP::Patron->new method to accept a usrname key to retrieve patrons by usrname. We also modify the OpenILS::SIP->find_patron method to accept a usrname key to look up patrons. The find_partron method is further modified to check the patron id against the opac.barcode.regex in more or less the same manner as the OPAC. Two helper functions are added to OpenILS::SIP: 1. get_ou_setting: to retrieve org unit settings using the home_ou of the logged in SIP2 account. 2. get_barcode_regex: To retrieve and cache the opac.barcode_regex setting. Testing this requires a working SIP2 installation and a knowledge of the SIP protocols. The easiest thing is to install the patch and see if your SIP client can recognize a patron who has a username different from their barcode by using both their barcode and then their username. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Bill Erickson <berickxx@gmail.com>
LP#1552778: copy some date/time utils from OpenSRF As preparation for subsequent bugfixes, this patch copies several date/time routines from OpenSRF::Utils to a new module, OpenILS::Utils::DateTime. Specifically, the routines copied over are: * clean_ISO8601() (renaming of the OpenSRF cleanse_ISO8601) * gmtime_ISO8601() * interval_to_seconds() * seconds_to_interval() This move will allow us to fix bugs in this core routines without requiring a mandatory OpenSRF upgrade. Furthermore, with the exception of interval_to_seconds() (and in only one place), none of those routines are used by OpenSRF itself. To test ------- [1] Apply the patch. [2] Verify that unit tests pass. [3] Verify that all Perl services start correctly. [4] Verify that date/time and interval calculations continue to work as expected, particularly in circulation. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP 1542495: Remove OpenILS::SIP::clean_text. This commit removes the OpenILS::SIP::clean_text utility function and all references to it in the OpenILS::SIP modules. Its job is now done in SIPServer's write_msg routine. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Martha Driscoll <driscoll@noblenet.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1646638 - Fix SIP timeouts due to invalid sessions Signed-off-by: Dan Scott <dscott@laurentian.ca> Signed-off-by: Chris Sharp <csharp@georgialibraries.org> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP1259196: Use Location as Workstation on Login When using a SIPServer with LP1579144 applied, use the Location (CP) field of the Login (93) message as a workstation name. This allows you to determine which selfcheck performed which circulation. Signed-off-by: Jason Boyer <jboyer@library.in.gov> Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#1516757: ensure that SIP2 returns DOB correctly Parse dates of birth using the local timezone to ensure that the date in the database will match what is sent to SIP clients. Otherwise, the date will be parsed as UTC and may result in the DoB value being offset by one day in the SIP response. To test ------- [1] Fire up a SIP client of some sort and retrieve a patron record; verify that the patron's date of birth is correct, and not offset by one day. Signed-off-by: Bill Erickson <berickxx@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1356576 repair sip date_format config typo Avoids "Use of uninitialized value in bitwise or (|)" error. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Ben Shum <bshum@biblio.org>
LP#1339190: Have Evergreen save authtoken state to support IO::Multiplex mode Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1339190: support disconnection for SIP multiplex purposes This patch adds a disconnect method to close the OpenSRF connect; this method is invoked only when the Net::Server::Multiplex personality is in use. Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1348731: have SIP gateway use a login nonce Since multiple SIP clients may use the same credentials, avoid the same-username race condition to authentication by applying a login nonce value. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIP hold cancellation support Implement a subset of SIP message pair 15/16 for holds cancellation. 1. New oils_sip.xml configuration option "msg64_hold_datatype". This is similar to msg64_summary_datatype, but affacts holds instead of circulations. When set to 'barcode', holds information will be delivered as a set of copy barcodes instead of title strings for patron info requests. With barcodes, SIP clients can both find the title strings for display (via item info requests) and make subseqent hold-related action requests, like holds cancellation. -- Copies are not an ideal identifier for holds, but SIP has a limited vocabulary. With copies we can (99% of the time) work to and from hold requests to find a reasonable data set to work on. If a patron has multiple holds for the same item and wants to cancel a specific one of those holds, the user should use the catalog instead of SIP. -- 2. When receiving a message 15 of with a cancellation action, find the newest open hold that matches the provided copy barcode and cancel the hold. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIP RenewAll Adds SIP plugin support for SIP message types 65/66 (Renew All). When requested, the plugin performs a renewal on all items currently checked out for the user. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIP re-login fetches correct auth session After a login session expires and the SIP server logs in again to acquire a new authtoken, be sure to use the new authtoken when fetching the new session object. Otherwise, the login_session is left undef and you may see errors like this when checking in items: Can't call method "ws_ou" on an undefined value at /usr/local/share/perl/5.10.1/OpenILS/SIP/Transaction/Checkin.pm line 77. Incidentally, the checkin code is the only code that references $sip_handler->{login_session}. And the problem listed above only occurs when the login session expires just prior to a checkin call. In any other scenario, the login_session would ultimately get repaired. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Fix failing SIP unit test Per LP# 1099595, just copy the constant inline instead of requiring the SIPServer code to be installed on every instance where you don't want 'make check' to fail. (Skipping the test in the absence of the SIPServer code would be another option, but then you're skipping the test, and for the sake of 1 constant, that seems like a bad trade.) Signed-off-by: Dan Scott <dan@coffeecode.net> Signed-off-by: Mike Rylander <mrylander@gmail.com>
SIP option to use SIP date format for due dates New SIP configuration option "use_sip_date_format" which forces all SIP dates to be formated using the SIP date format: YYYYMMDDZZZZHHMMSS Without this setting, most dates already correctly use the SIP date format. However, for some historical reason, due dates are formatted as ISO 8601 dates. Enable this setting to force due dates to use the SIP date format. Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Fix up whitespace in a couple of SIP modules Signed-off-by: Dan Scott <dscott@laurentian.ca>
Pass authtoken to OpenILS::SIP::Patron objects To support retrieval of billing details, OpenILS::SIP::Patron objects need an auth token. Teach OpenILS::SIP->find_patron to pass patron objects an auth token, and also move existing "find patron by what key: barcode or database id?" logic into find_patron (and out of OpenILS::SIP::Patron->new). Signed-off-by: Jeff Godin <jgodin@tadl.org> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org> Signed-off-by: Dan Scott <dscott@laurentian.ca>
Support SIP payment type 02 - credit card Record SIP payments with payment type 02 as credit_card_payment in Evergreen. Signed-off-by: Jeff Godin <jgodin@tadl.org> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>