c2cgeoportal-geoportal 2.9rc19__py3-none-any.whl → 2.9rc24__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.
@@ -33,8 +33,6 @@ from typing import Any, cast
33
33
  import pyramid.request
34
34
  import pyramid.response
35
35
 
36
- from c2cgeoportal_geoportal.lib import is_intranet
37
-
38
36
  _LOG = logging.getLogger(__name__)
39
37
 
40
38
 
@@ -124,6 +122,8 @@ def _set_common_headers(
124
122
  ) -> pyramid.response.Response:
125
123
  """Set the common headers."""
126
124
 
125
+ del request # Unused
126
+
127
127
  response.headers.update(service_headers_settings.get("headers", {}))
128
128
 
129
129
  if cache in (Cache.PRIVATE, Cache.PRIVATE_NO):
@@ -141,10 +141,7 @@ def _set_common_headers(
141
141
  elif cache in (Cache.PUBLIC, Cache.PUBLIC_NO):
142
142
  response.cache_control.public = True
143
143
  elif cache in (Cache.PRIVATE, Cache.PRIVATE_NO):
144
- if hasattr(request, "user") and request.user is not None or is_intranet(request):
145
- response.cache_control.private = True
146
- else:
147
- response.cache_control.public = True
144
+ response.cache_control.private = True
148
145
  else:
149
146
  raise Exception("Invalid cache type") # pylint: disable=broad-exception-raised
150
147
 
@@ -75,7 +75,7 @@ services:
75
75
  - PGOPTIONS
76
76
 
77
77
  mapserver:
78
- image: camptocamp/mapserver:8.0-gdal3.6
78
+ image: camptocamp/mapserver:8.2-gdal3.8
79
79
  user: www-data
80
80
  restart: unless-stopped
81
81
  entrypoint: []
@@ -53,6 +53,12 @@ Information
53
53
  exclude_pages: []
54
54
  ```
55
55
 
56
+ 4. Previously the `Cache-Control` header was set to `public` when we are not authenticated to an endpoint
57
+ that use the authentication. But this didn't works in every cases, for example when we use the intranet
58
+ role and when we have a reverse proxy with cache. Now it's always set to private for all the endpoints
59
+ that use the authentication.
60
+
61
+
56
62
  =============
57
63
  Version 2.8.0
58
64
  =============
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cgeoportal-geoportal
3
- Version: 2.9rc19
3
+ Version: 2.9rc24
4
4
  Summary: c2cgeoportal geoportal
5
5
  Home-page: https://github.com/camptocamp/c2cgeoportal/
6
6
  Author: Camptocamp
@@ -8,7 +8,7 @@ c2cgeoportal_geoportal/lib/cacheversion.py,sha256=8ETNA02fh7AX39pNAkDrEJsCmPXVzY
8
8
  c2cgeoportal_geoportal/lib/caching.py,sha256=BZzIjgEUfv7puP8XvWY6PAni7HybcLMZrGam3D3mCyA,7124
9
9
  c2cgeoportal_geoportal/lib/check_collector.py,sha256=98N43jvjzCOh19Agipf8varCD9S9I9V8XYQcrSujv0k,3396
10
10
  c2cgeoportal_geoportal/lib/checker.py,sha256=QLe0SUzfSwKYQFpGgFecWkJJlVjA1O2phwf-FvQQOUc,12547
11
- c2cgeoportal_geoportal/lib/common_headers.py,sha256=iVm54HUQT81KqXEa3mkzywFbjoAwAG-_oNIkJQjPPHA,6622
11
+ c2cgeoportal_geoportal/lib/common_headers.py,sha256=gPfNJHuLpW-V8qrOC0y3fiLAiUN7PEBnrTpahtofY3Y,6440
12
12
  c2cgeoportal_geoportal/lib/dbreflection.py,sha256=viQotACmEAoLtJYHhQqAtcT3UQUvNVz9P_MlRCKgR9g,9759
13
13
  c2cgeoportal_geoportal/lib/filter_capabilities.py,sha256=nah7A3A_m87M5lSXcw3HRaEnHMCLnXcwTQ3PdoGN4js,14343
14
14
  c2cgeoportal_geoportal/lib/fulltextsearch.py,sha256=DrqO51QbDp56VpZa__2-8vp8U39izvLpyGhRCLTCaYc,2265
@@ -68,7 +68,7 @@ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/Makefile,sha256
68
68
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/README.rst,sha256=QJcaUtT05atb5x8SJYflSt0YIJkbAz0Zh39_FYtyFks,423
69
69
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/build,sha256=CjYe1cIL-TsKPbdxy1zStTUEGguILXpyUC63X2_Cy8c,7010
70
70
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-db.yaml,sha256=sNzJxDQX54WfKgJhhVhDm4a05z3Rz1j6Oocl1QHzeyQ,518
71
- c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml,sha256=VdRZO71CRtmyBzhUXXtwZ1HBpLPT_58BhQUFKKgxkeI,13680
71
+ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-lib.yaml,sha256=nNwk7HpCQduiQNBRqIInMZe5weLNDelc5ItiRBk8WJY,13680
72
72
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose-qgis.yaml,sha256=YE44s31kI79j5ypud4RS69sSDGFH1ROHNNAkyWxZ4jk,576
73
73
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose.override.sample.yaml,sha256=X5vtxQ0pvLy6FSrooVmt90j4C4YNxtkSKzbPDOb4uB8,2615
74
74
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/docker-compose.yaml,sha256=ZpQ33JhdBxkoUNBV9kB5f07p8DpqgvJ3-Mp0SzLnJ6w,2380
@@ -136,7 +136,7 @@ c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/tests/test_app.
136
136
  c2cgeoportal_geoportal/scaffolds/create/{{cookiecutter.project}}/tilegeneration/config.yaml.tmpl,sha256=OK6ZFMlYMx1wcx8leK42LA8p0P56HuEAP8fupuxDI34,6181
137
137
  c2cgeoportal_geoportal/scaffolds/update/cookiecutter.json,sha256=x3FFn3b67GPGCsjg36iGXCudjaTSfwGHcwHS6HHVpPQ,539
138
138
  c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/.upgrade.yaml,sha256=8tPCziX4Wh6a2EOdjpLtvyqNtKcI7Rtjo8-bLQO8_Gg,2741
139
- c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_CHANGELOG.txt,sha256=d7hMAYCXjHb4FvPW2ImfYJwQBiVn8V-BkGxm8ASHl98,10092
139
+ c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_CHANGELOG.txt,sha256=56LcSEuxHm9GByjQWa1xl_9TkPByY-kyMKJIn9XC8b0,10445
140
140
  c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/tests/test_testapp.py,sha256=FNZI6uMsZttVpWi0_TEmBgV6MjQDUmE5ar9be3FFkV8,1794
141
141
  c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/geoportal/CONST_config-schema.yaml,sha256=Q_H2EPrZ5g0rA0Mn7vb2wbpZU82ZtF4PIG760Abqjyw,23458
142
142
  c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/geoportal/CONST_vars.yaml,sha256=3T5I7-k8d0y-OWCrq5HT8AxuFHjTHtOfSyceNfHPdtI,49111
@@ -174,7 +174,7 @@ c2cgeoportal_geoportal/views/tinyowsproxy.py,sha256=ydq3mKFd_KeQ0DG5ct59BlcIY8_2
174
174
  c2cgeoportal_geoportal/views/vector_tiles.py,sha256=t_pZ4l6JpispZFr42EodcDIwAwG2q-MX12yI03w7Y6I,3569
175
175
  tests/__init__.py,sha256=KxmbgvRWDSJoEDH1cXnDIjbfBsgCzs2KdkTPuzYMq84,3826
176
176
  tests/test_cachebuster.py,sha256=asI1X_qI0MGklYuKuWyqvCPVbvhQcUe4fX91Dk-hUsE,2923
177
- tests/test_caching.py,sha256=pqY7j9UyWei4MwP3IuXgrtivoEg1vxC_ORFrl_HRFPM,13126
177
+ tests/test_caching.py,sha256=nQQi_5IgpUNwz_BhFZMF51BaqHGUal5Ks_8TI8QQw_M,13132
178
178
  tests/test_checker.py,sha256=NaU6Ejg9XbwS2cwqXCtz5mJPRdBIPZb3d1MkXVufr0k,3638
179
179
  tests/test_decimaljson.py,sha256=CQrkqWs66kmq1iYur5kjzKhvdhw9b4TMcKEsuVayxA4,2223
180
180
  tests/test_headerstween.py,sha256=3PkfTbsUq2C7fEsckO_4aYu9-XGBSeOgf86ENSqx76o,2524
@@ -185,8 +185,8 @@ tests/test_mapserverproxy_route_predicate.py,sha256=SzILSSzIuilzIkUYVPZiVzLwW1du
185
185
  tests/test_raster.py,sha256=82NJ2MXgZlMqs0ytN-VgNw376iURdk4PkAg__dyh5ns,11948
186
186
  tests/test_wmstparsing.py,sha256=xjA8nJuXFl3H5Bfs4sJw_8qX8E8qvAALK7Hs2-DTP2A,9054
187
187
  tests/xmlstr.py,sha256=rkTKSU4FGjupBKLx75H8o-goB0KbQrxDvdpc6xVX_uQ,5985
188
- c2cgeoportal_geoportal-2.9rc19.dist-info/METADATA,sha256=QhIFVsh64Hi2-X7cgbClsnQbomGgnEhdlZ2Ct7qQ4yY,1886
189
- c2cgeoportal_geoportal-2.9rc19.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
190
- c2cgeoportal_geoportal-2.9rc19.dist-info/entry_points.txt,sha256=3dnX260FsLX_AubeNMdyeta_z1X4CxcD3steAlfPx2I,1414
191
- c2cgeoportal_geoportal-2.9rc19.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
192
- c2cgeoportal_geoportal-2.9rc19.dist-info/RECORD,,
188
+ c2cgeoportal_geoportal-2.9rc24.dist-info/METADATA,sha256=UauIlwQKsh_AJ3S9lWZJ2iaf4rgk5TbK9MKNAPp6Q_Y,1886
189
+ c2cgeoportal_geoportal-2.9rc24.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
190
+ c2cgeoportal_geoportal-2.9rc24.dist-info/entry_points.txt,sha256=3dnX260FsLX_AubeNMdyeta_z1X4CxcD3steAlfPx2I,1414
191
+ c2cgeoportal_geoportal-2.9rc24.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
192
+ c2cgeoportal_geoportal-2.9rc24.dist-info/RECORD,,
tests/test_caching.py CHANGED
@@ -61,7 +61,7 @@ class TestSetCorsHeaders(TestCase):
61
61
  # 1. If the Origin header is not present terminate this set of steps.
62
62
  # The request is outside the scope of this specification.
63
63
  assert self._do("POST", {}) == {
64
- "Cache-Control": "max-age=10, public",
64
+ "Cache-Control": "max-age=10, private",
65
65
  "Content-Length": "0",
66
66
  "Content-Type": "text/html; charset=UTF-8",
67
67
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",
@@ -71,7 +71,7 @@ class TestSetCorsHeaders(TestCase):
71
71
  # any of the values in list of origins, do not set any additional
72
72
  # headers and terminate this set of steps.
73
73
  assert self._do("POST", {"Origin": "http://foe.com"}) == {
74
- "Cache-Control": "max-age=10, public",
74
+ "Cache-Control": "max-age=10, private",
75
75
  "Content-Length": "0",
76
76
  "Content-Type": "text/html; charset=UTF-8",
77
77
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",
@@ -82,7 +82,7 @@ class TestSetCorsHeaders(TestCase):
82
82
  # header as value, and add a single Access-Control-Allow-Credentials
83
83
  # header with the case-sensitive string "true" as value.
84
84
  assert self._do("POST", {"Origin": self.ORIGIN2}, credentials=True) == {
85
- "Cache-Control": "max-age=10, public",
85
+ "Cache-Control": "max-age=10, private",
86
86
  "Content-Length": "0",
87
87
  "Content-Type": "text/html; charset=UTF-8",
88
88
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",
@@ -202,7 +202,7 @@ class TestSetCorsHeaders(TestCase):
202
202
  def test_not_configured(self):
203
203
  # If the service is not configured, then no CORS head.
204
204
  assert self._do("GET", {"Origin": self.ORIGIN1}, settings=None) == {
205
- "Cache-Control": "max-age=10, public",
205
+ "Cache-Control": "max-age=10, private",
206
206
  "Content-Length": "0",
207
207
  "Content-Type": "text/html; charset=UTF-8",
208
208
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",
@@ -217,7 +217,7 @@ class TestSetCorsHeaders(TestCase):
217
217
  # An origin included in the access_control_allow_origin list is OK with
218
218
  # credentials
219
219
  assert self._do("POST", {"Origin": self.ORIGIN1}, credentials=True, settings=settings) == {
220
- "Cache-Control": "max-age=10, public",
220
+ "Cache-Control": "max-age=10, private",
221
221
  "Content-Length": "0",
222
222
  "Content-Type": "text/html; charset=UTF-8",
223
223
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",
@@ -230,7 +230,7 @@ class TestSetCorsHeaders(TestCase):
230
230
  # 3. Otherwise, add a single Access-Control-Allow-Origin header, with
231
231
  # either the value of the Origin header or the string "*" as value.
232
232
  assert self._do("POST", {"Origin": "http://www.guest.com"}, settings=settings) == {
233
- "Cache-Control": "max-age=10, public",
233
+ "Cache-Control": "max-age=10, private",
234
234
  "Content-Length": "0",
235
235
  "Content-Type": "text/html; charset=UTF-8",
236
236
  "Vary": "Origin, Access-Control-Request-Headers, Cookie",