From 82d6494dc283cf70c16dc85c38545385d5eccb31 Mon Sep 17 00:00:00 2001 From: Wainui Witika-Park Date: Mon, 20 Sep 2021 09:02:26 +0000 Subject: [PATCH] Revert "Bug 28772: Update existing keys [STABLE]" This reverts commit e5c4127e8e42e71a25f20cf228eda821505a95fd. --- .../atomicupdate/bug_28772_api_keys.perl | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_28772_api_keys.perl diff --git a/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl b/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl deleted file mode 100755 index 6265944586..0000000000 --- a/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl +++ /dev/null @@ -1,29 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - - use Koha::AuthUtils qw(hash_password); - - my $sth = $dbh->prepare(q{ - SELECT client_id, secret - FROM api_keys - }); - $sth->execute; - my $results = $sth->fetchall_arrayref({}); - - $sth = $dbh->prepare(q{ - UPDATE api_keys - SET - secret = ? - WHERE - client_id = ? - }); - - foreach my $api_key (@$results) { - unless ( $api_key->{secret} =~ m/^\$2a\$08\$/ ) { - my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} ); - $sth->execute( $digest, $api_key->{client_id} ); - } - } - - NewVersion( $DBversion, 28772, "Store hashed API key secrets" ); -} -- 2.39.5