From ec7bc9e37b295b9752bec2ba8c58e127f6e1e410 Mon Sep 17 00:00:00 2001 From: mhucka Date: Fri, 4 Jun 2021 12:17:08 -0700 Subject: [PATCH 1/4] Fix issue #85: remove user info from debug log message --- dibs/server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dibs/server.py b/dibs/server.py index 88eddc7..1576f60 100644 --- a/dibs/server.py +++ b/dibs/server.py @@ -513,13 +513,14 @@ def loan_availability(user, barcode): explanation = '' when_available = None loan = Loan.get_or_none(Loan.user == user, Loan.item == item) + who = anon(user) if loan: if loan.state == 'active': - log(f'{user} already has {barcode} on loan') + log(f'{who} already has {barcode} on loan') status = Status.LOANED_BY_USER explanation = 'This item is currently on digital loan to you.' else: - log(f'{user} had a loan on {barcode} too recently') + log(f'{who} had a loan on {barcode} too recently') status = Status.TOO_SOON explanation = ('Your loan period has ended and it is too soon ' 'after the last time you borrowed it.') @@ -528,7 +529,7 @@ def loan_availability(user, barcode): loan = Loan.get_or_none(Loan.user == user, Loan.state == 'active') if loan: other = loan.item - log(f'{user} has a loan on {other.barcode} that ends at {loan.end_time}') + log(f'{who} has a loan on {other.barcode} that ends at {loan.end_time}') status = Status.USER_HAS_OTHER author = shorten(other.author, width = 50, placeholder = ' …') explanation = ('You have another item currently on loan' @@ -543,7 +544,7 @@ def loan_availability(user, barcode): explanation = 'All available copies are currently on loan.' when_available = min(loan.end_time for loan in loans) else: - log(f'{user} is allowed to borrow {barcode}') + log(f'{who} is allowed to borrow {barcode}') status = Status.AVAILABLE return item, status, explanation, when_available From bd77643b7fc2425c5ab18267d8d912e92df8ce7c Mon Sep 17 00:00:00 2001 From: mhucka Date: Fri, 4 Jun 2021 12:27:21 -0700 Subject: [PATCH 2/4] Summarize latest changes --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e8c73a5..1975b1d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Change log for DIBS +## Version 0.4.1 + +* Fix issue #85: remove email address from server log message printed during status checks + + ## Version 0.4.0 This version implements an interface for starting the IIIF image processing workflow. This is implemented in the `dibs/templates/list.tpl` template file, with an an addition to `settings.ini`. It interacts with the "available" column in the `/list` page. From 0465c9d8f6d24964fec09406765ec8578b8e966e Mon Sep 17 00:00:00 2001 From: mhucka Date: Fri, 4 Jun 2021 12:27:54 -0700 Subject: [PATCH 3/4] Trivial edits --- README.md | 2 +- dibs/roles.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 431cfa0..a59be6e 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ In order to use DIBS at another institution (other than [Caltech](https://www.ca 2. A **web server** to host DIBS. The current version of DIBS has only been tested with Apache2 on Linux (specifically, Ubuntu 20) and macOS (specifically 10.13, High Sierra). DIBS comes with a WSGI adapter file and sample config file for Apache, but it should be possible to run DIBS in other WSGI-compliant servers. 3. An **authentication layer**. For authentication, DIBS assumes that the web server takes care of user authentication in such a way that DIBS is behind the authentication layer and all users who can reach the DIBS pages are allowed to view content. DIBS only implements checks to distinguish between regular users versus staff who are allowed to access restricted pages. For the authentication layer, at Caltech we use the [Shibboleth](https://en.wikipedia.org/wiki/Shibboleth_Single_Sign-on_architecture) single sign-on system, but it is possible to use other schemes. The installation and configuration of a single sign-on system depends on the specifics of a given institution, and are not described here. 4. Modification to the metadata retrieval code. We strove to limit dependencies on external systems, but the interface for staff to add items to DIBS requires looking up some limited metadata based on an item's barcode, and lacking a universal scheme or ILS interface to do that, we had to hard code the access. Thankfully, this is limited to just a few lines in [`server.py`](dibs/server.py). We currently use TIND at Caltech, so unless you also use TIND, you will need to modify the TIND-specific lines in that file. -5. Modification to the HTML templates to change the branding. The template files in [dibs/templates](dibs/templates) are specific to Caltech, and will need to be edited to suit another installation. (We are open to making the branding customization easier and would welcome a [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for suitable changes!) +5. Modification to the HTML templates to change the branding. The template files in [`dibs/templates`](dibs/templates) are specific to Caltech, and will need to be edited to suit another installation. (We are open to making the branding customization easier and would welcome a [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for suitable changes!) ## Installation diff --git a/dibs/roles.py b/dibs/roles.py index fea704f..30122ba 100644 --- a/dibs/roles.py +++ b/dibs/roles.py @@ -25,7 +25,8 @@ def has_role(person, role): def role_to_redirect(role): - '''given a user role (including an empty string) return the target path for a redirect''' + '''Given a user role (including an empty string), return the target + path for a redirect.''' if role in _role_table: return _role_table[role] else: From 0e59b8c7def4ad35d31d15e28320587c8c8412fc Mon Sep 17 00:00:00 2001 From: mhucka Date: Fri, 4 Jun 2021 12:29:33 -0700 Subject: [PATCH 4/4] Update stored version number --- codemeta.json | 2 +- dibs/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codemeta.json b/codemeta.json index 9ec99e6..76be303 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,7 +6,7 @@ "codeRepository": "https://github.com/caltechlibrary/dibs", "issueTracker": "https://github.com/caltechlibrary/dibs/issues", "license": "https://github.com/caltechlibrary/dibs/blob/master/LICENSE", - "version": "0.4.0", + "version": "0.4.1", "author": [ { "@type": "Person", diff --git a/dibs/__init__.py b/dibs/__init__.py index 0b2c4f2..c370080 100644 --- a/dibs/__init__.py +++ b/dibs/__init__.py @@ -22,7 +22,7 @@ # | by the Makefile. Manual changes to these values will be lost. | # ╰────────────────────── Notice ── Notice ── Notice ─────────────────────╯ -__version__ = '0.4.0' +__version__ = '0.4.1' __description__ = 'An implementation of Controlled Digital Lending' __url__ = 'https://github.com/caltechlibrary/dibs' __author__ = 'Michael Hucka, Robert S. Doiel, Tommy Keswick, Stephen Davison'