Bugzilla – Attachment 124251 Details for
Bug 28772
Any user that can work with reports can see API keys of any other user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28772: Update existing keys [STABLE]
Bug-28772-Update-existing-keys-STABLE.patch (text/plain), 1.38 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-08-30 18:06:19 UTC
(
hide
)
Description:
Bug 28772: Update existing keys [STABLE]
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-08-30 18:06:19 UTC
Size:
1.38 KB
patch
obsolete
>From 5f590d0e3f9cc46b6ede316fe34d7f9752da5ef6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 30 Aug 2021 11:08:30 -0300 >Subject: [PATCH] Bug 28772: Update existing keys [STABLE] > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../atomicupdate/bug_28772_api_keys.perl | 27 +++++++++++++++++++ > 1 file changed, 27 insertions(+) > create 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 >new file mode 100755 >index 0000000000..cb4529a71a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28772_api_keys.perl >@@ -0,0 +1,27 @@ >+$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) { >+ 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.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28772
:
124195
|
124247
|
124248
|
124249
|
124250
|
124251
|
124487
|
124488
|
124489
|
124490
|
124491
|
124691
|
124692
|
124693
|
124694
|
124695
|
124696
|
124697
|
124698
|
124699
|
124700
|
124701
|
124702
|
124703
|
124704
|
124705
|
124727
|
125088
|
125112
|
125116
|
125118
|
125128