Bugzilla – Attachment 124488 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
Bug-28772-Update-existing-keys.patch (text/plain), 1.57 KB, created by
Martin Renvoize (ashimema)
on 2021-09-03 15:17:34 UTC
(
hide
)
Description:
Bug 28772: Update existing keys
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-03 15:17:34 UTC
Size:
1.57 KB
patch
obsolete
>From c1d36f457cb93fa6128c498fdedb609f7f2fa614 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 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../mysql/atomicupdate/bug_28772_api_keys.pl | 32 +++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_28772_api_keys.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_28772_api_keys.pl b/installer/data/mysql/atomicupdate/bug_28772_api_keys.pl >new file mode 100755 >index 0000000000..1e38409018 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28772_api_keys.pl >@@ -0,0 +1,32 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "28772", >+ description => "Store hashed API key secrets", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh) = @$args{qw(dbh)}; >+ >+ 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} ); >+ } >+ }, >+} >-- >2.20.1
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