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

(-)a/installer/data/mysql/atomicupdate/bug_25045.perl (+15 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    # Default to the homologous OpacPublic syspref
5
    my $opac_public = C4::Context->preference('OpacPublic') ? 1 : 0;
6
7
    $dbh->do(qq{
8
        INSERT IGNORE INTO `systempreferences`
9
            (`variable`,`value`,`explanation`,`options`,`type`)
10
        VALUES
11
            ('RESTPublicAnonymousRequests', $opac_public, NULL,'If enabled, the API will allow anonymous access to public routes that don\'t require authenticated access'.','YesNo');
12
    });
13
14
    NewVersion( $DBversion, 25045, "Add a way to restrict anonymous access to public routes (OpacPublic behaviour)");
15
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 543-548 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
543
('RESTBasicAuth','0',NULL,'If enabled, Basic authentication is enabled for the REST API.','YesNo'),
543
('RESTBasicAuth','0',NULL,'If enabled, Basic authentication is enabled for the REST API.','YesNo'),
544
('RESTdefaultPageSize','20','','Default page size for endpoints listing objects','Integer'),
544
('RESTdefaultPageSize','20','','Default page size for endpoints listing objects','Integer'),
545
('RESTOAuth2ClientCredentials','0',NULL,'If enabled, the OAuth2 client credentials flow is enabled for the REST API.','YesNo'),
545
('RESTOAuth2ClientCredentials','0',NULL,'If enabled, the OAuth2 client credentials flow is enabled for the REST API.','YesNo'),
546
('RESTPublicAnonymousRequests','1',NULL,'If enabled, the API will allow anonymous access to public routes that don\'t require authenticated access'.','YesNo'),
546
('RESTPublicAPI','1',NULL,'If enabled, the REST API will expose the /public endpoints.','YesNo'),
547
('RESTPublicAPI','1',NULL,'If enabled, the REST API will expose the /public endpoints.','YesNo'),
547
('RestrictedPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: "127.0.0,127.0.2")','Free'),
548
('RestrictedPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: "127.0.0,127.0.2")','Free'),
548
('RestrictedPageContent','',NULL,'HTML content of the restricted page','TextArea'),
549
('RestrictedPageContent','',NULL,'HTML content of the restricted page','TextArea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref (-1 / +6 lines)
Lines 23-28 Web services: Link Here
23
                  yes: Enable
23
                  yes: Enable
24
                  no: "Disable"
24
                  no: "Disable"
25
            - "the OAuth2 client credentials grant for the REST API. Requires Net::OAuth2::AuthorizationServer installed. [EXPERIMENTAL]"
25
            - "the OAuth2 client credentials grant for the REST API. Requires Net::OAuth2::AuthorizationServer installed. [EXPERIMENTAL]"
26
        -
27
            - pref: RESTPublicAnonymousRequests
28
              choices:
29
                yes: "Enable"
30
                no: "Disable"
31
            - anonymous access to public routes (that don't require authenticated access)
26
        -
32
        -
27
            - pref: RESTPublicAPI
33
            - pref: RESTPublicAPI
28
              choices:
34
              choices:
29
- 

Return to bug 25045