From f4068e61d4910a6e24c89f644ec170ae8fccce47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 18 Oct 2024 11:56:47 +0100 Subject: [PATCH] feat: EBSCO passwords are stored as hash --- code/web/sys/DBMaintenance/version_updates/24.11.00.php | 9 +++++++++ code/web/sys/Ebsco/EBSCOhostSetting.php | 4 ++++ code/web/sys/Ebsco/EDSSettings.php | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/code/web/sys/DBMaintenance/version_updates/24.11.00.php b/code/web/sys/DBMaintenance/version_updates/24.11.00.php index 14f0e5e9a3..05246fe354 100644 --- a/code/web/sys/DBMaintenance/version_updates/24.11.00.php +++ b/code/web/sys/DBMaintenance/version_updates/24.11.00.php @@ -50,6 +50,15 @@ function getUpdates24_11_00(): array { //alexander - PTFS-Europe //chloe - PTFS-Europe + 'ebsco_passwords_are_stored_as_hash' => [ + 'title' => 'EBSCO Passwords Are Stored As Hash', + 'description' => 'allow for longer strings so passwords can be stored as hashed values', + 'continueOnError' => false, + 'sql' => [ + "ALTER TABLE ebsco_eds_settings MODIFY COLUMN edsApiPassword VARCHAR(255)", + "ALTER TABLE ebscohost_settings MODIFY COLUMN profilePwd VARCHAR(255)" + ] + ] // ebsco_passwords_are_stored_as_hash //pedro - PTFS-Europe diff --git a/code/web/sys/Ebsco/EBSCOhostSetting.php b/code/web/sys/Ebsco/EBSCOhostSetting.php index aee0fcc9aa..68fe5bfbae 100644 --- a/code/web/sys/Ebsco/EBSCOhostSetting.php +++ b/code/web/sys/Ebsco/EBSCOhostSetting.php @@ -13,6 +13,10 @@ class EBSCOhostSetting extends DataObject { private $_searchSettings; + function getEncryptedFieldNames(): array { + return ['profilePwd']; + } + static function getObjectStructure($context = ''): array { $ebscoHostSearchSettingStructure = EBSCOhostSearchSetting::getObjectStructure($context); diff --git a/code/web/sys/Ebsco/EDSSettings.php b/code/web/sys/Ebsco/EDSSettings.php index ec6d6aa75b..e9354c8b03 100644 --- a/code/web/sys/Ebsco/EDSSettings.php +++ b/code/web/sys/Ebsco/EDSSettings.php @@ -11,6 +11,10 @@ class EDSSettings extends DataObject { public $edsSearchProfile; public $fullTextLimiter; + function getEncryptedFieldNames(): array { + return ['edsApiPassword']; + } + public static function getObjectStructure($context = ''): array { return [ 'id' => [