Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a general WMS verify certificate option #2034

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dev/config/pyramid_oereb.yml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,13 @@ pyramid_oereb:
fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung
layer_index: 0
layer_opacity: 1.0
# Option to check certificate for external WMS. Default and recommended setting: True
verify_certificate: True
plan_for_land_register_main_page:
# WMS URL to query the plan for land register specially for static extracts overview page
reference_wms:
de: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung
fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung
layer_index: 0
layer_opacity: 1.0
# Option to check certificate for external WMS. Default and recommended setting: True
verify_certificate: True
visualisation:
method: pyramid_oereb.core.hook_methods.produce_sld_content
# Note: these parameters must fit to the attributes provided by the RealEstateRecord!!!!
Expand Down Expand Up @@ -1413,6 +1409,10 @@ pyramid_oereb:
transfer_code: Hinweis
extract_code: Hint

# Option to check certificate for external WMS calls in standard and oereblex themes.
# Default and recommended setting: True
verify_certificate_wms: True

# The error message returned if an error occurs when requesting a static extract
# The content of the message is defined in the specification (document "Inhalt und Darstellung des statischen Auszugs")
static_error_message:
Expand Down
3 changes: 1 addition & 2 deletions pyramid_oereb/contrib/data_sources/standard/sources/plr.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def from_db_to_view_service_record(self, view_service_from_db, legend_entry_reco
Config.get('srid'),
Config.get('proxies'),
legends=legend_entry_records,
# Note: our standard database model does not contain an option to override the verify_certificate
verify_certificate=True
verify_certificate=Config.get('verify_certificate_wms', True)
)
return view_service_record

Expand Down
4 changes: 2 additions & 2 deletions pyramid_oereb/core/readers/real_estate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None):
Config.get('default_language'),
Config.get('srid'),
Config.get('proxies'),
verify_certificate=plan_for_land_register_config.get('verify_certificate', True)
verify_certificate=Config.get('verify_certificate_wms', True)
)

plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config()
Expand All @@ -75,7 +75,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None):
Config.get('default_language'),
Config.get('srid'),
Config.get('proxies'),
verify_certificate=plan_for_land_register_main_page_config.get('verify_certificate', True)
verify_certificate=Config.get('verify_certificate_wms', True)
)

self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry)
Expand Down
Loading