From 152c01491a6c92308f779e8f42b1cdbc046358f3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 5 Jun 2014 11:40:01 +0200 Subject: [PATCH] zoom: allow hostname to be given for ipauth MP-552 The Torus setting for that is called auth_hostname. --- src/filter_zoom.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 69a25b8..df9fc04 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -219,6 +219,7 @@ namespace metaproxy_1 { std::string torus_content_url; std::string torus_auth_url; std::string default_realm; + std::string torus_auth_hostname; std::map fieldmap; std::string xsldir; std::string file_path; @@ -778,6 +779,8 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only, torus_auth_url = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "realm")) default_realm = mp::xml::get_text(attr->children); + else if (!strcmp((const char *) attr->name, "auth_hostname")) + torus_auth_hostname = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "xsldir")) xsldir = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "element_transform")) @@ -2643,6 +2646,13 @@ void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req, torus_query = "ipRanges encloses/net.ipaddress \""; torus_query += escape_cql_term(std::string(ip)); torus_query += "\""; + + if (m_p->torus_auth_hostname.length()) + { + torus_query += " AND hostName == \""; + torus_query += escape_cql_term(m_p->torus_auth_hostname); + torus_query += "\""; + } failure_code = YAZ_BIB1_INIT_AC_BLOCKED_NETWORK_ADDRESS; } -- 1.7.10.4