From: Adam Dickmeiss Date: Mon, 23 Sep 2013 08:41:40 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz X-Git-Tag: v4.2.69~18 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=00ec8caa79fb66584067d81d5807d53547ed833b;hp=fd2bef01ba028252d1ca18d07c6c27545b12d425 Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz --- diff --git a/IDMETA b/IDMETA index a660ff1..5c47833 100755 --- a/IDMETA +++ b/IDMETA @@ -1,4 +1,4 @@ DEBIAN_DIST="wheezy squeeze" UBUNTU_DIST="quantal precise oneiric lucid" CENTOS_DIST="centos5 centos6" -VERSION=4.2.67 +VERSION=4.2.68 diff --git a/NEWS b/NEWS index f67c855..c403130 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +--- 4.2.68 2013/09/23 + +GFS: pass additionalSearchInfo to search memeber search_input if +given. Otherwise pass otherInfo. Request for facets and other search +related things will be passed there in future versions of YAZ. + +New ZOOM setting, authenticationMode, which allows authentication +paramters to be encoded in the URL rather than via HTTP Basic auth. +YAZ-686 + +rpn2solr: fix nested AND/OR handling. YAZ-685 + +Add comparison routines for some Z-types, such as NamePlusRecord, +RPNQuery, Query, RecordComposition and OtherInformation. + --- 4.2.67 2013/09/19 Don't decode MAB as MARC. Just like we don't attempt to decode diff --git a/debian/changelog b/debian/changelog index f068c81..2e1b3e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yaz (4.2.68-1indexdata) unstable; urgency=low + + * Upstream. + + -- Adam Dickmeiss Mon, 23 Sep 2013 10:10:59 +0200 + yaz (4.2.67-1indexdata) unstable; urgency=low * Upstram. diff --git a/debian/rules b/debian/rules index d3fbd36..5ebb002 100755 --- a/debian/rules +++ b/debian/rules @@ -95,7 +95,7 @@ binary-arch: build install dh_fixperms # dh_perl # dh_python - dh_makeshlibs -V 'libyaz4 (>= 4.2.67)' + dh_makeshlibs -V 'libyaz4 (>= 4.2.68)' dh_installdeb dh_shlibdeps -l debian/libyaz4/usr/lib dh_gencontrol diff --git a/doc/zoom.xml b/doc/zoom.xml index 930d979..1261c4e 100644 --- a/doc/zoom.xml +++ b/doc/zoom.xml @@ -190,6 +190,9 @@ ZOOM_options_set_int(opt, name, value) passwordAuthentication password. none + authenticationModeHow authentication is encoded. + basic + hostTarget host. This setting is "read-only". It's automatically set internally when connecting to a target. none @@ -390,9 +393,9 @@ ZOOM_options_set_int(opt, name, value) SRU/Solr Protocol behavior - The HTTP based protocols (SRU, SRW, Solr) doesn't feature an Inititialize Request, so - the connection phase merely establishes a TCP/IP connection - with the SOAP service. + The HTTP based protocols (SRU, SRW, Solr) doesn't feature an + Inititialize Request, so the connection phase merely establishes a + TCP/IP connection with the HTTP server. Most of the ZOOM connection options do not affect SRU/Solr and they are ignored. However, future versions @@ -403,6 +406,19 @@ ZOOM_options_set_int(opt, name, value) The charset is used in the Content-Type header of HTTP requests. + + Setting authentcationMode specifies how + authentication parameters are encoded for HTTP. The default is + "basic" where user and + password are encoded by using HTTP basic + authentication. + + + If authentcationMode is "url", then + user and password are encoded in the URL by parameters + x-username and x-password as + given by the SRU standard. + Queries diff --git a/src/srwutil.c b/src/srwutil.c index 38ee0d0..178d886 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -1101,6 +1101,9 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args) Z_SRW_extra_arg **ea = &sr->extra_args; yaz_uri_to_array(extra_args, odr, &name, &val); + /** append rather than override */ + while (*ea) + ea = &(*ea)->next; while (*name) { *ea = (Z_SRW_extra_arg *) odr_malloc(odr, sizeof(**ea)); diff --git a/src/zoom-c.c b/src/zoom-c.c index 03e6fe3..5f52d7c 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -287,6 +287,7 @@ ZOOM_API(ZOOM_connection) c->user = 0; c->group = 0; c->password = 0; + c->url_authentication = 0; c->maximum_record_size = 0; c->preferred_message_size = 0; @@ -525,10 +526,15 @@ ZOOM_API(void) val = ZOOM_options_get(c->options, "password"); if (!val) val = ZOOM_options_get(c->options, "pass"); - if (val && *val) c->password = xstrdup(val); + val = ZOOM_options_get(c->options, "authenticationMode"); + if (val && !strcmp(val, "url")) + c->url_authentication = 1; + else + c->url_authentication = 0; + c->maximum_record_size = ZOOM_options_get_int(c->options, "maximumRecordSize", 64*1024*1024); c->preferred_message_size = diff --git a/src/zoom-p.h b/src/zoom-p.h index 0f53b04..3be4591 100644 --- a/src/zoom-p.h +++ b/src/zoom-p.h @@ -91,6 +91,7 @@ struct ZOOM_connection_p { char *user; char *group; char *password; + int url_authentication; int async; int support_named_resultsets; diff --git a/src/zoom-sru.c b/src/zoom-sru.c index b829738..0776057 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -62,8 +62,29 @@ static zoom_ret send_srw(ZOOM_connection c, Z_SRW_PDU *sr) static Z_SRW_PDU *ZOOM_srw_get_pdu(ZOOM_connection c, int type) { Z_SRW_PDU *sr = yaz_srw_get_pdu(c->odr_out, type, c->sru_version); - sr->username = c->user; - sr->password = c->password; + if (c->url_authentication && c->user) + { + Z_SRW_extra_arg **ea = &sr->extra_args; + while (*ea) + ea = &(*ea)->next; + *ea = (Z_SRW_extra_arg *) odr_malloc(c->odr_out, sizeof(**ea)); + (*ea)->name = "x-username"; + (*ea)->value = c->user; + ea = &(*ea)->next; + if (c->password) + { + *ea = (Z_SRW_extra_arg *) odr_malloc(c->odr_out, sizeof(**ea)); + (*ea)->name = "x-password"; + (*ea)->value = c->password; + ea = &(*ea)->next; + } + *ea = 0; + } + else + { + sr->username = c->user; + sr->password = c->password; + } return sr; } #endif