From 7f0802a9c989f70a0852edb651db15b241eebe28 Mon Sep 17 00:00:00 2001 From: Giordano Ricci Date: Wed, 9 Dec 2020 13:27:40 +0000 Subject: [PATCH] Elasticsearch: Deprecate browser access mode (#29649) * Elasticsearch: Show deprecation warning when selecting browser access mode * Docs: Show deprecation warning for Elasticsearch Browser access mode --- docs/sources/datasources/elasticsearch.md | 2 ++ .../elasticsearch/configuration/ConfigEditor.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/sources/datasources/elasticsearch.md b/docs/sources/datasources/elasticsearch.md index e4e2629c896..b28af607d65 100644 --- a/docs/sources/datasources/elasticsearch.md +++ b/docs/sources/datasources/elasticsearch.md @@ -35,6 +35,8 @@ All requests will be made from the browser to Grafana backend/server which in tu ### Browser (Direct) access +> **Warning:** Browser (Direct) access is deprecated and will be removed in a future release. + All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode. If you select Browser access you must update your Elasticsearch configuration to allow other domains to access diff --git a/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx index 1a6431723e8..cd04c37f0fa 100644 --- a/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/elasticsearch/configuration/ConfigEditor.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import { DataSourceHttpSettings } from '@grafana/ui'; +import { Alert, DataSourceHttpSettings } from '@grafana/ui'; import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; import { ElasticsearchOptions } from '../types'; import { defaultMaxConcurrentShardRequests, ElasticDetails } from './ElasticDetails'; @@ -30,6 +30,12 @@ export const ConfigEditor = (props: Props) => { return ( <> + {options.access === 'direct' && ( + + Browser access mode in the Elasticsearch datasource is deprecated and will be removed in a future release. + + )} +