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

[Maps] add ability to load EMS resources with CORS #34503

Merged
merged 28 commits into from May 21, 2019

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Apr 3, 2019

Closes #34017

  • allow maps app to request content from EMS either through CORS or proxied through Kibana. This is configured in the kibana.yml.
  • the new default is to use CORS, similar to the region-maps. This is a change in the default behavior of the maps app.
  • the actual tile-requests are proxied as well. Before, only requests for vector-files were proxied.

Closes #36524

  • align the behavior of the region-maps with the maps app and do a simple CORS-call, without injecting the additional kbn-version header.

This also introduces an internal refactor.

  • layers and tms-services configured in the kibana.yml are no longer proxied through the meta-call.

This also fixes the bug that the initial-layer selection now correctly uses the tilemap.* config from kibana.yml when it is present


Discuss

This changes the default to use CORS (so the flag-config does not conflict with the default (and only behavior) in the region and coordinate map visualizations.

We might want to backport this all the way to 6.7/7.0. For the backports, we would actually want to preserve the default of proxying EMS.

It'd be something like:
- 6.7.x: proxy EMS (as it is now)
- 7.0.x: proxy EMS (as it is now)
- 7.x: use CORS (breaking)
- 8.0: use CORS (breaking)

cc @alexfrancoeur

@thomasneirynck thomasneirynck changed the title [Maps] add optional CORS [Maps] add ability to load EMS resources with CORS Apr 3, 2019
@thomasneirynck thomasneirynck added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 labels Apr 3, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@thomasneirynck thomasneirynck added discuss WIP Work in progress labels Apr 3, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck requested review from nreese, kindsun and alexfrancoeur and removed request for nreese April 5, 2019 22:06
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese
Copy link
Contributor

nreese commented May 21, 2019

Looks like relative URL are no longer supported. I am getting the following errors. This occurs when map.proxyElasticMapsServiceInMaps: true

Screen Shot 2019-05-21 at 6 44 04 AM

Screen Shot 2019-05-21 at 6 44 35 AM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
code review, tested in chrome

@nickpeihl
Copy link
Member

lgtm! Tested locally with custom tile and region map services. My custom maps loaded directly with CORS while EMS services loaded via proxy when map.proxyElasticMapsServiceInMaps: true.

When map.proxyElasticMapsServiceInMaps: false all resources load directly with CORS.

Requests for custom region maps no longer include the kbn-version header which is great!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck merged commit e2e5fed into elastic:master May 21, 2019
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request May 21, 2019
- breaking change: by default, the Maps app now connects with CORS to EMS. This is optional
- no longer include the kbn-version header when requesting files over CORS in region maps
@fbaligand
Copy link
Contributor

Great feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants