5 description => "Store hashed API key secrets",
8 my ($dbh) = @$args{qw(dbh)};
10 use Koha::AuthUtils qw(hash_password);
12 my $sth = $dbh->prepare(q{
13 SELECT client_id, secret
17 my $results = $sth->fetchall_arrayref({});
19 $sth = $dbh->prepare(q{
27 foreach my $api_key (@$results) {
28 unless ( $api_key->{secret} =~ m/^\$2a\$08\$/ ) {
29 my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} );
30 $sth->execute( $digest, $api_key->{client_id} );