c2cgeoportal-geoportal 2.8.1.149__py2.py3-none-any.whl → 2.8.1.151__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.
- c2cgeoportal_geoportal/lib/__init__.py +5 -3
- c2cgeoportal_geoportal/lib/filter_capabilities.py +5 -3
- c2cgeoportal_geoportal/views/mapserverproxy.py +1 -1
- c2cgeoportal_geoportal/views/printproxy.py +6 -4
- c2cgeoportal_geoportal/views/proxy.py +5 -4
- {c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/METADATA +1 -1
- {c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/RECORD +10 -10
- {c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/WHEEL +0 -0
- {c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/entry_points.txt +0 -0
- {c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2011-
|
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-
|
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
|
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")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2011-
|
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
|
-
#
|
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-
|
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
|
|
{c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/RECORD
RENAMED
@@ -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=
|
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=
|
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
|
@@ -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=
|
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=
|
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=
|
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.
|
188
|
-
c2cgeoportal_geoportal-2.8.1.
|
189
|
-
c2cgeoportal_geoportal-2.8.1.
|
190
|
-
c2cgeoportal_geoportal-2.8.1.
|
191
|
-
c2cgeoportal_geoportal-2.8.1.
|
187
|
+
c2cgeoportal_geoportal-2.8.1.151.dist-info/METADATA,sha256=0YrSG41p9H2KcIazVZVi_tHE7uNTdU8xac5GT2M_dko,2172
|
188
|
+
c2cgeoportal_geoportal-2.8.1.151.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
|
189
|
+
c2cgeoportal_geoportal-2.8.1.151.dist-info/entry_points.txt,sha256=w0xGr1Bo8q5GBFiP4JgqbSIg-bNhG7bsGoEaGSTfzaE,1415
|
190
|
+
c2cgeoportal_geoportal-2.8.1.151.dist-info/top_level.txt,sha256=PJIbY7Nx51dDrJ052f5mDA7c6Tehm5aD-Gb32L_CtJA,29
|
191
|
+
c2cgeoportal_geoportal-2.8.1.151.dist-info/RECORD,,
|
{c2cgeoportal_geoportal-2.8.1.149.dist-info → c2cgeoportal_geoportal-2.8.1.151.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|