X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ffilter_zoom.cpp;h=df9fc04a96c2adba99c81e6cb893070b036f7e7b;hb=152c01491a6c92308f779e8f42b1cdbc046358f3;hp=69a25b8c72ade837067f84f05eda74dd254f0a08;hpb=fb9b7ab9580c0a33b6ec51d509dbb24b571b6f5d;p=metaproxy-moved-to-github.git 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; }