diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 9797335e3cce..f483f89bbbc3 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -270,6 +270,15 @@ # 'ff00::/8', # ] +# Full AuthType list: ['NoAuth', 'UsernamePasswordType', 'SigV4']. +# Add / Remove elements in this list to Enable / Diasble auth types. +# If this setting is commented then all options will be available. +data_source.enabledAuthTypes: [ + 'NoAuth', + 'UsernamePasswordType', + 'SigV4', +] + # Set the value of this setting to false to hide the help menu link to the OpenSearch Dashboards user survey # opensearchDashboards.survey.url: "https://survey.opensearch.org" diff --git a/src/plugins/data_source/config.ts b/src/plugins/data_source/config.ts index d5412d32f0ff..ec2335290e1e 100644 --- a/src/plugins/data_source/config.ts +++ b/src/plugins/data_source/config.ts @@ -39,6 +39,9 @@ export const configSchema = schema.object({ appender: fileAppenderSchema, }), endpointDeniedIPs: schema.maybe(schema.arrayOf(schema.string())), + enabledAuthTypes: schema.arrayOf(schema.string(), { + defaultValue: ['NoAuth', 'UsernamePasswordType', 'SigV4'], + }), }); export type DataSourcePluginConfigType = TypeOf; diff --git a/src/plugins/data_source/public/plugin.ts b/src/plugins/data_source/public/plugin.ts index 65bee912255e..5ec380c4a79c 100644 --- a/src/plugins/data_source/public/plugin.ts +++ b/src/plugins/data_source/public/plugin.ts @@ -22,6 +22,7 @@ export class DataSourcePlugin implements Plugin = { exposeToBrowser: { enabled: true, hideLocalCluster: true, + enabledAuthTypes: true, }, schema: configSchema, }; diff --git a/src/plugins/data_source_management/public/management_app/mount_management_section.tsx b/src/plugins/data_source_management/public/management_app/mount_management_section.tsx index 9fe1f2406382..70067e4c4777 100644 --- a/src/plugins/data_source_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/data_source_management/public/management_app/mount_management_section.tsx @@ -10,6 +10,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Route, Router, Switch } from 'react-router-dom'; import { DataPublicPluginStart } from 'src/plugins/data/public'; +import { DataSourcePluginSetup } from 'src/plugins/data_source/public'; import { ManagementAppMountParams } from '../../../management/public'; import { OpenSearchDashboardsContextProvider } from '../../../opensearch_dashboards_react/public'; @@ -24,7 +25,8 @@ export interface DataSourceManagementStartDependencies { export async function mountManagementSection( getStartServices: StartServicesAccessor, - params: ManagementAppMountParams + params: ManagementAppMountParams, + dataSource: DataSourcePluginSetup ) { const [ { chrome, application, savedObjects, uiSettings, notifications, overlays, http, docLinks }, @@ -40,6 +42,7 @@ export async function mountManagementSection( http, docLinks, setBreadcrumbs: params.setBreadcrumbs, + enabledAuthTypes: dataSource.enabledAuthTypes, }; ReactDOM.render( diff --git a/src/plugins/data_source_management/public/plugin.ts b/src/plugins/data_source_management/public/plugin.ts index 0c7123e47a94..e36a9ffe42b0 100644 --- a/src/plugins/data_source_management/public/plugin.ts +++ b/src/plugins/data_source_management/public/plugin.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { DataSourcePluginSetup } from 'src/plugins/data_source/public'; import { CoreSetup, CoreStart, Plugin } from '../../../core/public'; import { PLUGIN_NAME } from '../common'; @@ -19,6 +20,7 @@ import { export interface DataSourceManagementSetupDependencies { management: ManagementSetup; indexPatternManagement: IndexPatternManagementSetup; + dataSource: DataSourcePluginSetup; } export interface DataSourceManagementPluginSetup { @@ -43,7 +45,7 @@ export class DataSourceManagementPlugin public setup( core: CoreSetup, - { management, indexPatternManagement }: DataSourceManagementSetupDependencies + { management, indexPatternManagement, dataSource }: DataSourceManagementSetupDependencies ) { const opensearchDashboardsSection = management.sections.section.opensearchDashboards; @@ -65,7 +67,7 @@ export class DataSourceManagementPlugin mount: async (params) => { const { mountManagementSection } = await import('./management_app'); - return mountManagementSection(core.getStartServices, params); + return mountManagementSection(core.getStartServices, params, dataSource); }, }); diff --git a/src/plugins/data_source_management/public/types.ts b/src/plugins/data_source_management/public/types.ts index d461daba82cc..49cca56f83bc 100644 --- a/src/plugins/data_source_management/public/types.ts +++ b/src/plugins/data_source_management/public/types.ts @@ -32,6 +32,7 @@ export interface DataSourceManagementContext { http: HttpSetup; docLinks: DocLinksStart; setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs']; + enabledAuthTypes: string[]; } export interface DataSourceTableItem {