View | Details | Raw Unified | Return to bug 27358
Collapse All | Expand All

(-)a/Koha/REST/V1/Auth.pm (+3 lines)
Lines 148-153 sub authenticate_api_request { Link Here
148
148
149
    my $user;
149
    my $user;
150
150
151
    $c->stash( 'is_public' => 1 )
152
        if $params->{is_public};
153
151
    # The following supports retrieval of spec with Mojolicious::Plugin::OpenAPI@1.17 and later (first one)
154
    # The following supports retrieval of spec with Mojolicious::Plugin::OpenAPI@1.17 and later (first one)
152
    # and older versions (second one).
155
    # and older versions (second one).
153
    # TODO: remove the latter 'openapi.op_spec' if minimum version is bumped to at least 1.17.
156
    # TODO: remove the latter 'openapi.op_spec' if minimum version is bumped to at least 1.17.
(-)a/t/db_dependent/api/v1/auth_authenticate_api_request.t (-2 / +23 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 3;
20
use Test::More tests => 4;
21
use Test::Mojo;
21
use Test::Mojo;
22
22
23
use Module::Load::Conditional qw(can_load);
23
use Module::Load::Conditional qw(can_load);
Lines 192-197 subtest 'anonymous requests to public API' => sub { Link Here
192
    $schema->storage->txn_rollback;
192
    $schema->storage->txn_rollback;
193
};
193
};
194
194
195
subtest 'public routes have "is_public" info stashed' => sub {
196
197
    plan tests => 2;
198
199
    $schema->storage->txn_begin;
200
201
    my $stash;
202
    $t->app->hook(
203
        after_dispatch => sub {
204
            $stash = shift->stash;
205
        }
206
    );
207
208
    $t->get_ok('/api/v1/public/biblios/1');
209
210
    my $is_public = $stash->{is_public};
211
212
    ok( $is_public, 'Correctly stashed the fact it is a public route' );
213
214
    $schema->storage->txn_rollback;
215
};
216
195
sub create_user_and_session {
217
sub create_user_and_session {
196
218
197
    my $args  = shift;
219
    my $args  = shift;
198
- 

Return to bug 27358