From a1112061ad173f83cd271a9a416e911832796879 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 7 Oct 2015 11:10:12 +0200 Subject: [PATCH] Bug 13799: Allow to set Mojolicious secret in $KOHA_CONF --- Koha/REST/V1.pm | 6 ++++++ etc/koha-conf.xml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 375dff5..62f7693 100644 --- a/Koha/REST/V1.pm +++ b/Koha/REST/V1.pm @@ -19,6 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious'; use C4::Auth qw( check_cookie_auth get_session ); +use C4::Context; use Koha::Borrowers; sub startup { @@ -42,6 +43,11 @@ sub startup { # Force charset=utf8 in Content-Type header for JSON responses $self->types->type(json => 'application/json; charset=utf8'); + my $secret_passphrase = C4::Context->config('api_secret_passphrase'); + if ($secret_passphrase) { + $self->secrets([$secret_passphrase]); + } + $self->plugin(Swagger2 => { route => $route, url => $self->home->rel_file("api/v1/swagger.json"), diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 1f2b460..74a5720 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -117,6 +117,9 @@ __PAZPAR2_TOGGLE_XML_POST__ __KOHA_CONF_DIR__/searchengine/queryparser.yaml __KOHA_CONF_DIR__/log4perl.conf + + CHANGEME + /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf -- 1.9.1