c2cgeoportal-geoportal 2.8.1.149__py2.py3-none-any.whl → 2.8.1.154__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2023, Camptocamp SA
1
+ # Copyright (c) 2011-2024, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -142,11 +142,12 @@ def get_setting(settings: Any, path: Iterable[str], default: Any = None) -> Any:
142
142
 
143
143
 
144
144
  @CACHE_REGION_OBJ.cache_on_arguments() # type: ignore
145
- def get_ogc_server_wms_url_ids(request: pyramid.request.Request) -> Dict[str, List[int]]:
145
+ def get_ogc_server_wms_url_ids(request: pyramid.request.Request, host: str) -> Dict[str, List[int]]:
146
146
  """Get the OGCServer ids mapped on the WMS URL."""
147
147
  from c2cgeoportal_commons.models import DBSession # pylint: disable=import-outside-toplevel
148
148
  from c2cgeoportal_commons.models.main import OGCServer # pylint: disable=import-outside-toplevel
149
149
 
150
+ del host # used for cache
150
151
  errors: Set[str] = set()
151
152
  servers: Dict[str, List[int]] = {}
152
153
  for ogc_server in DBSession.query(OGCServer).all():
@@ -157,11 +158,12 @@ def get_ogc_server_wms_url_ids(request: pyramid.request.Request) -> Dict[str, Li
157
158
 
158
159
 
159
160
  @CACHE_REGION_OBJ.cache_on_arguments() # type: ignore
160
- def get_ogc_server_wfs_url_ids(request: pyramid.request.Request) -> Dict[str, List[int]]:
161
+ def get_ogc_server_wfs_url_ids(request: pyramid.request.Request, host: str) -> Dict[str, List[int]]:
161
162
  """Get the OGCServer ids mapped on the WFS URL."""
162
163
  from c2cgeoportal_commons.models import DBSession # pylint: disable=import-outside-toplevel
163
164
  from c2cgeoportal_commons.models.main import OGCServer # pylint: disable=import-outside-toplevel
164
165
 
166
+ del host # used for cache
165
167
  errors: Set[str] = set()
166
168
  servers: Dict[str, List[int]] = {}
167
169
  for ogc_server in DBSession.query(OGCServer).all():
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014-2023, Camptocamp SA
1
+ # Copyright (c) 2014-2024, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -113,7 +113,9 @@ def filter_capabilities(
113
113
  wms_structure_ = wms_structure(url, headers.get("Host"), request)
114
114
 
115
115
  ogc_server_ids = (
116
- get_ogc_server_wms_url_ids(request) if wms else get_ogc_server_wfs_url_ids(request)
116
+ get_ogc_server_wms_url_ids(request, request.host)
117
+ if wms
118
+ else get_ogc_server_wfs_url_ids(request, request.host)
117
119
  ).get(url.url())
118
120
  gmf_private_layers = copy.copy(get_private_layers(ogc_server_ids))
119
121
  for id_ in list(get_protected_layers(request, ogc_server_ids).keys()):
@@ -151,7 +153,7 @@ def filter_wfst_capabilities(content: str, wfs_url: Url, request: pyramid.reques
151
153
  """Filter the WTS capabilities."""
152
154
 
153
155
  writable_layers: Set[str] = set()
154
- ogc_server_ids = get_ogc_server_wfs_url_ids(request).get(wfs_url.url())
156
+ ogc_server_ids = get_ogc_server_wfs_url_ids(request, request.host).get(wfs_url.url())
155
157
  if ogc_server_ids is None:
156
158
  LOG.error("No OGC server found for WFS URL %s", wfs_url)
157
159
  raise pyramid.httpexceptions.HTTPInternalServerError("No OGC server found for WFS URL")
@@ -61,7 +61,7 @@ acceptance-init: ## Initialize the acceptance tests
61
61
  docker-compose exec -T tools wait-db
62
62
  docker-compose exec -T tools psql --command="DROP EXTENSION IF EXISTS postgis CASCADE"
63
63
  scripts/db-restore --docker-compose-file=docker-compose.yaml --docker-compose-file=docker-compose-db.yaml \
64
- --arg=--clean --arg=--if-exists --arg=--verbose $(DUMP_FILE)
64
+ --arg=--clean --arg=--if-exists --arg=--verbose $(DUMP_FILE) || true
65
65
  docker-compose --file=docker-compose.yaml --file=docker-compose-db.yaml up -d
66
66
 
67
67
  .PHONY: acceptance
@@ -1 +1 @@
1
- c2cciutils[checks,publish]==1.4.20
1
+ c2cciutils[checks,publish]==1.4.21
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2023, Camptocamp SA
1
+ # Copyright (c) 2011-2024, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2023, Camptocamp SA
1
+ # Copyright (c) 2011-2024, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@ class PrintProxy(Proxy):
64
64
  query_string = urllib.parse.urlencode(params)
65
65
 
66
66
  resp, content = self._capabilities(
67
- templates, query_string, self.request.method, self.request.referrer
67
+ templates, query_string, self.request.method, self.request.referrer, self.request.host
68
68
  )
69
69
 
70
70
  response = self._build_response(resp, content, Cache.PRIVATE, "print")
@@ -74,12 +74,14 @@ class PrintProxy(Proxy):
74
74
 
75
75
  @CACHE_REGION.cache_on_arguments() # type: ignore
76
76
  def _capabilities(
77
- self, templates: List[str], query_string: Dict[str, str], method: str, referrer: str
77
+ self, templates: List[str], query_string: Dict[str, str], method: str, referrer: str, host: str
78
78
  ) -> Tuple[requests.Response, str]:
79
79
  del query_string # Just for caching
80
80
  del method # Just for caching
81
81
  del referrer # Just for caching
82
- # get URL
82
+ del host # Just for caching
83
+
84
+ # Get URL
83
85
  _url = self.request.get_organization_print_url() + "/capabilities.json"
84
86
 
85
87
  response = self._proxy(Url(_url))
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2023, Camptocamp SA
1
+ # Copyright (c) 2011-2024, Camptocamp SA
2
2
  # All rights reserved.
3
3
 
4
4
  # Redistribution and use in source and binary forms, with or without
@@ -173,9 +173,10 @@ class Proxy:
173
173
  return response
174
174
 
175
175
  @CACHE_REGION.cache_on_arguments() # type: ignore
176
- def _proxy_cache(self, method: str, *args: Any, **kwargs: Any) -> pyramid.response.Response:
176
+ def _proxy_cache(self, host: str, method: str, *args: Any, **kwargs: Any) -> pyramid.response.Response:
177
177
  # Method is only for the cache
178
- del method
178
+ del host, method
179
+
179
180
  kwargs["cache"] = True
180
181
  return self._proxy(*args, **kwargs)
181
182
 
@@ -191,7 +192,7 @@ class Proxy:
191
192
  headers_update = {}
192
193
  cache = kwargs.get("cache", False)
193
194
  if cache is True:
194
- response = self._proxy_cache(url, self.request.method, **kwargs)
195
+ response = self._proxy_cache(url, self.request.host, self.request.method, **kwargs)
195
196
  else:
196
197
  response = self._proxy(url, **kwargs)
197
198
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cgeoportal-geoportal
3
- Version: 2.8.1.149
3
+ Version: 2.8.1.154
4
4
  Summary: c2cgeoportal geoportal
5
5
  Home-page: https://github.com/camptocamp/c2cgeoportal/
6
6
  Author: Camptocamp
@@ -1,7 +1,7 @@
1
1
  c2cgeoportal_geoportal/__init__.py,sha256=5VP1yGHCIrIMcsZAppi3mnj9sQPlKS4hpxWa4P5qHLY,32818
2
2
  c2cgeoportal_geoportal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  c2cgeoportal_geoportal/resources.py,sha256=6CMHJveA-nDBNHBO0MudHCu2tn0AdKXmLKrTv8Ulz08,2182
4
- c2cgeoportal_geoportal/lib/__init__.py,sha256=r4ecRV6b-wsub_QV-l4cfW3aqfho2uAEGaHgm5P-X94,10290
4
+ c2cgeoportal_geoportal/lib/__init__.py,sha256=d0Z_99AxtbdZAtSUT8iOpRg5_ZV0lnERmkamri5x6TM,10374
5
5
  c2cgeoportal_geoportal/lib/authentication.py,sha256=5P4NWcmTDiZgSKvUbidzSHax-6ufwrIER2NBR7aP1UE,8911
6
6
  c2cgeoportal_geoportal/lib/bashcolor.py,sha256=LQgOgtFUvgJ4Ed3-YW3RPjvhBMZBbXBBkUZKE4unRCI,1889
7
7
  c2cgeoportal_geoportal/lib/cacheversion.py,sha256=M_0Ci0HPQASkcHbnvG33G9SOsFdRMKSHUP5G5Yt1yvI,2948
@@ -10,7 +10,7 @@ c2cgeoportal_geoportal/lib/check_collector.py,sha256=-x5iFUMw0NfPalG1RI6WoKTiW1B
10
10
  c2cgeoportal_geoportal/lib/checker.py,sha256=RdcGWUjDHowaxl5OZGM5uNrG-K5v4P5BtnfANJO3lfY,12549
11
11
  c2cgeoportal_geoportal/lib/common_headers.py,sha256=xVHJw8ihumvUG2TcIPv11E2MevoAMDmz6-k3nC6nU-0,6500
12
12
  c2cgeoportal_geoportal/lib/dbreflection.py,sha256=TL5xovttqEKkkjKTgOaS1IRtrUp4pY1H8l8XIjC8l_g,9638
13
- c2cgeoportal_geoportal/lib/filter_capabilities.py,sha256=E3WJ_xa12llOe9qEh2JNvHEd7N4hFD2lIduBvFZkqlM,14376
13
+ c2cgeoportal_geoportal/lib/filter_capabilities.py,sha256=JVx0nBWDdLMCfd0GwG7AdE4tb26DEuimkP87XEEQbXg,14434
14
14
  c2cgeoportal_geoportal/lib/fulltextsearch.py,sha256=6mUdf4EydFiI7gjx2vmcc4yyRRFs4cH3gg_XdBePAww,2271
15
15
  c2cgeoportal_geoportal/lib/functionality.py,sha256=DqqLx3dwBY7QxpQgcDGh8NuxE1-sWVuSPk5k3bNE2bM,6293
16
16
  c2cgeoportal_geoportal/lib/headers.py,sha256=d6lelDs1fDh5xO8Dz34r-TRgSETY2bb1eEIDuk6FJHM,2622
@@ -63,7 +63,7 @@ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/.gitignore,sha2
63
63
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/.prettierignore,sha256=PcDfauWwzv1pnJgC9HR1zvv06Q01CwzGzzc0iLSNcZk,9
64
64
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/.prettierrc.yaml,sha256=WbjZCtw0hBlDB2FYJanFJzAvUsNTxgwn62YBZ-Xbwkw,43
65
65
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/Dockerfile,sha256=zJzSNMMy78GdhegVkwEj0jSIU-r_bu9i0_e9-c25MU0,3194
66
- c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/Makefile,sha256=pundFNNNv1t9NRCADjBINz4NIwPGKk_zHU6Zflpvlmg,3079
66
+ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/Makefile,sha256=uypJUSISjWZ74-j38d2-45ld7SsfFfAGzHsqythL6mY,3087
67
67
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/README.rst,sha256=PvydIFv4NS8CMqmLrCTm2TvIS0GNkWgiI-VwQvWBF5o,423
68
68
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/build,sha256=QPDeazuKeoh0POcQPInNkubIGjq7tpDx9xV-hW35D5c,7331
69
69
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-db.yaml,sha256=JE5fBz3d3kYoBeUbCDvbKYNhu8QOzD0KLDeJD8AKMZI,534
@@ -83,7 +83,7 @@ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/.github/workflo
83
83
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/.github/workflows/update_l10n.yaml,sha256=AQZvF8Jc-R6IQtMXOsKlTj6CcCgqY-Y3CvlXy4HNDGQ,2335
84
84
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/ci/config.yaml,sha256=wYdG43pQEqgOvrNQQdENe5vnD7Y1wbXt4G2N43l4b5A,485
85
85
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/ci/docker-compose-check,sha256=7lnVTaaoUrC5MPGpwH2IWbzYc2KaeQMWguahsoY9Rf8,615
86
- c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/ci/requirements.txt,sha256=9AxiMj8ZW6opyn3qBRF0wnXzGqu2xx9hVikRGR4FEV8,35
86
+ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/ci/requirements.txt,sha256=HtayxIhr_FBCf2wz0nTt6QOH_nLhs1quNvhKyBFpBkI,35
87
87
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/vars.yaml,sha256=fj2cC59FhAQeE7TDSpX0ZNY-XOksOolt3r7bRknisio,11635
88
88
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/locale/en/LC_MESSAGES/{{cookiecutter.package}}_geoportal-client.po,sha256=hKLs5f7EJz05ACRtyTlCtssCo99PMuj-FfOJXchMZFk,162
89
89
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/geoportal/{{cookiecutter.package}}_geoportal/static/robot.txt.tmpl,sha256=JR_vIqMlHq1oSgyWPN2mtZyEpsqhjKQQecaW2pxvK54,88
@@ -158,13 +158,13 @@ c2cgeoportal_geoportal/views/geometry_processing.py,sha256=LpzAR6RgGS9XfsGLmNqD3
158
158
  c2cgeoportal_geoportal/views/i18n.py,sha256=7Avpt-aVEVlS3SrwtZkvuJ8_0gBZvVrCviyaIZBx7jY,5292
159
159
  c2cgeoportal_geoportal/views/layers.py,sha256=obRfvJE_IhqT0oQdyjv1Lce_KZVb8GWDrkpMZNYqZH0,28773
160
160
  c2cgeoportal_geoportal/views/login.py,sha256=H4BCgOrhlbx34g5J1Sx8SdpoEoRCyL6PFRv19du_Vdo,21302
161
- c2cgeoportal_geoportal/views/mapserverproxy.py,sha256=LZRr86YerMJElSkQvfBX2aBMCoAdVyOPoFu3WzfaaeE,8167
161
+ c2cgeoportal_geoportal/views/mapserverproxy.py,sha256=b4c0-uuoBk8YVccpQ_6UVVqUzenrV-2edfBE0Q4c9Bw,8167
162
162
  c2cgeoportal_geoportal/views/memory.py,sha256=nb2repOnil0PdziEjCLOZ-84LFKLkdAlKTnnMQoXDdA,3627
163
163
  c2cgeoportal_geoportal/views/ogcproxy.py,sha256=xnbrLpB8ZZSU-P1_aM_9LZeFr7GJzbePB05Ls6tluTU,5231
164
164
  c2cgeoportal_geoportal/views/pdfreport.py,sha256=jRXOZxNwB2uMsFFNaUOb3Axc1W_ZW00mQ9EYRoENppE,9595
165
- c2cgeoportal_geoportal/views/printproxy.py,sha256=0BzC6yFSg7vC_V21QKg1fArA9c0-JFl6-Kig9p-iZ9g,5909
165
+ c2cgeoportal_geoportal/views/printproxy.py,sha256=rsNXmZ1IBv9rXaCrCVRcc9cWkHOa3rX9NJgNFDNIp4A,5977
166
166
  c2cgeoportal_geoportal/views/profile.py,sha256=WOjnkLcL3nakQG0t2Zj6M0FWyG3T874nn7MXaa1Dl18,5394
167
- c2cgeoportal_geoportal/views/proxy.py,sha256=r61TJd-GuSsGkzS98snO8owU3cDxbYnksL9-ux9bK7I,10421
167
+ c2cgeoportal_geoportal/views/proxy.py,sha256=dQ5Xot1R4FKH-zkGPei5mKUzYqguYztrgo1v93qJ1_k,10458
168
168
  c2cgeoportal_geoportal/views/raster.py,sha256=zdwXumFZZNx1Gxlqy_s_6Cm8l50vN6CUMkXYHsbWIdI,7567
169
169
  c2cgeoportal_geoportal/views/resourceproxy.py,sha256=Wxzb0HkWQtL5JZmbNFfTP9-m83vKImsURGIotC3qbXc,3181
170
170
  c2cgeoportal_geoportal/views/shortener.py,sha256=EP2geo-9hfce0ZQ6kzwpwnOb3ruGY2KwxBDtepJKYQI,6205
@@ -184,8 +184,8 @@ tests/test_mapserverproxy_route_predicate.py,sha256=SzILSSzIuilzIkUYVPZiVzLwW1du
184
184
  tests/test_raster.py,sha256=82NJ2MXgZlMqs0ytN-VgNw376iURdk4PkAg__dyh5ns,11948
185
185
  tests/test_wmstparsing.py,sha256=xjA8nJuXFl3H5Bfs4sJw_8qX8E8qvAALK7Hs2-DTP2A,9054
186
186
  tests/xmlstr.py,sha256=rkTKSU4FGjupBKLx75H8o-goB0KbQrxDvdpc6xVX_uQ,5985
187
- c2cgeoportal_geoportal-2.8.1.149.dist-info/METADATA,sha256=VnBsfX1swPlUkJtbGXFNW5uRrXImwNyGForQrgA7-4Q,2172
188
- c2cgeoportal_geoportal-2.8.1.149.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
189
- c2cgeoportal_geoportal-2.8.1.149.dist-info/entry_points.txt,sha256=w0xGr1Bo8q5GBFiP4JgqbSIg-bNhG7bsGoEaGSTfzaE,1415
190
- c2cgeoportal_geoportal-2.8.1.149.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
191
- c2cgeoportal_geoportal-2.8.1.149.dist-info/RECORD,,
187
+ c2cgeoportal_geoportal-2.8.1.154.dist-info/METADATA,sha256=PGqSFzSW1nj1izdIPeGDCTGpkVqW_NneoW99Mpicy60,2172
188
+ c2cgeoportal_geoportal-2.8.1.154.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
189
+ c2cgeoportal_geoportal-2.8.1.154.dist-info/entry_points.txt,sha256=w0xGr1Bo8q5GBFiP4JgqbSIg-bNhG7bsGoEaGSTfzaE,1415
190
+ c2cgeoportal_geoportal-2.8.1.154.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
191
+ c2cgeoportal_geoportal-2.8.1.154.dist-info/RECORD,,