[Koha-bugs] [Bug 22522] API authentication breaks with updated Mojolicious version

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 12 20:16:25 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22522

--- Comment #77 from Victor Grousset/tuxayo <victor at tuxayo.net> ---
I got a conflict when trying to backport to 19.05. (note the tests pass without
these patches, no API issues on 19.05)

I'm not sure about InstallPlugins, it doesn't exist in 19.05 vs 19.11. So I
don't know how valid that is if I don't use it.

About `Koha::Plugins::Methods->search->delete;` there is also uncertainly.

(note that HEAD means 19.05.x,
parent of 6eef54e940 means 19.11.x before the patch that I'm backporting,
and the last section is the patch that I'm backporting)
<<<<<<< HEAD
    my @plugins = Koha::Plugins->new->GetPlugins( { all => 1 } );
||||||| parent of 6eef54e940... [SIGNED-OFF] Bug 22522: [19.11.x] Add support
for current Mojolicious and related packages
    my $plugins = Koha::Plugins->new;
    $plugins->InstallPlugins;

    my @plugins = $plugins->GetPlugins( { all => 1 } );
=======
    # remove any existing plugins that might interfere
    Koha::Plugins::Methods->search->delete;
    my $plugins = Koha::Plugins->new;
    $plugins->InstallPlugins;

    my @plugins = $plugins->GetPlugins( { all => 1 } );
>>>>>>> 6eef54e940... [SIGNED-OFF] Bug 22522: [19.11.x] Add support for current Mojolicious and related packages


It's only in PluginRoutes.t I could just try and see which tests pass...



Next conflict!
(note that HEAD means 19.05.x,
parent of 095948c43f means 19.11.x before the patch that I'm backporting,
and the last section is the patch that I'm backporting)
t/db_dependent/api/v1/patrons.t
<<<<<<< HEAD
        $tx = $t->ua->build_tx(PUT => "/api/v1/patrons/" . $patron_2->id =>
json => $newpatron);
        $tx->req->cookies({name => 'CGISESSID', value => $session_id});
        $t->request_ok($tx)
          ->status_is(200, 'Patron updated successfully')
          ->json_has($newpatron);
||||||| parent of 095948c43f... [SIGNED-OFF] Bug 22522: [19.11.x] Fix several
REST API tests
        $t->put_ok( "//$userid:$password@/api/v1/patrons/" .
$patron_2->borrowernumber => json => $newpatron )
          ->status_is(200, 'Patron updated successfully')
          ->json_has($newpatron);
=======
        my $result = $t->put_ok( "//$userid:$password@/api/v1/patrons/" .
$patron_2->borrowernumber => json => $newpatron )
          ->status_is(200, 'Patron updated successfully');

        # Put back the RO attributes
        $newpatron->{patron_id} = $unauthorized_patron->to_api->{patron_id};
        $newpatron->{restricted} = $unauthorized_patron->to_api->{restricted};
        $newpatron->{anonymized} = $unauthorized_patron->to_api->{anonymized};
        is_deeply($result->tx->res->json, $newpatron, 'Returned patron from
update matches expected');

>>>>>>> 095948c43f... [SIGNED-OFF] Bug 22522: [19.11.x] Fix several REST API tests

I don't know if 19.11 supports that way to authenticate.
The tests will tell.

Another similar conflict.


Tests: it doesn't work. That was to be expected, that would have been so lucky
to just hammer it like that.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list