Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-MapProxy for openSUSE:Factory checked in at 2021-07-28 19:21:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-MapProxy (Old) and /work/SRC/openSUSE:Factory/.python-MapProxy.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-MapProxy" Wed Jul 28 19:21:38 2021 rev:3 rq:908875 version:1.13.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-MapProxy/python-MapProxy.changes 2021-04-27 21:35:31.624069209 +0200 +++ /work/SRC/openSUSE:Factory/.python-MapProxy.new.1899/python-MapProxy.changes 2021-07-28 19:21:39.687507893 +0200 @@ -1,0 +2,11 @@ +Sat Jul 24 11:30:53 UTC 2021 - Bruno Friedmann <br...@ioda-net.ch> + +- Update to version 1.13.2 + * Hotfix: Fixup demo service (#528). +- Release 1.31.1 + * Improvement: Support cookie management for HTTP sources. + * Security fix for local file disclosure (#526). +- Packaging: + * add skip failing test_geotiff_tags + +------------------------------------------------------------------- Old: ---- MapProxy-1.13.0.tar.gz python-MapProx-rpmlintrc New: ---- MapProxy-1.13.2.tar.gz python-MapProxy-rpmlintrc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-MapProxy.spec ++++++ --- /var/tmp/diff_new_pack.Fl1iAm/_old 2021-07-28 19:21:40.199507221 +0200 +++ /var/tmp/diff_new_pack.Fl1iAm/_new 2021-07-28 19:21:40.203507216 +0200 @@ -21,7 +21,7 @@ %{?!python_module:%define python_module() python3-%{**}} %define pythons python3 Name: python-MapProxy -Version: 1.13.0 +Version: 1.13.2 Release: 0 Summary: Proxy for geospatial data License: Apache-2.0 @@ -30,7 +30,7 @@ Source0: https://files.pythonhosted.org/packages/source/M/MapProxy/MapProxy-%{version}.tar.gz # test file missing in the sdist Source1: https://github.com/mapproxy/mapproxy/raw/%{version}/mapproxy/test/system/fixture/cache.gpkg -Source99: python-MapProx-rpmlintrc +Source99: python-MapProxy-rpmlintrc BuildRequires: %{python_module GDAL} BuildRequires: %{python_module Pillow} BuildRequires: %{python_module PyYAML} @@ -124,6 +124,8 @@ donttest+=" or test_https_" # off by one error capturing the execptions donttest+=" or test_bad_config_geopackage_" +# new geotif and jpeg are bogue +donttest+=" or test_geotiff_tags" %pytest mapproxy -ra -k "not ($donttest)" %files %{python_files} ++++++ MapProxy-1.13.0.tar.gz -> MapProxy-1.13.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/CHANGES.txt new/MapProxy-1.13.2/CHANGES.txt --- old/MapProxy-1.13.0/CHANGES.txt 2020-11-19 10:14:24.000000000 +0100 +++ new/MapProxy-1.13.2/CHANGES.txt 2021-07-14 16:07:42.000000000 +0200 @@ -1,3 +1,24 @@ +Nightly +~~~~~~~~~~~~~~~~~ + +1.13.2 2021-07-14 +~~~~~~~~~~~~~~~~~ + +Fixes: + +- Hotfix: Fixup demo service (#528). + +1.13.1 2021-07-13 +~~~~~~~~~~~~~~~~~ + +Improvements: + +- Support cookie management for HTTP sources. + +Fixes: + +- Security fix for local file disclosure (#526). + 1.13.0 2020-11-18 ~~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/MapProxy.egg-info/PKG-INFO new/MapProxy-1.13.2/MapProxy.egg-info/PKG-INFO --- old/MapProxy-1.13.0/MapProxy.egg-info/PKG-INFO 2020-11-19 10:20:41.000000000 +0100 +++ new/MapProxy-1.13.2/MapProxy.egg-info/PKG-INFO 2021-07-14 16:11:28.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: MapProxy -Version: 1.13.0 +Version: 1.13.2 Summary: An accelerating proxy for tile and web map services Home-page: https://mapproxy.org Author: Oliver Tonnhofer @@ -20,6 +20,27 @@ Changes ------- + Nightly + ~~~~~~~~~~~~~~~~~ + + 1.13.2 2021-07-14 + ~~~~~~~~~~~~~~~~~ + + Fixes: + + - Hotfix: Fixup demo service (#528). + + 1.13.1 2021-07-13 + ~~~~~~~~~~~~~~~~~ + + Improvements: + + - Support cookie management for HTTP sources. + + Fixes: + + - Security fix for local file disclosure (#526). + 1.13.0 2020-11-18 ~~~~~~~~~~~~~~~~~ @@ -125,22 +146,6 @@ the same domain. - 1.10.3 2017-07-07 - ~~~~~~~~~~~~~~~~~ - - Fixes: - - - Fix crash during clipping - - Fix bilinear/bicubic resampling from cropped source - - Fix loading empty coverages - - 1.10.2 2017-06-21 - ~~~~~~~~~~~~~~~~~ - - Fixes: - - - Fix coverage clipping for caches with a single source - Older changes ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/PKG-INFO new/MapProxy-1.13.2/PKG-INFO --- old/MapProxy-1.13.0/PKG-INFO 2020-11-19 10:20:42.000000000 +0100 +++ new/MapProxy-1.13.2/PKG-INFO 2021-07-14 16:11:29.088878400 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: MapProxy -Version: 1.13.0 +Version: 1.13.2 Summary: An accelerating proxy for tile and web map services Home-page: https://mapproxy.org Author: Oliver Tonnhofer @@ -20,6 +20,27 @@ Changes ------- + Nightly + ~~~~~~~~~~~~~~~~~ + + 1.13.2 2021-07-14 + ~~~~~~~~~~~~~~~~~ + + Fixes: + + - Hotfix: Fixup demo service (#528). + + 1.13.1 2021-07-13 + ~~~~~~~~~~~~~~~~~ + + Improvements: + + - Support cookie management for HTTP sources. + + Fixes: + + - Security fix for local file disclosure (#526). + 1.13.0 2020-11-18 ~~~~~~~~~~~~~~~~~ @@ -125,22 +146,6 @@ the same domain. - 1.10.3 2017-07-07 - ~~~~~~~~~~~~~~~~~ - - Fixes: - - - Fix crash during clipping - - Fix bilinear/bicubic resampling from cropped source - - Fix loading empty coverages - - 1.10.2 2017-06-21 - ~~~~~~~~~~~~~~~~~ - - Fixes: - - - Fix coverage clipping for caches with a single source - Older changes ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/doc/conf.py new/MapProxy-1.13.2/doc/conf.py --- old/MapProxy-1.13.0/doc/conf.py 2020-11-19 10:14:24.000000000 +0100 +++ new/MapProxy-1.13.2/doc/conf.py 2021-07-14 16:08:05.000000000 +0200 @@ -51,7 +51,7 @@ # The short X.Y version. version = '1.13' # The full version, including alpha/beta/rc tags. -release = '1.13.0' +release = '1.13.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/doc/configuration.rst new/MapProxy-1.13.2/doc/configuration.rst --- old/MapProxy-1.13.0/doc/configuration.rst 2020-10-06 09:24:59.000000000 +0200 +++ new/MapProxy-1.13.2/doc/configuration.rst 2021-05-21 10:47:37.000000000 +0200 @@ -1024,6 +1024,15 @@ Sets the ``Access-control-allow-origin`` header to HTTP responses for `Cross-origin resource sharing <http://en.wikipedia.org/wiki/Cross-origin_resource_sharing>`_. This header is required for WebGL or Canvas web clients. Defaults to `*`. Leave empty to disable the header. This option is only available in `globals`. +``manage_cookies`` +^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 1.14.0 + +Enables MapProxy cookie management for HTTP sources. When enabled MapProxy will accept and store server cookies. Accepted cookies will be passed +back to the source on subsequent requests. Usefull for sources which require to maintain an HTTP session to work efficiently, maybe in combination +with basic authentication. Depending on your deployment MapProxy will still start multiple sessions (e.g. one per MapProxy process). +Cookie handling is based on Python `CookieJar <https://docs.python.org/3/library/http.cookiejar.html>`_. Disabled by default. ``hide_error_details`` ^^^^^^^^^^^^^^^^^^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/doc/configuration_examples.rst new/MapProxy-1.13.2/doc/configuration_examples.rst --- old/MapProxy-1.13.0/doc/configuration_examples.rst 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/doc/configuration_examples.rst 2021-05-21 10:47:37.000000000 +0200 @@ -667,7 +667,7 @@ - 3000 default: 0 -You can know access this layer with the elevation and time dimensions via the WMTS KVP service. +You can now access this layer with the elevation and time dimensions via the WMTS KVP service. The RESTful service requires a custom URL template that contains the dimensions. For example:: services: @@ -708,6 +708,8 @@ url: https://username:mypassw...@example.org/service? layers: securelayer +.. note:: If the source requires session handling through cookies, have a look at the ``manage_cookies`` configuration option. + .. _http_proxy: Access sources through HTTP proxy @@ -734,11 +736,28 @@ Add a username and password to the URL if your HTTP proxy requires authentication. For example ``http://username:passw...@example.com:3128``. +.. note:: If the source requires session handling through cookies, have a look at the ``manage_cookies`` configuration option. + You can use the ``no_proxy`` environment variable if you need to bypass the proxy for some hosts:: $ export no_proxy="localhost,127.0.0.1,196.168.1.99" +Cookie Management +================= + +MapProxy can handle server cookies of HTTP sources, like browsers do. That is, MapProxy accepts cookies and passes them back +on subsequent calls. This is useful for sources that use cookie for session management or rate-limiting for example:: + + sources: + wms_with_session_management: + type: wms + http: + manage_cookies: True + req: + url: http://example.org/service? + layers: layer0 + .. _paster_urlmap: Serve multiple MapProxy instances diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/doc/sources.rst new/MapProxy-1.13.2/doc/sources.rst --- old/MapProxy-1.13.0/doc/sources.rst 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/doc/sources.rst 2021-05-21 10:47:37.000000000 +0200 @@ -184,6 +184,7 @@ - ``client_timeout`` - ``ssl_ca_certs`` - ``ssl_no_cert_checks`` +- ``manage_cookies`` See :ref:`HTTP Options <http_ssl>` for detailed documentation. @@ -432,6 +433,7 @@ - ``client_timeout`` - ``ssl_ca_certs`` - ``ssl_no_cert_checks`` +- ``manage_cookies`` See :ref:`HTTP Options <http_ssl>` for detailed documentation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/client/http.py new/MapProxy-1.13.2/mapproxy/client/http.py --- old/MapProxy-1.13.0/mapproxy/client/http.py 2020-11-19 10:14:24.000000000 +0100 +++ new/MapProxy-1.13.2/mapproxy/client/http.py 2021-05-21 10:47:37.000000000 +0200 @@ -29,12 +29,15 @@ if PY2: import urllib2 - from urllib2 import URLError, HTTPError + from urllib2 import URLError, HTTPError, HTTPCookieProcessor import httplib + from cookielib import CookieJar else: from urllib import request as urllib2 from urllib.error import URLError, HTTPError + from urllib.request import HTTPCookieProcessor from http import client as httplib + from http.cookiejar import CookieJar import socket import ssl @@ -131,8 +134,8 @@ def __init__(self): self._opener = {} - def __call__(self, ssl_ca_certs, url, username, password, insecure=False): - cache_key = (ssl_ca_certs, insecure) + def __call__(self, ssl_ca_certs, url, username, password, insecure=False, manage_cookies=False): + cache_key = (ssl_ca_certs, insecure, manage_cookies) if cache_key not in self._opener: handlers = [] https_handler = build_https_handler(ssl_ca_certs, insecure) @@ -143,6 +146,9 @@ handlers.append(authhandler) authhandler = urllib2.HTTPDigestAuthHandler(passman) handlers.append(authhandler) + if manage_cookies: + cj = CookieJar() + handlers.append(HTTPCookieProcessor(cj)) opener = urllib2.build_opener(*handlers) @@ -161,7 +167,8 @@ class HTTPClient(object): def __init__(self, url=None, username=None, password=None, insecure=False, - ssl_ca_certs=None, timeout=None, headers=None, hide_error_details=False): + ssl_ca_certs=None, timeout=None, headers=None, hide_error_details=False, + manage_cookies=False): self._timeout = timeout if url and url.startswith('https'): if insecure: @@ -170,7 +177,7 @@ raise HTTPClientError('No ca_certs file set (http.ssl_ca_certs). ' 'Set file or disable verification with http.ssl_no_cert_checks option.') - self.opener = create_url_opener(ssl_ca_certs, url, username, password, insecure=insecure) + self.opener = create_url_opener(ssl_ca_certs, url, username, password, insecure=insecure, manage_cookies=manage_cookies) self.header_list = headers.items() if headers else [] self.hide_error_details = hide_error_details diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/config/defaults.py new/MapProxy-1.13.2/mapproxy/config/defaults.py --- old/MapProxy-1.13.0/mapproxy/config/defaults.py 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/config/defaults.py 2021-05-21 10:47:37.000000000 +0200 @@ -94,4 +94,5 @@ method = 'AUTO', access_control_allow_origin = '*', hide_error_details = True, + manage_cookies = False, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/config/loader.py new/MapProxy-1.13.2/mapproxy/config/loader.py --- old/MapProxy-1.13.0/mapproxy/config/loader.py 2020-10-06 09:24:59.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/config/loader.py 2021-05-21 10:47:37.000000000 +0200 @@ -592,10 +592,12 @@ timeout = self.context.globals.get_value('http.client_timeout', self.conf) headers = self.context.globals.get_value('http.headers', self.conf) hide_error_details = self.context.globals.get_value('http.hide_error_details', self.conf) + manage_cookies = self.context.globals.get_value('http.manage_cookies', self.conf) http_client = HTTPClient(url, username, password, insecure=insecure, ssl_ca_certs=ssl_ca_certs, timeout=timeout, - headers=headers, hide_error_details=hide_error_details) + headers=headers, hide_error_details=hide_error_details, + manage_cookies=manage_cookies) return http_client, url @memoize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/config/spec.py new/MapProxy-1.13.2/mapproxy/config/spec.py --- old/MapProxy-1.13.0/mapproxy/config/spec.py 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/config/spec.py 2021-05-21 10:47:37.000000000 +0200 @@ -75,6 +75,7 @@ 'headers': { anything(): str() }, + 'manage_cookies': bool(), } mapserver_opts = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/config_template/base_config/full_example.yaml new/MapProxy-1.13.2/mapproxy/config_template/base_config/full_example.yaml --- old/MapProxy-1.13.0/mapproxy/config_template/base_config/full_example.yaml 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/config_template/base_config/full_example.yaml 2021-05-21 10:47:37.000000000 +0200 @@ -429,6 +429,21 @@ transparent: true layers: securelayer + # WMS source that requires authentication and session management + # through HTTP cookies + session_source: + type: wms + http: + # Accept session cookies and forward on subsequent requests + manage_cookies: true + # Use basic auth header directly + headers: + Authorization: Basic YWRtaW46Z2Vvc2VydmVy + req: + url: https://my-service.com/service? + transparent: true + layers: securelayer + feature_info_source: type: wms wms_opts: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/config_template/base_config/mapproxy.yaml new/MapProxy-1.13.2/mapproxy/config_template/base_config/mapproxy.yaml --- old/MapProxy-1.13.0/mapproxy/config_template/base_config/mapproxy.yaml 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/config_template/base_config/mapproxy.yaml 2021-05-21 10:47:37.000000000 +0200 @@ -18,7 +18,7 @@ # first tile: http://localhost:8080/tiles/osm/webmercator/0/0/0.png # TMS: # note: TMS is not compatible with OSM/Google Maps/etc. -# fist tile: http://localhost:8080/tms/1.0.0/osm/webmercator/0/0/0.png +# first tile: http://localhost:8080/tms/1.0.0/osm/webmercator/0/0/0.png # KML: # initial doc: http://localhost:8080/kml/osm/webmercator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/service/demo.py new/MapProxy-1.13.2/mapproxy/service/demo.py --- old/MapProxy-1.13.0/mapproxy/service/demo.py 2020-11-19 10:14:24.000000000 +0100 +++ new/MapProxy-1.13.2/mapproxy/service/demo.py 2021-07-14 16:05:55.000000000 +0200 @@ -68,6 +68,8 @@ def handle(self, req): if req.path.startswith('/demo/static/'): + if '..' in req.path: + return Response('file not found', content_type='text/plain', status=404) filename = req.path.lstrip('/') filename = static_filename(filename) if not os.path.isfile(filename): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/test/system/fixture/layer.yaml new/MapProxy-1.13.2/mapproxy/test/system/fixture/layer.yaml --- old/MapProxy-1.13.0/mapproxy/test/system/fixture/layer.yaml 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/test/system/fixture/layer.yaml 2021-05-21 10:47:37.000000000 +0200 @@ -126,6 +126,9 @@ - name: watermark_cache title: TMS Cache + watermark sources: [watermark_cache] + - name: wms_managed_cookies_cache + title: WMS with cookies management + sources: [wms_managed_cookies] caches: wms_cache: @@ -164,6 +167,8 @@ disable_storage: true watermark: text: '@ Omniscale' + wms_managed_cookies_cache: + sources: [wms_managed_cookies] sources: direct: @@ -244,3 +249,12 @@ coverage: bbox: [-180,-90,170,80] srs: 'EPSG:4326' + wms_managed_cookies: + type: wms + wms_opts: + featureinfo: True + req: + url: http://localhost:42423/service + layers: layer1 + http: + manage_cookies: True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/test/system/test_wms.py new/MapProxy-1.13.2/mapproxy/test/system/test_wms.py --- old/MapProxy-1.13.0/mapproxy/test/system/test_wms.py 2020-10-06 09:24:59.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/test/system/test_wms.py 2021-05-21 10:47:37.000000000 +0200 @@ -195,6 +195,7 @@ "wms_cache_link_single", "wms_cache_110", "watermark_cache", + "wms_managed_cookies_cache", ] ) assert layer_names == expected_names @@ -902,6 +903,7 @@ "wms_cache_link_single", "wms_cache_110", "watermark_cache", + "wms_managed_cookies_cache", ] ) assert layer_names == expected_names @@ -1056,6 +1058,41 @@ assert "tms_cache is not queryable" in xml.xpath("//ServiceException/text()")[0] assert validate_with_dtd(xml, "wms/1.1.0/exception_1_1_0.dtd") + def test_managed_cookies(self, app): + def assert_no_cookie(req_handler): + return 'Cookie' not in req_handler.headers + + def assert_cookie(req_handler): + assert 'Cookie' in req_handler.headers + cookie_name, cookie_val = req_handler.headers['Cookie'].split(';')[0].split('=') + assert cookie_name == 'testcookie' + assert cookie_val == '42' + return True + + url = (r"/service?LAYERs=layer1&SERVICE=WMS&FORMAT=image%2Fpng" + "&REQUEST=GetFeatureInfo&HEIGHT=200&SRS=EPSG%3A900913" + "&VERSION=1.1.1&BBOX=1000.0,400.0,2000.0,1400.0&styles=" + "&WIDTH=200&QUERY_LAYERS=layer1&X=10&Y=20") + # First response has a Set-Cookie => with managed_cookies=True, mapproxy should send the + # cookie in the second request + expected_requests = [ + ( + {'path': url, 'req_assert_function': assert_no_cookie}, + {'body': b'nothing', 'headers': {'Set-Cookie': "testcookie=42"}} + ), + ( + {'path': url, 'req_assert_function': assert_cookie}, + {'body': b'nothing'} + ) + ] + with mock_httpd(("localhost", 42423), expected_requests): + self.common_fi_req.params["layers"] = "wms_managed_cookies_cache" + self.common_fi_req.params["query_layers"] = "wms_managed_cookies_cache" + resp = app.get(self.common_fi_req) + assert resp.body == b"nothing" + resp = app.get(self.common_fi_req) + assert resp.body == b"nothing" + class TestWMS100(SysTest): config_file = "layer.yaml" @@ -1119,6 +1156,7 @@ "wms_cache_link_single", "wms_cache_110", "watermark_cache", + "wms_managed_cookies_cache", ] ) assert layer_names == expected_names @@ -1334,6 +1372,7 @@ "wms_cache_link_single", "wms_cache_110", "watermark_cache", + "wms_managed_cookies_cache", ] ) assert layer_names == expected_names diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/mapproxy/test/unit/test_client.py new/MapProxy-1.13.2/mapproxy/test/unit/test_client.py --- old/MapProxy-1.13.0/mapproxy/test/unit/test_client.py 2020-05-27 13:37:56.000000000 +0200 +++ new/MapProxy-1.13.2/mapproxy/test/unit/test_client.py 2021-05-21 10:47:37.000000000 +0200 @@ -185,6 +185,60 @@ assert 0.1 <= duration1 < 0.5, duration1 assert 0.5 <= duration2 < 0.9, duration2 + def test_manage_cookies_off(self): + """ + Test the behavior when manage_cookies is off (the default). Cookies shouldn't be sent + """ + self.client = HTTPClient() + + def assert_no_cookie(req_handler): + return 'Cookie' not in req_handler.headers + + test_requests = [ + ( + {'path': '/', 'req_assert_function': assert_no_cookie}, + {'body': b'nothing', 'headers': {'Set-Cookie': "testcookie=42"}} + ), + ( + {'path': '/', 'req_assert_function': assert_no_cookie}, + {'body': b'nothing'} + ) + ] + with mock_httpd(TESTSERVER_ADDRESS, test_requests): + self.client.open(TESTSERVER_URL + '/') + self.client.open(TESTSERVER_URL + '/') + + def test_manage_cookies_on(self): + """ + Test behavior of manage_cookies=True. Once the remote server sends a cookie back, it should + be included in future requests + """ + self.client = HTTPClient(manage_cookies=True) + + def assert_no_cookie(req_handler): + return 'Cookie' not in req_handler.headers + + def assert_cookie(req_handler): + assert 'Cookie' in req_handler.headers + cookie_name, cookie_val = req_handler.headers['Cookie'].split(';')[0].split('=') + assert cookie_name == 'testcookie' + assert cookie_val == '42' + return True + + test_requests = [ + ( + {'path': '/', 'req_assert_function': assert_no_cookie}, + {'body': b'nothing', 'headers': {'Set-Cookie': "testcookie=42"}} + ), + ( + {'path': '/', 'req_assert_function': assert_cookie}, + {'body': b'nothing'} + ) + ] + with mock_httpd(TESTSERVER_ADDRESS, test_requests): + self.client.open(TESTSERVER_URL + '/') + self.client.open(TESTSERVER_URL + '/') + # root certificates for google.com, if no ca-certificates.cert # file is found diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MapProxy-1.13.0/setup.py new/MapProxy-1.13.2/setup.py --- old/MapProxy-1.13.0/setup.py 2020-11-19 10:14:24.000000000 +0100 +++ new/MapProxy-1.13.2/setup.py 2021-07-14 16:07:51.000000000 +0200 @@ -54,7 +54,7 @@ setup( name='MapProxy', - version="1.13.0", + version="1.13.2", description='An accelerating proxy for tile and web map services', long_description=long_description(7), author='Oliver Tonnhofer', ++++++ python-MapProxy-rpmlintrc ++++++ # empty css file addFilter("zero-length.*framedCloud.css") # noarch package loads the library but no binary links addFilter("explicit-lib-dependency libgeos_c1")