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

fix #10505 Allow to specify use of proxy or cors at layer level #10526

Merged

Conversation

rowheat02
Copy link
Contributor

@rowheat02 rowheat02 commented Sep 2, 2024

Description

  • fixes Allow to specify use of proxy or cors at layer level #10505. proxy by default implemented if any endpoint fails due to CORS
  • UI removed for: Force proxy (Layer Settings) and the Allow not secure layers
  • Interceptor has been used to use retry with proxy to all Axios endpoints.
  • For Cesium, before adding a layer to the map one preflight request is used to check CORS and use the proxy.
  • Common proxy cache for both cases.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#10505

What is the new behavior?
AutoProxy for CORS disabled endpoints.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@rowheat02 rowheat02 changed the title Enhancement/autoproxyforlayers fix #10505 Allow to specify use of proxy or cors at layer level Sep 2, 2024
@rowheat02 rowheat02 self-assigned this Sep 2, 2024
@rowheat02 rowheat02 added this to the 2024.02.00 milestone Sep 2, 2024
@tdipisa tdipisa linked an issue Sep 2, 2024 that may be closed by this pull request
6 tasks
@tdipisa tdipisa modified the milestones: 2024.02.00, 2025.01.00 Sep 6, 2024
@rowheat02
Copy link
Contributor Author

  • UI removed for: Force proxy (Layer Settings) and the Allow not secure layers
  • If any api fails due to CORS, proxy will be used by default in ajax interceptor.
  • In case of cesium, preflight CORS check api will be called before adding layer and forceProxy option will be used to create new layer which handle proxy logic in layers.
  • common proxy cache logic implemented.
  • Old Failed test cases other than "should create a bil terrain provider with wms config" have been solved. In this last failed test, two async parts are there throwing timeout error.

@rowheat02 rowheat02 marked this pull request as ready for review September 30, 2024 11:04
@tdipisa
Copy link
Member

tdipisa commented Oct 2, 2024

@allyoucanmap I think this is ready for a new review now.

@allyoucanmap allyoucanmap merged commit 8b2d33e into geosolutions-it:master Oct 9, 2024
6 checks passed
@allyoucanmap
Copy link
Contributor

allyoucanmap commented Oct 9, 2024

@ElenaGallo this PR introduced an automatic way to apply the proxy url (/proxy/?url=) to layer and requests, we need to test the following:

  • test all the layer types available in MapStore in the 3D viewer (Cesium). The should work as usual, we should also find some layer services with CORS disabled to check if the automatic detection is working
  • verify that the allow unsecure layer options from the advanced setting of catalog has been removed and a new warning message is visible when a user add an http service in a https instance (see Allow WMS GetMap requests through the MapStore proxy #8113). When an unsecure layer is added to the map the proxy url (/proxy/?url=) must be applied automatically (you can verify in the network tab)
  • verify that the force proxy option in layer settings has been removed
  • adding a service with CORS disabled to the catalog should apply the url proxy to the request, /proxy/?url=. Note: the service should not be included in the useCORS property to properly test this behaviour

jnewmoyer pushed a commit to ngsllc/MapStore2 that referenced this pull request Oct 17, 2024
* Update Changelog for version 2024.02.00 (geosolutions-it#10602)

Co-authored-by: github-actions <github-actions@github.com>

* Bump commons-io:commons-io from 2.7 to 2.14.0 (geosolutions-it#10593)

* Removed react-confirm-button unused dependency (geosolutions-it#10495)

* Update release_steps.md (geosolutions-it#10568)

* Remove istambul loader (geosolutions-it#10491)

* Attempt to remove instambul loader

* removed also package dependency

* Apply suggestions from code review

clean

* Remove jsonpath (geosolutions-it#10494)

jsonpath is not needed. It is a dependency of geosolutions-it/patcher actually.
Having this dependency here is only confusing for dependency analyisis

* Fix geosolutions-it#10595 add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests (geosolutions-it#10596)

* add missing 'FORMAT' parameter to WMTS GetFeatureInfo requests

this is required by the WMTS spec to be the same format as would
be used for a GetTile request, and this allows GFI requests to
succeed on https://data.geopf.fr/wmts.

* fix mapinfo wmts utils test

* Fix geosolutions-it#10505 Allow to specify use of proxy or cors at layer level (geosolutions-it#10526)

* fix: remove ui element for force proxy and Allow not secure layers

* fix: ajax logic changed, autoDetectCORS is set to true by default

* new central CORS util file created and used in ajax

* checking CORS before adding in common layer file

* null check on getProxyUrl

* updated individual layer considring to use proxy if needed

* avoid proxy cache to update if response is not okey

* enable user to add http url, show warning instead of error, warning text updated

* test cases updated

* fix: resolve conflicts with url check

* fixed the failed test

* review cesium layers

* include add method in model layer

* improve http check for openlayers wms layer

* fix tests

---------

Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>

* Update openId.md (geosolutions-it#10610)

* Bump spring-security version to 5.7.12 (fixes geosolutions-it#10611) (geosolutions-it#10612)

somehow something in the build already drags this version, and we
end up with two conflicting versions of spring-security in the war
which results in at least failure to authenticate with basic auth.

* Visibility limits - The resolution option is not retained as Limits type geosolutions-it#10391 (geosolutions-it#10598)

* Add lib check release step (geosolutions-it#10614)

* geosolutions-it#4675 Remove unused code (geosolutions-it#10442)

* geosolutions-it#4675 Remove unused code

* remove additional code from review

* fix tests folder

* remove additional unused files

* geosolutions-it#10545: Option to disable identify popup in case of no results (geosolutions-it#10557)

* geosolutions-it#10545: Option to disable identify popup in case of no results
Description:
- handle adding an option called 'hidePopupIfNoResults' to hide the identify popup
- add unit tests
- add jsdoc

* geosolutions-it#10545: Option to disable identify popup in case of no results
Description:
- revert changes in popupSupport files for ol and leaflet + related tests files
- handle hide popup for map viewer with css for openlayers and leaflet approach
- add unit tests
- edit map-popup.less file to handle hide the popup

* geosolutions-it#10545: revert unnecessary changes

* Fix geosolutions-it#10615 removed eval from marker utils (geosolutions-it#10616)

* geosolutions-it#10545: remove marker in case no results + hover identify mode active and hideEmptyPopupOption with true (geosolutions-it#10619)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
Co-authored-by: Landry Breuil <landryb@users.noreply.github.com>
Co-authored-by: RowHeat <40065760+rowheat02@users.noreply.github.com>
Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
Co-authored-by: mahmoud adel <58145645+mahmoudadel54@users.noreply.github.com>
Co-authored-by: Matteo V. <matteo.velludini@geosolutionsgroup.com>
offtherailz pushed a commit that referenced this pull request Oct 18, 2024
* fix: remove ui element for force proxy and Allow not secure layers

* fix: ajax logic changed, autoDetectCORS is set to true by default

* new central CORS util file created and used in ajax

* checking CORS before adding in common layer file

* null check on getProxyUrl

* updated individual layer considring to use proxy if needed

* avoid proxy cache to update if response is not okey

* enable user to add http url, show warning instead of error, warning text updated

* test cases updated

* fix: resolve conflicts with url check

* fixed the failed test

* review cesium layers

* include add method in model layer

* improve http check for openlayers wms layer

* fix tests

---------

Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to specify use of proxy or cors at layer level
3 participants