From 1503cbda95dfa38361cbfab449636b7891c60085 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 9 Jan 2020 12:02:05 -0800 Subject: [PATCH 01/10] Use v7.6 Elastic Maps Service API --- src/legacy/server/config/schema.js | 3 +- .../ui/public/vis/map/service_settings.js | 3 +- .../legacy/plugins/maps/common/constants.js | 18 +++---- x-pack/legacy/plugins/maps/index.js | 3 +- x-pack/legacy/plugins/maps/public/meta.js | 26 ++++++---- x-pack/legacy/plugins/maps/server/routes.js | 48 +++++++++---------- 6 files changed, 58 insertions(+), 43 deletions(-) diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js index a18cb7de5a61b..b33a67f3eaca1 100644 --- a/src/legacy/server/config/schema.js +++ b/src/legacy/server/config/schema.js @@ -254,7 +254,8 @@ export default () => ) .default([]), }).default(), - manifestServiceUrl: Joi.string().default('https://catalogue.maps.elastic.co/v7.2/manifest'), + emsFileApiUrl: Joi.string().default('https://vector-staging.maps.elastic.co'), + emsTileApiUrl: Joi.string().default('https://tiles.maps.elastic.co'), emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v7.4'), emsFontLibraryUrl: Joi.string().default( 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf' diff --git a/src/legacy/ui/public/vis/map/service_settings.js b/src/legacy/ui/public/vis/map/service_settings.js index 1096aa8eb4503..233ee526c439b 100644 --- a/src/legacy/ui/public/vis/map/service_settings.js +++ b/src/legacy/ui/public/vis/map/service_settings.js @@ -48,7 +48,8 @@ uiModules this._emsClient = new EMSClient({ language: i18n.getLocale(), kbnVersion: kbnVersion, - manifestServiceUrl: mapConfig.manifestServiceUrl, + fileApiUrl: mapConfig.emsFileApiUrl, + tileApiUrl: mapConfig.emsTileApiUrl, htmlSanitizer: $sanitize, landingPageUrl: mapConfig.emsLandingPageUrl, }); diff --git a/x-pack/legacy/plugins/maps/common/constants.js b/x-pack/legacy/plugins/maps/common/constants.js index 6e7776d43f4d4..9d2605936ab0b 100644 --- a/x-pack/legacy/plugins/maps/common/constants.js +++ b/x-pack/legacy/plugins/maps/common/constants.js @@ -8,17 +8,19 @@ import { i18n } from '@kbn/i18n'; export const EMS_CATALOGUE_PATH = 'ems/catalogue'; export const EMS_FILES_CATALOGUE_PATH = 'ems/files'; -export const EMS_FILES_DEFAULT_JSON_PATH = 'ems/files/file'; -export const EMS_GLYPHS_PATH = 'ems/fonts'; -export const EMS_SPRITES_PATH = 'ems/sprites'; +export const EMS_FILES_API_PATH = 'ems/files'; +export const EMS_FILES_DEFAULT_JSON_PATH = 'file'; +export const EMS_GLYPHS_PATH = 'fonts'; +export const EMS_SPRITES_PATH = 'sprites'; export const EMS_TILES_CATALOGUE_PATH = 'ems/tiles'; -export const EMS_TILES_RASTER_STYLE_PATH = 'ems/tiles/raster/style'; -export const EMS_TILES_RASTER_TILE_PATH = 'ems/tiles/raster/tile'; +export const EMS_TILES_API_PATH = 'ems/tiles'; +export const EMS_TILES_RASTER_STYLE_PATH = 'raster/style'; +export const EMS_TILES_RASTER_TILE_PATH = 'raster/tile'; -export const EMS_TILES_VECTOR_STYLE_PATH = 'ems/tiles/vector/style'; -export const EMS_TILES_VECTOR_SOURCE_PATH = 'ems/tiles/vector/source'; -export const EMS_TILES_VECTOR_TILE_PATH = 'ems/tiles/vector/tile'; +export const EMS_TILES_VECTOR_STYLE_PATH = 'vector/style'; +export const EMS_TILES_VECTOR_SOURCE_PATH = 'vector/source'; +export const EMS_TILES_VECTOR_TILE_PATH = 'vector/tile'; export const MAP_SAVED_OBJECT_TYPE = 'map'; export const APP_ID = 'maps'; diff --git a/x-pack/legacy/plugins/maps/index.js b/x-pack/legacy/plugins/maps/index.js index 83362e73fb314..d28f483c9b987 100644 --- a/x-pack/legacy/plugins/maps/index.js +++ b/x-pack/legacy/plugins/maps/index.js @@ -43,7 +43,8 @@ export function maps(kibana) { emsFontLibraryUrl: mapConfig.emsFontLibraryUrl, emsTileLayerId: mapConfig.emsTileLayerId, proxyElasticMapsServiceInMaps: mapConfig.proxyElasticMapsServiceInMaps, - emsManifestServiceUrl: mapConfig.manifestServiceUrl, + emsFileApiUrl: mapConfig.emsFileApiUrl, + emsTileApiUrl: mapConfig.emsTileApiUrl, emsLandingPageUrl: mapConfig.emsLandingPageUrl, kbnPkgVersion: serverConfig.get('pkg.version'), regionmapLayers: _.get(mapConfig, 'regionmap.layers', []), diff --git a/x-pack/legacy/plugins/maps/public/meta.js b/x-pack/legacy/plugins/maps/public/meta.js index 7cdb8d67c057b..c5cfb582976c1 100644 --- a/x-pack/legacy/plugins/maps/public/meta.js +++ b/x-pack/legacy/plugins/maps/public/meta.js @@ -4,7 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GIS_API_PATH, EMS_CATALOGUE_PATH, EMS_GLYPHS_PATH } from '../common/constants'; +import { + GIS_API_PATH, + EMS_FILES_CATALOGUE_PATH, + EMS_TILES_CATALOGUE_PATH, + EMS_GLYPHS_PATH, +} from '../common/constants'; import chrome from 'ui/chrome'; import { i18n } from '@kbn/i18n'; import { EMSClient } from '@elastic/ems-client'; @@ -41,18 +46,22 @@ export function getEMSClient() { 'proxyElasticMapsServiceInMaps', false ); - const proxyPath = proxyElasticMapsServiceInMaps ? relativeToAbsolute('..') : ''; - const manifestServiceUrl = proxyElasticMapsServiceInMaps - ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_CATALOGUE_PATH}`) - : chrome.getInjected('emsManifestServiceUrl'); + const proxyPath = ''; + const tileApiUrl = proxyElasticMapsServiceInMaps + ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_TILES_CATALOGUE_PATH}`) + : chrome.getInjected('emsTileApiUrl'); + const fileApiUrl = proxyElasticMapsServiceInMaps + ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_FILES_CATALOGUE_PATH}`) + : chrome.getInjected('emsFileApiUrl'); emsClient = new EMSClient({ language: i18n.getLocale(), kbnVersion: chrome.getInjected('kbnPkgVersion'), - manifestServiceUrl: manifestServiceUrl, + tileApiUrl, + fileApiUrl, landingPageUrl: chrome.getInjected('emsLandingPageUrl'), fetchFunction: fetchFunction, //import this from client-side, so the right instance is returned (bootstrapped from common/* would not work - proxyPath: proxyPath, + proxyPath, }); } else { //EMS is turned off. Mock API. @@ -80,7 +89,8 @@ export function getGlyphUrl() { return ''; } return chrome.getInjected('proxyElasticMapsServiceInMaps', false) - ? relativeToAbsolute(`${GIS_API_RELATIVE}/${EMS_GLYPHS_PATH}`) + `/{fontstack}/{range}` + ? relativeToAbsolute(`../${GIS_API_PATH}/${EMS_TILES_CATALOGUE_PATH}/${EMS_GLYPHS_PATH}`) + + `/{fontstack}/{range}` : chrome.getInjected('emsFontLibraryUrl', true); } diff --git a/x-pack/legacy/plugins/maps/server/routes.js b/x-pack/legacy/plugins/maps/server/routes.js index 5e9cd3cfa87bd..dde4484d2170f 100644 --- a/x-pack/legacy/plugins/maps/server/routes.js +++ b/x-pack/legacy/plugins/maps/server/routes.js @@ -6,8 +6,10 @@ import { EMS_CATALOGUE_PATH, + EMS_FILES_API_PATH, EMS_FILES_CATALOGUE_PATH, EMS_FILES_DEFAULT_JSON_PATH, + EMS_TILES_API_PATH, EMS_TILES_CATALOGUE_PATH, EMS_GLYPHS_PATH, EMS_TILES_RASTER_STYLE_PATH, @@ -37,9 +39,9 @@ export function initRoutes(server, licenseUid) { emsClient = new EMSClient({ language: i18n.getLocale(), kbnVersion: serverConfig.get('pkg.version'), - manifestServiceUrl: mapConfig.manifestServiceUrl, + fileApiUrl: mapConfig.emsFileApiUrl, + tileApiUrl: mapConfig.emsTileApiUrl, landingPageUrl: mapConfig.emsLandingPageUrl, - proxyElasticMapsServiceInMaps: false, }); emsClient.addQueryParams({ license: licenseUid }); } else { @@ -65,7 +67,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_FILES_DEFAULT_JSON_PATH}`, + path: `${ROOT}/${EMS_FILES_API_PATH}/${EMS_FILES_DEFAULT_JSON_PATH}`, handler: async request => { checkEMSProxyConfig(); @@ -92,7 +94,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_RASTER_TILE_PATH}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_TILES_RASTER_TILE_PATH}`, handler: async (request, h) => { checkEMSProxyConfig(); @@ -134,8 +136,8 @@ export function initRoutes(server, licenseUid) { }; //rewrite the urls to the submanifest - const tileService = main.services.find(service => service.id === 'tiles'); - const fileService = main.services.find(service => service.id === 'geo_layers'); + const tileService = main.services.find(service => service.type === 'tms'); + const fileService = main.services.find(service => service.type === 'file'); if (tileService) { proxiedManifest.services.push({ ...tileService, @@ -154,7 +156,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_FILES_CATALOGUE_PATH}`, + path: `${ROOT}/${EMS_FILES_CATALOGUE_PATH}/{emsVersion}/manifest`, handler: async () => { checkEMSProxyConfig(); @@ -162,7 +164,7 @@ export function initRoutes(server, licenseUid) { const layers = file.layers.map(layer => { const newLayer = { ...layer }; const id = encodeURIComponent(layer.layer_id); - const newUrl = `${GIS_API_PATH}/${EMS_FILES_DEFAULT_JSON_PATH}?id=${id}`; + const newUrl = `${EMS_FILES_DEFAULT_JSON_PATH}?id=${id}`; newLayer.formats = [ { ...layer.formats[0], @@ -178,7 +180,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_CATALOGUE_PATH}`, + path: `${ROOT}/${EMS_TILES_CATALOGUE_PATH}/{emsVersion}/manifest`, handler: async () => { checkEMSProxyConfig(); @@ -191,16 +193,15 @@ export function initRoutes(server, licenseUid) { newService.formats = []; const rasterFormats = service.formats.filter(format => format.format === 'raster'); if (rasterFormats.length) { - const newUrl = `${GIS_API_PATH}/${EMS_TILES_RASTER_STYLE_PATH}?id=${service.id}`; + const newUrl = `${EMS_TILES_RASTER_STYLE_PATH}?id=${service.id}`; newService.formats.push({ ...rasterFormats[0], url: newUrl, }); } - const vectorFormats = service.formats.filter(format => format.format === 'vector'); if (vectorFormats.length) { - const newUrl = `${GIS_API_PATH}/${EMS_TILES_VECTOR_STYLE_PATH}?id=${service.id}`; + const newUrl = `${EMS_TILES_VECTOR_STYLE_PATH}?id=${service.id}`; newService.formats.push({ ...vectorFormats[0], url: newUrl, @@ -217,7 +218,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_RASTER_STYLE_PATH}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_TILES_RASTER_STYLE_PATH}`, handler: async request => { checkEMSProxyConfig(); @@ -233,7 +234,7 @@ export function initRoutes(server, licenseUid) { } const style = await tmsService.getDefaultRasterStyle(); - const newUrl = `${GIS_API_PATH}/${EMS_TILES_RASTER_TILE_PATH}?id=${request.query.id}&x={x}&y={y}&z={z}`; + const newUrl = `${EMS_TILES_RASTER_TILE_PATH}?id=${request.query.id}&x={x}&y={y}&z={z}`; return { ...style, tiles: [newUrl], @@ -243,7 +244,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_VECTOR_STYLE_PATH}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_TILES_VECTOR_STYLE_PATH}`, handler: async request => { checkEMSProxyConfig(); @@ -264,16 +265,16 @@ export function initRoutes(server, licenseUid) { if (vectorStyle.sources.hasOwnProperty(sourceId)) { newSources[sourceId] = { type: 'vector', - url: `${GIS_API_PATH}/${EMS_TILES_VECTOR_SOURCE_PATH}?id=${request.query.id}&sourceId=${sourceId}`, + url: `${EMS_TILES_VECTOR_SOURCE_PATH}?id=${request.query.id}&sourceId=${sourceId}`, }; } } - const spritePath = `${GIS_API_PATH}/${EMS_SPRITES_PATH}/${request.query.id}/sprite`; + const spritePath = `${EMS_SPRITES_PATH}/${request.query.id}/sprite`; return { ...vectorStyle, - glyphs: `${GIS_API_PATH}/${EMS_GLYPHS_PATH}/{fontstack}/{range}`, + glyphs: `${EMS_GLYPHS_PATH}/{fontstack}/{range}`, sprite: spritePath, sources: newSources, }; @@ -282,7 +283,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_VECTOR_SOURCE_PATH}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_TILES_VECTOR_SOURCE_PATH}`, handler: async request => { checkEMSProxyConfig(); @@ -303,7 +304,7 @@ export function initRoutes(server, licenseUid) { const vectorStyle = await tmsService.getVectorStyleSheet(); const sourceManifest = vectorStyle.sources[request.query.sourceId]; - const newUrl = `${GIS_API_PATH}/${EMS_TILES_VECTOR_TILE_PATH}?id=${request.query.id}&sourceId=${request.query.sourceId}&x={x}&y={y}&z={z}`; + const newUrl = `${EMS_TILES_VECTOR_TILE_PATH}?id=${request.query.id}&sourceId=${request.query.sourceId}&x={x}&y={y}&z={z}`; return { ...sourceManifest, tiles: [newUrl], @@ -313,7 +314,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_VECTOR_TILE_PATH}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_TILES_VECTOR_TILE_PATH}`, handler: async (request, h) => { checkEMSProxyConfig(); @@ -349,10 +350,9 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_GLYPHS_PATH}/{fontstack}/{range}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_GLYPHS_PATH}/{fontstack}/{range}`, handler: async (request, h) => { checkEMSProxyConfig(); - const url = mapConfig.emsFontLibraryUrl .replace('{fontstack}', request.params.fontstack) .replace('{range}', request.params.range); @@ -363,7 +363,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_SPRITES_PATH}/{id}/sprite{scaling}.{extension}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_SPRITES_PATH}/{id}/sprite{scaling}.{extension}`, handler: async (request, h) => { checkEMSProxyConfig(); From e4f405ae91530b5ac9b59e1a2410a81f6fac2ff6 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 9 Jan 2020 15:10:04 -0800 Subject: [PATCH 02/10] Fix tests for 7.6 --- .../__tests__/map/ems_mocks/sample_files.json | 36 ++++++------ .../map/ems_mocks/sample_manifest.json | 4 +- .../map/ems_mocks/sample_style_bright.json | 2 +- .../ems_mocks/sample_style_bright_vector.json | 6 +- .../sample_style_bright_vector_source.json | 2 +- .../map/ems_mocks/sample_style_dark.json | 2 +- .../ems_mocks/sample_style_desaturated.json | 2 +- .../__tests__/map/ems_mocks/sample_tiles.json | 12 ++-- .../vis/__tests__/map/service_settings.js | 56 ++++++++++--------- 9 files changed, 64 insertions(+), 58 deletions(-) diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_files.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_files.json index 3ef17ea35352c..cdbed7fa06367 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_files.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_files.json @@ -24,7 +24,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/world_countries_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/world_countries_v1.geo.json", "legacy_default": true } ], @@ -430,7 +430,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/australia_states_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/australia_states_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -629,7 +629,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/canada_provinces_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/canada_provinces_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -908,7 +908,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/china_provinces_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/china_provinces_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -1266,7 +1266,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/finland_regions_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/finland_regions_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -1634,7 +1634,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/france_departments_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/france_departments_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -1984,7 +1984,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/germany_states_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/germany_states_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -2328,7 +2328,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/ireland_counties_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/ireland_counties_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -2637,7 +2637,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/japan_prefectures_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/japan_prefectures_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -3003,7 +3003,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/netherlands_provinces_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/netherlands_provinces_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -3309,7 +3309,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/norway_counties_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/norway_counties_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -3671,7 +3671,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/spain_provinces_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/spain_provinces_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -4002,7 +4002,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/sweden_counties_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/sweden_counties_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -4311,7 +4311,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/switzerland_cantons_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/switzerland_cantons_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -4827,7 +4827,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/uk_subdivisions_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/uk_subdivisions_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -5074,7 +5074,7 @@ "formats": [ { "type": "topojson", - "url": "https://vector-staging.maps.elastic.co/files/usa_counties_v2.topo.json?elastic_tile_service_tos=agree", + "url": "/files/usa_counties_v2.topo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -5441,7 +5441,7 @@ "formats": [ { "type": "geojson", - "url": "https://vector-staging.maps.elastic.co/files/usa_states_v1.geo.json?elastic_tile_service_tos=agree", + "url": "/files/usa_states_v1.geo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], @@ -5731,7 +5731,7 @@ "formats": [ { "type": "topojson", - "url": "https://vector-staging.maps.elastic.co/files/usa_zip_codes_v2.topo.json?elastic_tile_service_tos=agree", + "url": "/files/usa_zip_codes_v2.topo.json?elastic_tile_service_tos=agree", "legacy_default": true } ], diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json index aaf1edbf4860e..6030c8068884d 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_manifest.json @@ -3,13 +3,13 @@ { "id": "tiles_v2", "name": "Elastic Maps Tile Service", - "manifest": "https://tiles.foobar/manifest", + "manifest": "https://tiles.foobar/v7.6/manifest", "type": "tms" }, { "id": "geo_layers", "name": "Elastic Maps Vector Service", - "manifest": "https://files.foobar/manifest", + "manifest": "https://files.foobar/v7.6/manifest", "type": "file" } ] diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright.json index 6ea1686dadb8d..f757624ffbca7 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright.json @@ -7,6 +7,6 @@ "bounds": [-180, -85.0511, 180, 85.0511], "format": "png", "type": "baselayer", - "tiles": ["https://raster-style.foobar/styles/osm-bright/{z}/{x}/{y}.png"], + "tiles": ["/raster/styles/osm-bright/{z}/{x}/{y}.png"], "center": [0, 0, 2] } diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json index b14db52644459..52b70bff6b2ad 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector.json @@ -41,11 +41,11 @@ "sources": { "openmaptiles": { "type": "vector", - "url": "https://tiles.maps.elastic.co/data/v3.json" + "url": "/data/v3.json" } }, - "sprite": "https://tiles.maps.elastic.co/styles/osm-bright/sprite", - "glyphs": "https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf", + "sprite": "/styles/osm-bright/sprite", + "glyphs": "/fonts/{fontstack}/{range}.pbf", "layers": [ { "id": "background", diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json index a32b627dba2c2..9961d54028b13 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_bright_vector_source.json @@ -1,6 +1,6 @@ { "tiles": [ - "https://tiles.maps.elastic.co/data/v3/{z}/{x}/{y}.pbf" + "/data/v3/{z}/{x}/{y}.pbf" ], "name": "OpenMapTiles", "format": "pbf", diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_dark.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_dark.json index 9481297b99a28..411d9d59b89c6 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_dark.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_dark.json @@ -7,6 +7,6 @@ "bounds": [-180, -85.0511, 180, 85.0511], "format": "png", "type": "baselayer", - "tiles": ["https://raster-style.foobar/styles/dark-matter/{z}/{x}/{y}.png"], + "tiles": ["/raster/styles/dark-matter/{z}/{x}/{y}.png"], "center": [0, 0, 2] } diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated.json index cbbd35d59ce89..c89bbe73b603a 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_style_desaturated.json @@ -7,6 +7,6 @@ "bounds": [-180, -85.0511, 180, 85.0511], "format": "png", "type": "baselayer", - "tiles": ["https://raster-style.foobar/styles/osm-bright-desaturated/{z}/{x}/{y}.png"], + "tiles": ["/raster/styles/osm-bright-desaturated/{z}/{x}/{y}.png"], "center": [0, 0, 2] } diff --git a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json index 9df72817bb940..c038bb411daec 100644 --- a/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json +++ b/src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_tiles.json @@ -19,12 +19,12 @@ { "locale": "en", "format": "vector", - "url": "https://vector-style.foobar/styles/osm-bright/style.json" + "url": "/v7.6/styles/osm-bright/style.json" }, { "locale": "en", "format": "raster", - "url": "https://raster-style.foobar/styles/osm-bright.json" + "url": "/v7.6/styles/osm-bright.json" } ] }, @@ -47,12 +47,12 @@ { "locale": "en", "format": "vector", - "url": "https://vector-style.foobar/styles/osm-bright-desaturated/style.json" + "url": "/v7.6/styles/osm-bright-desaturated/style.json" }, { "locale": "en", "format": "raster", - "url": "https://raster-style.foobar/styles/osm-bright-desaturated.json" + "url": "/v7.6/styles/osm-bright-desaturated.json" } ] }, @@ -75,12 +75,12 @@ { "locale": "en", "format": "vector", - "url": "https://vector-style.foobar/styles/dark-matter/style.json" + "url": "/v7.6/styles/dark-matter/style.json" }, { "locale": "en", "format": "raster", - "url": "https://raster-style.foobar/styles/dark-matter.json" + "url": "/v7.6/styles/dark-matter.json" } ] } diff --git a/src/legacy/ui/public/vis/__tests__/map/service_settings.js b/src/legacy/ui/public/vis/__tests__/map/service_settings.js index 820b66897affa..61925760457c6 100644 --- a/src/legacy/ui/public/vis/__tests__/map/service_settings.js +++ b/src/legacy/ui/public/vis/__tests__/map/service_settings.js @@ -21,7 +21,6 @@ import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import url from 'url'; -import EMS_CATALOGUE from './ems_mocks/sample_manifest.json'; import EMS_FILES from './ems_mocks/sample_files.json'; import EMS_TILES from './ems_mocks/sample_tiles.json'; import EMS_STYLE_ROAD_MAP_BRIGHT from './ems_mocks/sample_style_bright'; @@ -34,14 +33,18 @@ describe('service_settings (FKA tilemaptest)', function() { let mapConfig; let tilemapsConfig; - const manifestUrl = 'https://foobar/manifest'; - const manifestUrl2 = 'https://foobar_override/v1/manifest'; + const emsFileApiUrl = 'https://files.foobar'; + const emsTileApiUrl = 'https://tiles.foobar'; + + const emsTileApiUrl2 = 'https://tiles_override.foobar'; + const emsFileApiUrl2 = 'https://files_override.foobar'; beforeEach( ngMock.module('kibana', $provide => { $provide.decorator('mapConfig', () => { return { - manifestServiceUrl: manifestUrl, + emsFileApiUrl, + emsTileApiUrl, includeElasticMapsService: true, emsTileLayerId: { bright: 'road_map', @@ -53,7 +56,8 @@ describe('service_settings (FKA tilemaptest)', function() { }) ); - let manifestServiceUrlOriginal; + let emsTileApiUrlOriginal; + let emsFileApiUrlOriginal; let tilemapsConfigDeprecatedOriginal; let getManifestStub; beforeEach( @@ -61,26 +65,26 @@ describe('service_settings (FKA tilemaptest)', function() { serviceSettings = $injector.get('serviceSettings'); getManifestStub = serviceSettings.__debugStubManifestCalls(async url => { //simulate network calls - if (url.startsWith('https://foobar')) { - return EMS_CATALOGUE; - } else if (url.startsWith('https://tiles.foobar')) { - return EMS_TILES; - } else if (url.startsWith('https://files.foobar')) { - return EMS_FILES; - } else if (url.startsWith('https://raster-style.foobar')) { - if (url.includes('osm-bright-desaturated')) { + if (url.startsWith('https://tiles.foobar')) { + if (url.includes('/manifest')) { + return EMS_TILES; + } else if (url.includes('osm-bright-desaturated.json')) { return EMS_STYLE_ROAD_MAP_DESATURATED; - } else if (url.includes('osm-bright')) { + } else if (url.includes('osm-bright.json')) { return EMS_STYLE_ROAD_MAP_BRIGHT; - } else if (url.includes('dark-matter')) { + } else if (url.includes('dark-matter.json')) { return EMS_STYLE_DARK_MAP; } + } else if (url.startsWith('https://files.foobar')) { + return EMS_FILES; } }); mapConfig = $injector.get('mapConfig'); tilemapsConfig = $injector.get('tilemapsConfig'); - manifestServiceUrlOriginal = mapConfig.manifestServiceUrl; + emsTileApiUrlOriginal = mapConfig.emsTileApiUrl; + emsFileApiUrlOriginal = mapConfig.emsFileApiUrl; + tilemapsConfigDeprecatedOriginal = tilemapsConfig.deprecated; $rootScope.$digest(); }) @@ -88,7 +92,8 @@ describe('service_settings (FKA tilemaptest)', function() { afterEach(function() { getManifestStub.removeStub(); - mapConfig.manifestServiceUrl = manifestServiceUrlOriginal; + mapConfig.emsTileApiUrl = emsTileApiUrlOriginal; + mapConfig.emsFileApiUrl = emsFileApiUrlOriginal; tilemapsConfig.deprecated = tilemapsConfigDeprecatedOriginal; }); @@ -110,7 +115,7 @@ describe('service_settings (FKA tilemaptest)', function() { expect(attrs.url).to.contain('{z}'); const urlObject = url.parse(attrs.url, true); - expect(urlObject.hostname).to.be('raster-style.foobar'); + expect(urlObject.hostname).to.be('tiles.foobar'); expect(urlObject.query).to.have.property('my_app_name', 'kibana'); expect(urlObject.query).to.have.property('elastic_tile_service_tos', 'agree'); expect(urlObject.query).to.have.property('my_app_version'); @@ -161,7 +166,8 @@ describe('service_settings (FKA tilemaptest)', function() { }); it('when overridden, should continue to work', async () => { - mapConfig.manifestServiceUrl = manifestUrl2; + mapConfig.emsFileApiUrl = emsFileApiUrl2; + mapConfig.emsTileApiUrl = emsTileApiUrl2; serviceSettings.addQueryParams({ foo: 'bar' }); tilemapServices = await serviceSettings.getTMSServices(); await assertQuery({ foo: 'bar' }); @@ -187,11 +193,11 @@ describe('service_settings (FKA tilemaptest)', function() { id: 'road_map', name: 'Road Map - Bright', url: - 'https://raster-style.foobar/styles/osm-bright/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3', + 'https://tiles.foobar/raster/styles/osm-bright/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3', minZoom: 0, maxZoom: 10, attribution: - '

OpenStreetMap contributors | OpenMapTiles | MapTiler | Elastic Maps Service

', + 'OpenStreetMap contributors | OpenMapTiles | MapTiler | Elastic Maps Service', subdomains: [], }, ]; @@ -233,19 +239,19 @@ describe('service_settings (FKA tilemaptest)', function() { ); expect(desaturationFalse.url).to.equal( - 'https://raster-style.foobar/styles/osm-bright/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' + 'https://tiles.foobar/raster/styles/osm-bright/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' ); expect(desaturationFalse.maxZoom).to.equal(10); expect(desaturationTrue.url).to.equal( - 'https://raster-style.foobar/styles/osm-bright-desaturated/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' + 'https://tiles.foobar/raster/styles/osm-bright-desaturated/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' ); expect(desaturationTrue.maxZoom).to.equal(18); expect(darkThemeDesaturationFalse.url).to.equal( - 'https://raster-style.foobar/styles/dark-matter/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' + 'https://tiles.foobar/raster/styles/dark-matter/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' ); expect(darkThemeDesaturationFalse.maxZoom).to.equal(22); expect(darkThemeDesaturationTrue.url).to.equal( - 'https://raster-style.foobar/styles/dark-matter/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' + 'https://tiles.foobar/raster/styles/dark-matter/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=1.2.3' ); expect(darkThemeDesaturationTrue.maxZoom).to.equal(22); }); From 1f7e393dddfc5c7c30716e7604e007747797fe48 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 9 Jan 2020 16:11:11 -0800 Subject: [PATCH 03/10] Replace manifestServiceUrl in tests --- .../core_plugins/tests_bundle/tests_entry_template.js | 3 ++- x-pack/legacy/plugins/maps/public/meta.test.js | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js index 02b1f5fec9c19..4a6bee4e0ff14 100644 --- a/src/legacy/core_plugins/tests_bundle/tests_entry_template.js +++ b/src/legacy/core_plugins/tests_bundle/tests_entry_template.js @@ -123,7 +123,8 @@ const coreSystem = new CoreSystem({ }, mapConfig: { includeElasticMapsService: true, - manifestServiceUrl: 'https://catalogue-staging.maps.elastic.co/v2/manifest' + emsFileApiUrl: 'https://vector-staging.maps.elastic.co', + emsTileApiUrl: 'https://tiles.maps.elastic.co', }, vegaConfig: { enabled: true, diff --git a/x-pack/legacy/plugins/maps/public/meta.test.js b/x-pack/legacy/plugins/maps/public/meta.test.js index 06f4071e3444b..64dd73fe109ff 100644 --- a/x-pack/legacy/plugins/maps/public/meta.test.js +++ b/x-pack/legacy/plugins/maps/public/meta.test.js @@ -18,8 +18,10 @@ jest.mock('ui/chrome', () => ({ return false; } else if (key === 'isEmsEnabled') { return true; - } else if (key === 'emsManifestServiceUrl') { - return 'https://ems-manifest'; + } else if (key === 'emsFileApiUrl') { + return 'https://file-api'; + } else if (key === 'emsTileApiUrl') { + return 'https://tile-api'; } }, getUiSettingsClient: () => { @@ -40,9 +42,10 @@ jest.mock('./kibana_services', () => { }); describe('default use without proxy', () => { - it('should construct EMSClient with absolute manifest url', async () => { + it('should construct EMSClient with absolute file and tile API urls', async () => { getEMSClient(); const mockEmsClientCall = EMSClient.mock.calls[0]; - expect(mockEmsClientCall[0].manifestServiceUrl.startsWith('https://ems-manifest')).toBe(true); + expect(mockEmsClientCall[0].fileApiUrl.startsWith('https://file-api')).toBe(true); + expect(mockEmsClientCall[0].tileApiUrl.startsWith('https://tile-api')).toBe(true); }); }); From cb26ce7e6edb9feb93de090e4a62ba6b55e5e2f7 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Mon, 13 Jan 2020 13:39:57 -0800 Subject: [PATCH 04/10] Update ems-client library --- package.json | 2 +- x-pack/package.json | 1 - yarn.lock | 9 +++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6b9640d214a5e..56daab0a757be 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@elastic/apm-rum": "^4.6.0", "@elastic/charts": "^16.1.0", "@elastic/datemath": "5.0.2", - "@elastic/ems-client": "1.0.5", + "@elastic/ems-client": "^7.6.0", "@elastic/eui": "17.3.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", diff --git a/x-pack/package.json b/x-pack/package.json index 3f826030ac16b..8ec13b7d2c5af 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -178,7 +178,6 @@ "@babel/runtime": "^7.5.5", "@elastic/apm-rum-react": "^0.3.2", "@elastic/datemath": "5.0.2", - "@elastic/ems-client": "1.0.5", "@elastic/eui": "17.3.1", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.1.0", diff --git a/yarn.lock b/yarn.lock index ff098b7b9c891..9316ff7436a97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1398,13 +1398,14 @@ once "^1.4.0" pump "^3.0.0" -"@elastic/ems-client@1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@elastic/ems-client/-/ems-client-1.0.5.tgz#e2c10816c5eebdf128590170d8f09fcc693db50b" - integrity sha512-J+jDjtpHfGnbsgdhuA1zp/JoZftCpx6/h/4bP5ik+2Ysa30sAHIpHs0D3921R75O9WDNs6SHVnV/oqdJKL/HCg== +"@elastic/ems-client@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@elastic/ems-client/-/ems-client-7.6.0.tgz#ca548aba1a1f5170a1892de129b537b5248c74be" + integrity sha512-oBtLH24qIgTaMhlSske49FTd35Y0nv+PlZCZaHkBhOH+ScsTDL3LO2lbIcSmcYQod43Ly34v/xwJvFCTxojVEQ== dependencies: lodash "^4.17.15" node-fetch "^1.7.3" + semver "^6.3.0" "@elastic/eslint-plugin-eui@0.0.2": version "0.0.2" From 49eff5c613701b0343a400a553c6850a72477202 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Mon, 13 Jan 2020 16:00:12 -0800 Subject: [PATCH 05/10] Add ems-client dependency to x-pack package.json --- x-pack/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/package.json b/x-pack/package.json index 8ec13b7d2c5af..a63f641ece487 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -178,6 +178,7 @@ "@babel/runtime": "^7.5.5", "@elastic/apm-rum-react": "^0.3.2", "@elastic/datemath": "5.0.2", + "@elastic/ems-client": "^7.6.0", "@elastic/eui": "17.3.1", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.1.0", From 66b6979fe588fbb7331fd22568dfefb90c99efe0 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Mon, 13 Jan 2020 20:05:27 -0800 Subject: [PATCH 06/10] fix sprite url --- x-pack/legacy/plugins/maps/server/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/maps/server/routes.js b/x-pack/legacy/plugins/maps/server/routes.js index dde4484d2170f..2e5ea299b6f67 100644 --- a/x-pack/legacy/plugins/maps/server/routes.js +++ b/x-pack/legacy/plugins/maps/server/routes.js @@ -363,7 +363,7 @@ export function initRoutes(server, licenseUid) { server.route({ method: 'GET', - path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_SPRITES_PATH}/{id}/sprite{scaling}.{extension}`, + path: `${ROOT}/${EMS_TILES_API_PATH}/${EMS_SPRITES_PATH}/{id}/sprite{scaling?}.{extension}`, handler: async (request, h) => { checkEMSProxyConfig(); From b718733a7bea74acd8119d4258295f675fba54c4 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Mon, 13 Jan 2020 20:06:07 -0800 Subject: [PATCH 07/10] pin ems-client dependency version --- package.json | 2 +- x-pack/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 56daab0a757be..e0114a021e5b4 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@elastic/apm-rum": "^4.6.0", "@elastic/charts": "^16.1.0", "@elastic/datemath": "5.0.2", - "@elastic/ems-client": "^7.6.0", + "@elastic/ems-client": "7.6.0", "@elastic/eui": "17.3.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", diff --git a/x-pack/package.json b/x-pack/package.json index a63f641ece487..cef7c0e2fd8c3 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -178,7 +178,7 @@ "@babel/runtime": "^7.5.5", "@elastic/apm-rum-react": "^0.3.2", "@elastic/datemath": "5.0.2", - "@elastic/ems-client": "^7.6.0", + "@elastic/ems-client": "7.6.0", "@elastic/eui": "17.3.1", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.1.0", From 1ade1fa0185e7e57af05c4bd0145841ff086d261 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 14 Jan 2020 08:37:34 -0800 Subject: [PATCH 08/10] Deprecate manifestServiceUrl setting --- .../server/config/deprecation/core_deprecations.ts | 10 ++++++++++ src/legacy/server/config/schema.js | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/core/server/config/deprecation/core_deprecations.ts b/src/core/server/config/deprecation/core_deprecations.ts index 36fe95e05cb53..90fe2a4565f6f 100644 --- a/src/core/server/config/deprecation/core_deprecations.ts +++ b/src/core/server/config/deprecation/core_deprecations.ts @@ -91,6 +91,15 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, log) => { return settings; }; +const mapManifestServiceUrlDeprecation: ConfigDeprecation = (settings, fromPath, log) => { + if (has(settings, 'map.manifestServiceUrl')) { + log( + `You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure Elastic Maps Service settings. Use "map.emsTileApiUrl" and "map.emsFileApiUrl" instead.` + ); + } + return settings; +}; + export const coreDeprecationProvider: ConfigDeprecationProvider = ({ unusedFromRoot, renameFromRoot, @@ -110,4 +119,5 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({ dataPathDeprecation, rewriteBasePathDeprecation, cspRulesDeprecation, + mapManifestServiceUrlDeprecation, ]; diff --git a/src/legacy/server/config/schema.js b/src/legacy/server/config/schema.js index 81ed2e6f69f89..88a794445870c 100644 --- a/src/legacy/server/config/schema.js +++ b/src/legacy/server/config/schema.js @@ -254,6 +254,9 @@ export default () => ) .default([]), }).default(), + manifestServiceUrl: Joi.string() + .default('') + .allow(''), emsFileApiUrl: Joi.string().default('https://vector-staging.maps.elastic.co'), emsTileApiUrl: Joi.string().default('https://tiles.maps.elastic.co'), emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v7.4'), From 4980eb23f77b066f6cff35590fecac1eb534db62 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 14 Jan 2020 09:24:02 -0800 Subject: [PATCH 09/10] Fix yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 9316ff7436a97..3bf20230357c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1398,7 +1398,7 @@ once "^1.4.0" pump "^3.0.0" -"@elastic/ems-client@^7.6.0": +"@elastic/ems-client@7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@elastic/ems-client/-/ems-client-7.6.0.tgz#ca548aba1a1f5170a1892de129b537b5248c74be" integrity sha512-oBtLH24qIgTaMhlSske49FTd35Y0nv+PlZCZaHkBhOH+ScsTDL3LO2lbIcSmcYQod43Ly34v/xwJvFCTxojVEQ== From ab1eb753ef5419bd5c0a7970c462f6d6a7ec2eae Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 14 Jan 2020 13:39:00 -0800 Subject: [PATCH 10/10] Review feedback --- src/core/server/config/deprecation/core_deprecations.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/server/config/deprecation/core_deprecations.ts b/src/core/server/config/deprecation/core_deprecations.ts index 90fe2a4565f6f..c63c9384da9d8 100644 --- a/src/core/server/config/deprecation/core_deprecations.ts +++ b/src/core/server/config/deprecation/core_deprecations.ts @@ -94,7 +94,10 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, log) => { const mapManifestServiceUrlDeprecation: ConfigDeprecation = (settings, fromPath, log) => { if (has(settings, 'map.manifestServiceUrl')) { log( - `You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure Elastic Maps Service settings. Use "map.emsTileApiUrl" and "map.emsFileApiUrl" instead.` + 'You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure the location ' + + 'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' + + '"map.emsFileApiUrl" settings instead. These settings are for development use only and should not be ' + + 'modified for use in production environments.' ); } return settings; @@ -106,6 +109,7 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({ }) => [ unusedFromRoot('savedObjects.indexCheckTimeout'), unusedFromRoot('server.xsrf.token'), + unusedFromRoot('maps.manifestServiceUrl'), renameFromRoot('optimize.lazy', 'optimize.watch'), renameFromRoot('optimize.lazyPort', 'optimize.watchPort'), renameFromRoot('optimize.lazyHost', 'optimize.watchHost'),