From: Adam Dickmeiss Date: Thu, 5 Jun 2014 09:40:01 +0000 (+0200) Subject: zoom: allow hostname to be given for ipauth MP-552 X-Git-Tag: v1.5.5~2 X-Git-Url: http://git.indexdata.com/?p=metaproxy-moved-to-github.git;a=commitdiff_plain;h=152c01491a6c92308f779e8f42b1cdbc046358f3 zoom: allow hostname to be given for ipauth MP-552 The Torus setting for that is called auth_hostname. --- 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; }